Skip to content

Commit

Permalink
Also output that custom commands were used
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18477 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Dec 13, 2013
1 parent 90f6059 commit e44974e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Examples/BuildModelRecursive.mos
@@ -1,6 +1,7 @@
// Note: Run with +g=MetaModelica

if regularFileExists("CustomCommands.mos") then runScript("CustomCommands.mos") else "";
customCommandsStr := if regularFileExists("CustomCommands.mos") then ("<pre>" + escapeXML(readFile("CustomCommands.mos")) + "</pre>") else "";
library:=$TypeName(Modelica);
libraryVersion:="default";
referenceFiles:=getInstallationDirectoryPath()+"/../testsuite/simulation/libraries/msl32/ReferenceFiles";
Expand All @@ -26,12 +27,12 @@ system("date +'%Y-%m-%d %H:%M:%S' > tmp.date");
dateAndTime:=readFile("tmp.date");
system("rm -f tmp.date");

loadModelCommand:="\nloadModel("+libraryString+",{\""+libraryVersion+"\"});\n";
loadModelCommand:=(if regularFileExists("CustomCommands.mos") then "\nrunScript(\"CustomCommands.mos\");" else "") + "\nloadModel("+libraryString+",{\""+libraryVersion+"\"});\n";

omc:=getInstallationDirectoryPath()+"/bin/omc";
dygraphs:=getInstallationDirectoryPath()+"/share/doc/omc/testmodels/dygraph-combined.js";

a:={typeNameString(x) for x guard isExperiment(x) in getClassNames(library,recursive=true,sort=true)};
a:={typeNameString(x) for x guard isExperiment(x) in getClassNames(Modelica.Blocks,recursive=true,sort=true)};
getErrorString();

// writeFile("x",sum(s + "\n" for s in a));
Expand Down Expand Up @@ -249,8 +250,9 @@ str:="<h1>Recursive BuildModel Test</h1>
<p>BuildModel time limit: "+ulimitOmc+"s</p>
<p>Simulation time limit: "+ulimitExe+"s</p>
<p>Default tolerance: "+String(default_tolerance)+"</p>
<p>Flags: setCommandLineOptions(\"+d=nogen,initialization\"); setMatchingAlgorithm(\"PFPlusExt\"); setIndexReductionMethod(\"dynamicStateSelection\");</p>
<p>Links are provided if getErrorString() or the simulation generates output. <font style=\"background-color:#00FF00\">Green</font> means success, <font style=\"background-color:#FFFF00\">yellow</font> means success if +d=scodeInstShortcut was used. <font style=\"background-color:#FF0000\">Red</font> is bad and in general signifies a failure.</p>
<p>Flags: setCommandLineOptions(\"+d=nogen,initialization\"); setMatchingAlgorithm(\"PFPlusExt\"); setIndexReductionMethod(\"dynamicStateSelection\");</p>"
+ customCommandsStr +
"<p>Links are provided if getErrorString() or the simulation generates output. <font style=\"background-color:#00FF00\">Green</font> means success, <font style=\"background-color:#FFFF00\">yellow</font> means success if +d=scodeInstShortcut was used. <font style=\"background-color:#FF0000\">Red</font> is bad and in general signifies a failure.</p>
";
writeFile(log,"<html><head><title>BuildModel Results</title></head><body>" + str);
writeFile(log,"<table><tr><th>Model</th>"+(if referenceFiles == "" then "" else "<th>Verified</th>")+"<th>Simulate</th><th>Total buildModel</th><th>Frontend</th><th>Backend</th><th>SimCode</th><th>Templates</th><th>Compile</th></tr>\n",append=true);getErrorString();
Expand Down

0 comments on commit e44974e

Please sign in to comment.