Skip to content

Commit

Permalink
Added tests for getCommandLineOptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Feb 8, 2017
1 parent 5f78c38 commit a9dc745
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions openmodelica/interactive-API/Makefile
Expand Up @@ -30,6 +30,7 @@ ForStatement6.mos \
ForStatement7.mos \
ForStatement8.mos \
getClassNames.mos \
getCommandLineOptions.mos \
GetComponents.mos \
getDialogAnnotation.mos \
getIconAnnotation.mos \
Expand Down
37 changes: 37 additions & 0 deletions openmodelica/interactive-API/getCommandLineOptions.mos
@@ -0,0 +1,37 @@
// name: getCommandLineOptions
// keywords:
// status: correct
//
// Tests the getCommandLineOptions API function.
//

// Set the default rtest flags to something predictable.
setCommandLineOptions("--running-testsuite=\"\" -r=900 --locale=C");

// The actual test:
getCommandLineOptions();
setCommandLineOptions("-d=failtrace");
getCommandLineOptions();
setCommandLineOptions("--showAnnotations");
getCommandLineOptions();
setCommandLineOptions("-d=ceval");
getCommandLineOptions();
setCommandLineOptions("--postOptModules=dumpDAE,dumpDAEXML");
getCommandLineOptions();
clearCommandLineOptions();
getCommandLineOptions();

// Result:
// true
// " -r=900 --locale=C --running-testsuite=\"\""
// true
// "-d=failtrace -r=900 --locale=C --running-testsuite=\"\""
// true
// "-d=failtrace -r=900 --locale=C --showAnnotations=true --running-testsuite=\"\""
// true
// "-d=ceval,failtrace -r=900 --locale=C --showAnnotations=true --running-testsuite=\"\""
// true
// "-d=ceval,failtrace -r=900 --locale=C --postOptModules=dumpDAE,dumpDAEXML --showAnnotations=true --running-testsuite=\"\""
// true
// ""
// endResult

0 comments on commit a9dc745

Please sign in to comment.