From dd5d3d2e36c8f023d183ad568d3e3fa6fc0e3bff Mon Sep 17 00:00:00 2001 From: Sam Hatchett Date: Tue, 15 Dec 2015 16:39:47 -0500 Subject: [PATCH 1/5] adds cmake build for ENBOF --- build/CMake/CMakeLists.txt | 4 ++++ build/Xcode/epanet.xcodeproj/project.pbxproj | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/build/CMake/CMakeLists.txt b/build/CMake/CMakeLists.txt index bac6e0d..caa4fa2 100644 --- a/build/CMake/CMakeLists.txt +++ b/build/CMake/CMakeLists.txt @@ -17,3 +17,7 @@ add_library(epanet STATIC ${EPANET_SOURCES}) include_directories(../../src) add_executable(runepanet ../../run/main.c) target_link_libraries (runepanet LINK_PUBLIC epanet m) + +# the binary hydraulics file API +include_directories(../../tools/outputapi) +add_library(epanet_bin_out STATIC ../../tools/outputapi/outputapi.c) diff --git a/build/Xcode/epanet.xcodeproj/project.pbxproj b/build/Xcode/epanet.xcodeproj/project.pbxproj index 02864fd..d7fb082 100755 --- a/build/Xcode/epanet.xcodeproj/project.pbxproj +++ b/build/Xcode/epanet.xcodeproj/project.pbxproj @@ -134,6 +134,8 @@ 22322FA9106836B000641384 /* epanet2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 2; name = epanet2.h; path = ../../include/epanet2.h; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 2255753B17551217009946B1 /* libepanet-static.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libepanet-static.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 22CD9A5D1B27898E00B65E83 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main.c; path = ../../run/main.c; sourceTree = ""; }; + 22E107B21C163E5300689CED /* outputapi.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = outputapi.c; path = ../../tools/outputapi/outputapi.c; sourceTree = ""; }; + 22E107B31C163E5300689CED /* outputapi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = outputapi.h; path = ../../tools/outputapi/outputapi.h; sourceTree = ""; }; D2AAC0630554660B00DB518D /* libepanet.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libepanet.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -181,6 +183,7 @@ 08FB7794FE84155DC02AAC07 /* epanet */ = { isa = PBXGroup; children = ( + 22E107B11C163E3B00689CED /* Output API */, 223109E21BA865790030AAE8 /* sample networks */, 22CD9A5C1B27896200B65E83 /* run epanet */, 22322FA8106836A000641384 /* Include */, @@ -255,6 +258,15 @@ name = "run epanet"; sourceTree = ""; }; + 22E107B11C163E3B00689CED /* Output API */ = { + isa = PBXGroup; + children = ( + 22E107B31C163E5300689CED /* outputapi.h */, + 22E107B21C163E5300689CED /* outputapi.c */, + ); + name = "Output API"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ From 2f344d48847fbe3572647dc0e4dcc61c90d5a41b Mon Sep 17 00:00:00 2001 From: Sam Hatchett Date: Tue, 15 Dec 2015 16:40:01 -0500 Subject: [PATCH 2/5] adds/fixes attribution --- .mailmap | 8 +++++--- AUTHORS | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.mailmap b/.mailmap index e9efe6a..808fc22 100644 --- a/.mailmap +++ b/.mailmap @@ -1,7 +1,9 @@ Sam Hatchett James Uber Demetrios Eliades -Hyoungmin Woo Mickey -Hyoungmin Woo Hyoungmin Woo +Hyoungmin Woo +Hyoungmin Woo Yunier Soad -Jinduan Chen \ No newline at end of file +Jinduan Chen +Maurizio Cingi +Elad Salomons \ No newline at end of file diff --git a/AUTHORS b/AUTHORS index df0b6bf..b12a354 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,3 +16,5 @@ Will Furnass Steffen Macke Mariosmsk Elad Salomons +Maurizio Cingi +Bryant McDonnell From 92ea5a84a703bdab917fe460f3f285a82cef08b6 Mon Sep 17 00:00:00 2001 From: Sam Hatchett Date: Tue, 15 Dec 2015 20:38:53 -0500 Subject: [PATCH 3/5] testing scripts and travis invocation --- .travis.yml | 3 ++- tests/compare_enb.py | 5 +++++ tests/test_networks.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tests/compare_enb.py create mode 100755 tests/test_networks.sh 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 From 6579a83ba3f452683e8fa3f30fc94cf9c5790d0d Mon Sep 17 00:00:00 2001 From: Sam Hatchett Date: Tue, 15 Dec 2015 20:39:03 -0500 Subject: [PATCH 4/5] fake files for test iteration --- tests/network_tests/net1/net1.enb | 0 tests/network_tests/net1/net1.inp | 0 tests/network_tests/net2/net2.enb | 0 tests/network_tests/net2/net2.inp | 0 tests/network_tests/net3/net3.enb | 0 tests/network_tests/net3/net3.inp | 0 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/network_tests/net1/net1.enb create mode 100644 tests/network_tests/net1/net1.inp create mode 100644 tests/network_tests/net2/net2.enb create mode 100644 tests/network_tests/net2/net2.inp create mode 100644 tests/network_tests/net3/net3.enb create mode 100644 tests/network_tests/net3/net3.inp diff --git a/tests/network_tests/net1/net1.enb b/tests/network_tests/net1/net1.enb new file mode 100644 index 0000000..e69de29 diff --git a/tests/network_tests/net1/net1.inp b/tests/network_tests/net1/net1.inp new file mode 100644 index 0000000..e69de29 diff --git a/tests/network_tests/net2/net2.enb b/tests/network_tests/net2/net2.enb new file mode 100644 index 0000000..e69de29 diff --git a/tests/network_tests/net2/net2.inp b/tests/network_tests/net2/net2.inp new file mode 100644 index 0000000..e69de29 diff --git a/tests/network_tests/net3/net3.enb b/tests/network_tests/net3/net3.enb new file mode 100644 index 0000000..e69de29 diff --git a/tests/network_tests/net3/net3.inp b/tests/network_tests/net3/net3.inp new file mode 100644 index 0000000..e69de29 From 96cf6ece16301f7ee680b867e9fbdfa796ecb911 Mon Sep 17 00:00:00 2001 From: Sam Hatchett Date: Tue, 15 Dec 2015 20:41:54 -0500 Subject: [PATCH 5/5] Revert "adds/fixes attribution" This reverts commit 2f344d48847fbe3572647dc0e4dcc61c90d5a41b. --- .mailmap | 8 +++----- AUTHORS | 2 -- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.mailmap b/.mailmap index 808fc22..e9efe6a 100644 --- a/.mailmap +++ b/.mailmap @@ -1,9 +1,7 @@ Sam Hatchett James Uber Demetrios Eliades -Hyoungmin Woo -Hyoungmin Woo +Hyoungmin Woo Mickey +Hyoungmin Woo Hyoungmin Woo Yunier Soad -Jinduan Chen -Maurizio Cingi -Elad Salomons \ No newline at end of file +Jinduan Chen \ No newline at end of file diff --git a/AUTHORS b/AUTHORS index b12a354..df0b6bf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,5 +16,3 @@ Will Furnass Steffen Macke Mariosmsk Elad Salomons -Maurizio Cingi -Bryant McDonnell