Merge pull request #58 from OpenWaterAnalytics/dev-2.1-test-network-script
Dev 2.1 test network script
This commit is contained in:
@@ -8,4 +8,5 @@ before_script:
|
||||
|
||||
script:
|
||||
- make
|
||||
|
||||
- cd ../../../tests
|
||||
- ./test_networks.sh
|
||||
|
||||
5
tests/compare_enb.py
Normal file
5
tests/compare_enb.py
Normal file
@@ -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)
|
||||
0
tests/network_tests/net1/net1.enb
Normal file
0
tests/network_tests/net1/net1.enb
Normal file
0
tests/network_tests/net1/net1.inp
Normal file
0
tests/network_tests/net1/net1.inp
Normal file
0
tests/network_tests/net2/net2.enb
Normal file
0
tests/network_tests/net2/net2.enb
Normal file
0
tests/network_tests/net2/net2.inp
Normal file
0
tests/network_tests/net2/net2.inp
Normal file
0
tests/network_tests/net3/net3.enb
Normal file
0
tests/network_tests/net3/net3.enb
Normal file
0
tests/network_tests/net3/net3.inp
Normal file
0
tests/network_tests/net3/net3.inp
Normal file
30
tests/test_networks.sh
Executable file
30
tests/test_networks.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user