Skip to content

Commit

Permalink
Add arguments
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kjnam committed Aug 10, 2023
1 parent e17e9f1 commit dfbcf45
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/test_output/test_output.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// test_scirbio2.cpp : Defines the entry point for the console application.
// test_scribio2.cpp : Defines the entry point for the console application.
//

#include "SCHISMFile10.h"
Expand Down Expand Up @@ -325,12 +325,15 @@ int testZCoreProvider(std::string &file1, std::string &out)
return 0;
}

void main()
void main(int argc, char *argv[])
{
std::string meshFile = "out2d_1.nc";
std::string meshFile;
std::string soutputFile;
// The first arg is an out2d file, if it exists.
// The second one is a SCHISM file to test.
meshFile = argc > 1 ? argv[1] : "E:/temp/test/b1/out2d_1.nc";
soutputFile = argc > 2 ? argv[2] : "E:/temp/test/depth_averaged_salinity_75.nc";
test_netcdf4(meshFile);
std::string soutputFile = "E:/temp/test/depth_averaged_salinity_75.nc";
meshFile = "E:/temp/test/b1/out2d_1.nc";
testScribeIO(soutputFile, meshFile);
}

Expand Down

0 comments on commit dfbcf45

Please sign in to comment.