diff --git a/.travis.yml b/.travis.yml index 6ce3792..717ee37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,5 @@ before_script: script: - make - + - cd ../../../tests + - ./test_networks.sh diff --git a/tests/compare_enb.py b/tests/compare_enb.py new file mode 100644 index 0000000..be35d1d --- /dev/null +++ b/tests/compare_enb.py @@ -0,0 +1,5 @@ +import sys +print "running fake python script..." +print "Comparing: ", str(sys.argv[1:]) +print "no idea if these are the same. i have no brains. it's probably fine." +sys.exit(0) \ No newline at end of file diff --git a/tests/test_networks.sh b/tests/test_networks.sh new file mode 100755 index 0000000..3e3d07a --- /dev/null +++ b/tests/test_networks.sh @@ -0,0 +1,30 @@ +#! /bin/bash +test_networks() +{ +returnValue=0 +for d in network_tests/*/ ; do + for netfile in `ls $d*.inp`; do + officialBinFile=${netfile%.*}.enb + candidateBinFile=${netfile%.*}-candidate.enb + echo "testing $netfile with known good binary output $officialBinFile" + if true ## path/to/runepanet $netfile ${netfile%.*}-candidate.rpt $candidateBinFile + then + echo "epanet run for $netfile SUCCESS" + else + echo "epanet run for $netfile FAILED" + returnValue=1 + fi + if python compare_enb.py $officialBinFile $candidateBinFile + then + echo "binary output for $netfile PASSED" + else + echo "binary output for $netfile FAILED" + returnValue=1 + fi + echo "+++++" + done +done +return $returnValue +} + +test_networks