Skip to content

Commit

Permalink
Merge remote-tracking branch 'proplib-template/main' into cross-platf…
Browse files Browse the repository at this point in the history
…orm-cli-driver
  • Loading branch information
aromanielloNTIA committed Nov 13, 2024
2 parents 0284c65 + 19b2e9d commit c49bcb3
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions app/tests/TestDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ class DriverTest: public ::testing::Test {
* struct. Optionally, the command can be written such that stdout and
* are suppressed.
*
* @param[in] params The driver parameters
* @param[in] suppressOutputs Whether to suppress outputs (default: true)
* @return The constructed command string
* @param[in] dParams The driver parameters
* @param[in] suppressOutputs Whether to suppress outputs (default: true)
* @return The constructed command string
**********************************************************************/
std::string BuildCommand(
const DrvrParams &params, const bool suppressOutputs = true
const DrvrParams &dParams, const bool suppressOutputs = true
) {
// Construct command from parameters
std::string command = executable;
command += " -i " + params.in_file;
switch (params.model) {
command += " -i " + dParams.in_file;
switch (dParams.model) {

Check warning on line 74 in app/tests/TestDriver.h

View workflow job for this annotation

GitHub Actions / macos-latest / CMake 3.21

enumeration value 'NOT_SET' not handled in switch [-Wswitch]

Check warning on line 74 in app/tests/TestDriver.h

View workflow job for this annotation

GitHub Actions / macos-latest / CMake 3.21

enumeration value 'NOT_SET' not handled in switch [-Wswitch]

Check warning on line 74 in app/tests/TestDriver.h

View workflow job for this annotation

GitHub Actions / macos-latest / CMake 3.21

enumeration value 'NOT_SET' not handled in switch [-Wswitch]

Check warning on line 74 in app/tests/TestDriver.h

View workflow job for this annotation

GitHub Actions / macos-latest / CMake 3.21

enumeration value 'NOT_SET' not handled in switch [-Wswitch]

Check warning on line 74 in app/tests/TestDriver.h

View workflow job for this annotation

GitHub Actions / macos-latest / CMake latest

enumeration value 'NOT_SET' not handled in switch [-Wswitch]

Check warning on line 74 in app/tests/TestDriver.h

View workflow job for this annotation

GitHub Actions / macos-latest / CMake latest

enumeration value 'NOT_SET' not handled in switch [-Wswitch]

Check warning on line 74 in app/tests/TestDriver.h

View workflow job for this annotation

GitHub Actions / macos-latest / CMake latest

enumeration value 'NOT_SET' not handled in switch [-Wswitch]

Check warning on line 74 in app/tests/TestDriver.h

View workflow job for this annotation

GitHub Actions / macos-latest / CMake latest

enumeration value 'NOT_SET' not handled in switch [-Wswitch]
case P2108Model::HGTCM:
command += " -model HGTCM";
break;
Expand All @@ -82,7 +82,7 @@ class DriverTest: public ::testing::Test {
command += " -model ASM";
break;
}
command += " -o " + params.out_file;
command += " -o " + dParams.out_file;

// Suppress text output of the driver, to avoid cluttering
// test outputs.
Expand Down Expand Up @@ -115,11 +115,11 @@ class DriverTest: public ::testing::Test {
/***********************************************************************
* Runs the driver executable.
*
* @param[in] params Parameters to parse as command line arguments
* @return Return code from the driver execution
* @param[in] dParams Parameters to parse as command line arguments
* @return Return code from the driver execution
**********************************************************************/
int RunDriver(const DrvrParams &params) {
std::string cmd = BuildCommand(params);
int RunDriver(const DrvrParams &dParams) {
std::string cmd = BuildCommand(dParams);
return RunCommand(cmd);
}

Expand All @@ -134,13 +134,13 @@ class DriverTest: public ::testing::Test {
* driver, it is deleted before this method returns.
*
* @param[in] inFileContents The contents to write to the input file
* @param[in] params A populated driver parameters struct (see above)
* @param[in] dParams A populated driver parameters struct (see above)
* @return Return code from the driver execution
**********************************************************************/
int RunDriverWithInputFile(
const std::string &inFileContents, const DrvrParams &params
const std::string &inFileContents, const DrvrParams &dParams
) {
DrvrParams updated_params = params;
DrvrParams updated_params = dParams;
TempTextFile tempFile(inFileContents);
updated_params.in_file = tempFile.getFileName();
int rtn = RunDriver(updated_params);
Expand Down

0 comments on commit c49bcb3

Please sign in to comment.