Skip to content

Commit

Permalink
- Made WSM-internal flags INTERNAL, so OMC helptext does not include it
Browse files Browse the repository at this point in the history
- Stopped the madness of using matchcontinue for code that doesn't need it and is called a lot


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15637 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Mar 25, 2013
1 parent e30f00f commit e51264c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Compiler/Util/Flags.mo
Expand Up @@ -524,7 +524,7 @@ constant ConfigFlag HELP = CONFIG_FLAG(2, "help",
SOME(STRING_OPTION({"debug", "optmodules"})),
Util.gettext("Displays the help text."));
constant ConfigFlag RUNNING_TESTSUITE = CONFIG_FLAG(3, "running-testsuite",
NONE(), EXTERNAL(), STRING_FLAG(""), NONE(),
NONE(), INTERNAL(), STRING_FLAG(""), NONE(),
Util.gettext("Used when running the testsuite."));
constant ConfigFlag SHOW_VERSION = CONFIG_FLAG(4, "version",
SOME("+v"), EXTERNAL(), BOOL_FLAG(false), NONE(),
Expand Down Expand Up @@ -774,7 +774,7 @@ constant ConfigFlag SCALARIZE_MINMAX = CONFIG_FLAG(47, "scalarizeMinMax",
NONE(), EXTERNAL(), BOOL_FLAG(false), NONE(),
Util.gettext("Scalarizes the builtin min/max reduction operators if true."));
constant ConfigFlag RUNNING_WSM_TESTSUITE = CONFIG_FLAG(48, "wsm-testsuite",
NONE(), EXTERNAL(), BOOL_FLAG(false), NONE(),
NONE(), INTERNAL(), BOOL_FLAG(false), NONE(),
Util.gettext("Used when running the WSM testsuite."));

// This is a list of all configuration flags. A flag can not be used unless it's
Expand Down
42 changes: 7 additions & 35 deletions Compiler/Util/Util.mo
Expand Up @@ -3661,59 +3661,31 @@ public function testsuiteFriendly "Testsuite friendly name (start after testsuit
input String name;
output String friendly;
algorithm
friendly := matchcontinue(name)
local
String outStr;
case(_)
equation
true = Config.getRunningWSMTestsuite();
outStr = testsuiteFriendlyWSM(name);
then outStr;
case(_)
equation
outStr = testsuiteFriendly2(Config.getRunningTestsuite(),name);
then outStr;
end matchcontinue;
friendly := testsuiteFriendly2(Config.getRunningTestsuite(),Config.getRunningWSMTestsuite(),name);
end testsuiteFriendly;


protected function testsuiteFriendly2 "Testsuite friendly name (start after testsuite/ or build/)"
input Boolean cond;
input Boolean wsmTestsuite;
input String name;
output String friendly;
algorithm
friendly := matchcontinue (cond,name)
friendly := match (cond,wsmTestsuite,name)
local
Integer i;
list<String> strs;
String newName;
case (_,true,_) then System.basename(name);

case (true,_)
case (true,_,_)
equation
true = "Windows_NT" ==& System.os();
// replace \\ with / for Windows.
newName = System.stringReplace(name, "\\", "/");
newName = Debug.bcallret3("Windows_NT" ==& System.os(), System.stringReplace, name, "\\", "/", name);
(i,strs) = System.regex(newName, "^(.*/testsuite/)?(.*/build/)?(.*)$", 4, true, false);
friendly = listGet(strs,i);
then
friendly;

case (true,_)
equation
false = "Windows_NT" ==& System.os();
(i,strs) = System.regex(name, "^(.*/testsuite/)?(.*/build/)?(.*)$", 4, true, false);
friendly = listGet(strs,i);
then friendly;

else name;
end matchcontinue;
end match;
end testsuiteFriendly2;

protected function testsuiteFriendlyWSM "This function is the special case for MathCore WSM"
input String name;
output String friendly;
algorithm
friendly:=System.basename(name);
end testsuiteFriendlyWSM;

end Util;

0 comments on commit e51264c

Please sign in to comment.