-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_formatting.sh
executable file
·45 lines (34 loc) · 1.03 KB
/
test_formatting.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Test if prettify was run
# author: Ole Schuett
set -e
rm -rf preprettify
find ./src/ -type f -not -path "*/preprettify/*" -not -path "*/.git/*" -print0 | xargs -0 md5sum > checksums.md5
md5sum ./data/POTENTIAL >> checksums.md5
make -j 16 pretty
make -j 16 pretty # run twice to ensure consistency with doxify
cd data
cat GTH_POTENTIALS HF_POTENTIALS NLCC_POTENTIALS ALL_POTENTIALS > POTENTIAL
cd ..
nfiles=`wc -l checksums.md5 | cut -f 1 -d " "`
summary="Checked $nfiles files."
status="OK"
echo "Searching for doxify warnings ..."
if grep -r -e "UNMATCHED_PROCEDURE_ARGUMENT" \
-e "UNKNOWN_DOXYGEN_COMMENT" \
-e "UNKNOWN_COMMENT" \
--exclude-dir=".git" \
--exclude-dir="preprettify" \
./src/* ; then
summary="Found doxify warnings"
status="FAILED"
fi
echo "Comparing MD5-sums ..."
if ! md5sum --quiet --check checksums.md5 ; then
summary='Code not invariant under "make pretty"'
status="FAILED"
fi
rm checksums.md5
echo "Summary:" $summary
echo "Status:" $status
#EOF