diff --git a/tools/before-test.cmd b/tools/before-test.cmd index 4926189..f663bc1 100644 --- a/tools/before-test.cmd +++ b/tools/before-test.cmd @@ -80,9 +80,11 @@ curl -fsSL -o examples.zip %TESTFILES_URL% curl -fsSL -o benchmark.zip %BENCHFILES_URL% -:: extract tests and benchmarks +:: extract tests, benchmarks, and manifest 7z x examples.zip *\epanet-tests\* > nul 7z x benchmark.zip -obenchmark\ > nul +7z e benchmark.zip -o. manifest.json -r + :: set up symlink for tests directory mklink /D .\tests .\epanet-example-networks-%LATEST_TAG:~1%\epanet-tests > nul diff --git a/tools/before-test.sh b/tools/before-test.sh index 5e3d805..0fa4c51 100755 --- a/tools/before-test.sh +++ b/tools/before-test.sh @@ -82,12 +82,13 @@ curl -fsSL -o examples.tar.gz ${TEST_URL} curl -fsSL -o benchmark.tar.gz ${BENCH_URL} -# extract tests and benchmarks +# extract tests, benchmarks, and manifest tar xzf examples.tar.gz ln -s epanet-example-networks-${LATEST_TAG:1}/epanet-tests tests mkdir benchmark tar xzf benchmark.tar.gz -C benchmark +tar xzf benchmark.tar.gz --wildcards --no-anchored --strip-components=1 '*/manifest.json' -C . # generate json configuration file for software under test diff --git a/tools/run-nrtest.sh b/tools/run-nrtest.sh index 9b093b4..077dd24 100755 --- a/tools/run-nrtest.sh +++ b/tools/run-nrtest.sh @@ -69,10 +69,9 @@ print_usage() { # Default option values compare='true' -ref_build_id='' +ref_build_id= sut_build_id='local' test_path='nrtestsuite' -version='vXXX' while getopts "cr:s:t:" flag; do case "${flag}" in @@ -87,9 +86,10 @@ done shift $(($OPTIND - 1)) +# determine ref_build_id from manifest file if [ -z $ref_build_id ]; then - echo "ERROR: REF_BUILD_ID must be defined" - exit 1; + description=(`cat ${test_path}/manifest.json | jq '.Application.description | splits(" ")'`) + ref_build_id=${description[1]//\"/} fi # Invoke command