tuning build.sh to handle -DLTC_EASY

This commit is contained in:
Karel Miko 2017-03-01 13:35:19 +01:00
parent 856be9cae8
commit be9c66ab43
2 changed files with 17 additions and 3 deletions

View File

@ -3,6 +3,11 @@ echo "$1 ($2, $3)..."
make clean 1>/dev/null 2>/dev/null make clean 1>/dev/null 2>/dev/null
if [ -f check-source.pl ] ; then
echo "checking white spaces..."
perl check-source.pl || exit 1
fi
echo -n "building..." echo -n "building..."
if [ -f /proc/cpuinfo ] if [ -f /proc/cpuinfo ]
@ -28,7 +33,17 @@ echo -n "testing..."
if [ -a test ] && [ -f test ] && [ -x test ]; then if [ -a test ] && [ -f test ] && [ -x test ]; then
((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt" && exit 1) ((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt" && exit 1)
if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then
for f in *_tv.txt; do if (diff -i -w -B $f notes/$f) then true; else (echo "tv_gen $f failed" && rm -f testok.txt && exit 1); fi; done for f in *_tv.txt; do
# check for lines starting with '<' ($f might be a subset of notes/$f)
difftroubles=$(diff -i -w -B $f notes/$f | grep '^<')
if [ -n "$difftroubles" ]; then
echo "FAILURE: $f"
diff -i -w -B $f notes/$f
echo "tv_gen $f failed" && rm -f testok.txt && exit 1
else
true
fi
done
fi fi
fi fi

View File

@ -9,7 +9,6 @@
use strict; use strict;
use warnings; use warnings;
use Test::More;
use File::Find 'find'; use File::Find 'find';
use File::Basename 'basename'; use File::Basename 'basename';
use File::Glob 'bsd_glob'; use File::Glob 'bsd_glob';
@ -37,7 +36,7 @@ for my $file (sort @all_files) {
$lineno++; $lineno++;
} }
for my $k (sort keys %$troubles) { for my $k (sort keys %$troubles) {
warn "FAIL: [$k] $file line:" . join(",", @{$troubles->{$k}}) . "\n"; warn "[$k] $file line:" . join(",", @{$troubles->{$k}}) . "\n";
$fails++; $fails++;
} }
} }