Introducing default arguments

This commit is contained in:
Michael Tryby
2019-02-12 13:13:35 -05:00
parent d33afdd079
commit 678a2c2b45
2 changed files with 18 additions and 8 deletions

View File

@@ -58,7 +58,7 @@ build_script:
before_test: before_test:
- cd %EPANET_HOME% - cd %EPANET_HOME%
- tools\before-test.cmd %TEST_HOME% %EPANET_HOME%\%BUILD_HOME%\bin\Release %APPVEYOR_REPO_COMMIT% - tools\before-test.cmd %APPVEYOR_REPO_COMMIT%
# run custom test script # run custom test script
test_script: test_script:

View File

@@ -7,9 +7,8 @@
:: US EPA - ORD/NRMRL :: US EPA - ORD/NRMRL
:: ::
:: Arguments: :: Arguments:
:: 1 - relative path regression test file staging location :: 1 - build identifier for software under test
:: 2 - absolute path to location of software under test :: 2 - (relative path regression test file staging location)
:: 3 - build identifier for software under test
:: ::
:: Note: :: Note:
:: Tests and benchmark files are stored in the epanet-example-networks repo. :: Tests and benchmark files are stored in the epanet-example-networks repo.
@@ -21,13 +20,24 @@
@echo off @echo off
setlocal setlocal
set SCRIPT_HOME=%~dp0
set TEST_HOME=%~1
set EXAMPLES_VER=1.0.2-dev.5 set EXAMPLES_VER=1.0.2-dev.5
set BENCHMARK_VER=220dev5 set BENCHMARK_VER=220dev5
set "SCRIPT_HOME=%~dp0"
set "EXE_HOME=buildprod\bin\Release"
:: Determine SUT executable path
for %%a in ("%SCRIPT_HOME:~0,-1%") do set "SUT_PATH=%%~dpa"
set SUT_PATH=%SUT_PATH%%EXE_HOME%
:: Check existence and apply default arguments
IF NOT [%1]==[] ( set "SUT_VER=%~1"
) ELSE ( set "SUT_VER=vXXX" )
IF NOT [%2]==[] ( set "TEST_HOME=%~2"
) ELSE ( set "TEST_HOME=nrtestsuite" )
set TESTFILES_URL=https://github.com/OpenWaterAnalytics/epanet-example-networks/archive/v%EXAMPLES_VER%.zip set TESTFILES_URL=https://github.com/OpenWaterAnalytics/epanet-example-networks/archive/v%EXAMPLES_VER%.zip
set BENCHFILES_URL=https://github.com/OpenWaterAnalytics/epanet-example-networks/releases/download/v%EXAMPLES_VER%/epanet-benchmark-%BENCHMARK_VER%.zip set BENCHFILES_URL=https://github.com/OpenWaterAnalytics/epanet-example-networks/releases/download/v%EXAMPLES_VER%/epanet-benchmark-%BENCHMARK_VER%.zip
@@ -59,4 +69,4 @@ mklink /D .\tests .\epanet-example-networks-%EXAMPLES_VER%\epanet-tests
:: generate json configuration file for software under test :: generate json configuration file for software under test
mkdir apps mkdir apps
%SCRIPT_HOME%\gen-config.cmd %~2 > apps\epanet-%~3.json %SCRIPT_HOME%\gen-config.cmd %SUT_PATH% > apps\epanet-%SUT_VER%.json