Skip to content

Commit

Permalink
- Handle skipped tests in the compile XML (checked wrong timer)
Browse files Browse the repository at this point in the history
- Less output (still get backend print statements that should be in Error.mo; but that is hard to avoid)
- Use system-out also for failed tests since messages don't include newlines in hudson


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17625 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 9, 2013
1 parent ccd63d8 commit c1bb93f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Examples/BuildModelRecursive.mos
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ system("rm -f "+libraryString+"* " + log);
/*** This is the stuff executed for each model ***/

min(writeFile(s + ".mos","
writeFile(\""+log+"\",\""+s+"\n\",append=true);
\""+s+"\";
echo(false);
statFile := \""+s+".stat\";
writeFile(\""+log+"\",\""+s+"\n\",append=true);
writeFile(statFile,\"<tr><td bgcolor=\\\"#ff0000\\\">"+s+"</td></tr>\");getErrorString();
writeFile(statFile + \".flat\", \"killed\");getErrorString();
writeFile(statFile + \".compile\", \"killed\");getErrorString();
Expand All @@ -58,7 +60,6 @@ if err <> \"\" then
writeFile(errFile,err);
end if;

echo(false);
frontend :=OpenModelica.Scripting.Internal.Time.timerTock(OpenModelica.Scripting.Internal.Time.RT_CLOCK_FRONTEND);
backend :=OpenModelica.Scripting.Internal.Time.timerTock(OpenModelica.Scripting.Internal.Time.RT_CLOCK_BACKEND);
simcode :=OpenModelica.Scripting.Internal.Time.timerTock(OpenModelica.Scripting.Internal.Time.RT_CLOCK_SIMCODE);
Expand Down Expand Up @@ -96,10 +97,13 @@ function testcase
output String str;
algorithm
str:=\\\"<testcase name=\\\\\\\""+s+"\\\\\\\" time=\\\\\\\"\\\"+String(time)+\\\"\\\\\\\">\\\"+(
if not success then \\\"<error type=\\\\\\\"failed\\\\\\\" message=\\\\\\\"\\\"+errXML+\\\"\\\\\\\"/>\\\"
elseif errXML <> \\\"\\\" then (\\\"<system-out>\\\" + errXML + \\\"</system-out>\\\")
if not success then \\\"<error type=\\\\\\\"Failure\\\\\\\" />\\\"
else \\\"\\\"
)+(
if errXML <> \\\"\\\" then (\\\"<system-out>\\\" + errXML + \\\"</system-out>\\\")
else \\\"\\\"
)+\\\"</testcase>\n\\\";
)+
\\\"</testcase>\n\\\";
end testcase;
\");getErrorString();
sim:=readFile(simFile);
Expand All @@ -114,7 +118,7 @@ errXML:=escapeXML(err);
skip:=\"<testcase name=\\\""+s+"\\\"><skipped /></testcase>\";
str:=testcase(frontend,backend <> -1.0,errXML);
writeFile(statFile + \".flat\", str);getErrorString();
str:=if frontend <> -1.0 then testcase(total,buildRes,errXML) else skip;
str:=if backend <> -1.0 then testcase(total,buildRes,errXML) else skip;
writeFile(statFile + \".compile\", str);getErrorString();
str:=if buildRes then testcase(timeSim,simRes,readFile(simFile)) else skip;
writeFile(statFile + \".sim\", str);getErrorString();
Expand Down

0 comments on commit c1bb93f

Please sign in to comment.