From bb95bc9fc5bf066e19918ee4315839421f095434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 22 Jul 2015 12:55:39 +0200 Subject: [PATCH] Travis: run extra tests --- .travis.yml | 2 ++ tools/run_more_tests.sh | 41 +++++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3fc35eba1..a72e4ed37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,8 @@ script: - touch lib/mathlib.cpp - touch test/testmathlib.cpp - make test -j4 +# run extra tests + - tools/generate_and_run_tests.sh # compile gui - cd gui - qmake diff --git a/tools/run_more_tests.sh b/tools/run_more_tests.sh index 6cf3ad813..49e74019e 100755 --- a/tools/run_more_tests.sh +++ b/tools/run_more_tests.sh @@ -1,91 +1,92 @@ #!/bin/bash +# Script Used by generate_and_run_tests.sh set -e -~/cppcheck/cppcheck -q . 2> 1.txt +../cppcheck -q . 2> 1.txt # (!x) => (x==0) sed -ri 's/([(&][ ]*)\!([a-z]+)([ ]*[&)])/\1\2==0\3/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (x==0) => (0==x) sed -ri 's/([(&][ ]*)([a-z]+)[ ]*==[ ]*0([ ]*[&)])/\10==\2\3/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (0==x) => (!x) sed -ri 's/([(&][ ]*)0[ ]*==[ ]*([a-z]+)([ ]*[&)])/\1!\2\3/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # if (x) => (x!=0) sed -ri 's/(if[ ]*\([ ]*[a-z]+)([ ]*[&)])/\1!=0\2/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # while (x) => (x!=0) sed -ri 's/(while[ ]*\([ ]*[a-z]+)([ ]*[&)])/\1!=0\2/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (x!=0) => (0!=x) sed -ri 's/([(&][ ]*)([a-z]+)[ ]*!=[ ]*0([ ]*[&)])/\10!=\2\3/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (0!=x) => (x) sed -ri 's/([(&][ ]*)0[ ]*!=[ ]*([a-z]+[ ]*[&)])/\1\2/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (x < 0) => (0 > x) sed -ri 's/([(&][ ]*)([a-z]+)[ ]*<[ ]*(\-?[0-9]+)([ ]*[&)])/\1\3>\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (x <= 0) => (0 >= x) sed -ri 's/([(&][ ]*)([a-z]+)[ ]*<=[ ]*(\-?[0-9]+)([ ]*[&)])/\1\3>=\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (x > 0) => (0 < x) sed -ri 's/([(&][ ]*)([a-z]+)[ ]*<=[ ]*(\-?[0-9]+)([ ]*[&)])/\1\3>=\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (x >= 0) => (0 <= x) sed -ri 's/([(&][ ]*)([a-z]+)[ ]*<=[ ]*(\-?[0-9]+)([ ]*[&)])/\1\3>=\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (x == 123) => (123 == x) sed -ri 's/([(&][ ]*)([a-z]+)[ ]*==[ ]*(\-?[0-9]+)([ ]*[&)])/\1\3==\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (x != 123) => (123 != x) sed -ri 's/([(&][ ]*)([a-z]+)[ ]*\!=[ ]*(\-?[0-9]+)([ ]*[&)])/\1\3!=\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (0 < x) => (x > 0) sed -ri 's/([(&][ ]*)(\-?[0-9]+)[ ]*<[ ]*([a-z]+)([ ]*[&)])/\1\3>\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (0 <= x) => (x >= 0) sed -ri 's/([(&][ ]*)(\-?[0-9]+)[ ]*<=[ ]*([a-z]+)([ ]*[&)])/\1\3>=\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (0 > x) => (x < 0) sed -ri 's/([(&][ ]*)(\-?[0-9]+)[ ]*<=[ ]*([a-z]+)([ ]*[&)])/\1\3>=\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (0 >= x) => (x <= 0) sed -ri 's/([(&][ ]*)(\-?[0-9]+)[ ]*<=[ ]*([a-z]+)([ ]*[&)])/\1\3>=\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (123 == x) => (x == 123) sed -ri 's/([(&][ ]*)(\-?[0-9]+)[ ]*==[ ]*([a-z]+)([ ]*[&)])/\1\3==\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt # (123 != x) => (x <= 123) sed -ri 's/([(&][ ]*)(\-?[0-9]+)[ ]*\!=[ ]*([a-z]+)([ ]*[&)])/\1\3!=\2\4/' *.cpp -~/cppcheck/cppcheck -q . 2> 2.txt && diff 1.txt 2.txt +../cppcheck -q . 2> 2.txt && diff 1.txt 2.txt