Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Added os test in CommandConfiguration
Browse files Browse the repository at this point in the history
All other OS set functions in other tests are "useless" for local tests

Signed-off-by: Joe Osborn <osbornjd@ornl.gov>
  • Loading branch information
Joe Osborn committed Sep 6, 2019
1 parent 6f3308d commit d0b65c6
Showing 1 changed file with 11 additions and 3 deletions.
Expand Up @@ -40,14 +40,22 @@ public void testCommandConfiguration() {
config.setExecutable("./some_executable.sh");
config.setErrFileName("errorFile.txt");
config.setOutFileName("outFile.txt");

// Assert whether or not things are/aren't set
assert (config.getOutFileName() != null);
assert (config.getOS() != null);

// Didn't set working directory
assert (config.getWorkingDirectory() == null);

// Assert that the default local OS is set
assert (config.getOS().equals(System.getProperty("os.name")));

config.setOS("JoeOsbornOS");

assert (config.getOS().equals("JoeOsbornOS"));


}

/**
Expand All @@ -63,7 +71,7 @@ public void testGetExecutableName() {
config.setInputFile("someInputFile.txt");
config.setNumProcs("1");
config.setAppendInput(true);

config.setOS("osx");
String executable = config.getExecutableName();
assert (executable.equals("./test_code_execution.sh someInputFile.txt"));

Expand Down Expand Up @@ -93,7 +101,7 @@ public void testGetExecutableNameSplitCommand() {
splitConfig.setNumProcs("1");
splitConfig.setInputFile("inputfile.txt");
splitConfig.setInstallDirectory("~/install_dir");

splitConfig.setOS("osx");
String executable = splitConfig.getExecutableName();
assert (executable
.equals("./dummy.sh inputfile.txt; ./next_file.sh inputfile.txt; ./other_file.sh ~/install_dir/"));
Expand Down

0 comments on commit d0b65c6

Please sign in to comment.