Skip to content

Commit dfbcf45

Browse files
committed
Add arguments
This commit adds argument to provide test file names, while keeping the original hard-coded file names. This is not the best solution, but it will gives an option for the test to choose files. Resolves #8
1 parent e17e9f1 commit dfbcf45

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/test_output/test_output.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// test_scirbio2.cpp : Defines the entry point for the console application.
1+
// test_scribio2.cpp : Defines the entry point for the console application.
22
//
33

44
#include "SCHISMFile10.h"
@@ -325,12 +325,15 @@ int testZCoreProvider(std::string &file1, std::string &out)
325325
return 0;
326326
}
327327

328-
void main()
328+
void main(int argc, char *argv[])
329329
{
330-
std::string meshFile = "out2d_1.nc";
330+
std::string meshFile;
331+
std::string soutputFile;
332+
// The first arg is an out2d file, if it exists.
333+
// The second one is a SCHISM file to test.
334+
meshFile = argc > 1 ? argv[1] : "E:/temp/test/b1/out2d_1.nc";
335+
soutputFile = argc > 2 ? argv[2] : "E:/temp/test/depth_averaged_salinity_75.nc";
331336
test_netcdf4(meshFile);
332-
std::string soutputFile = "E:/temp/test/depth_averaged_salinity_75.nc";
333-
meshFile = "E:/temp/test/b1/out2d_1.nc";
334337
testScribeIO(soutputFile, meshFile);
335338
}
336339

0 commit comments

Comments
 (0)