diff --git a/configs/conf.json b/configs/conf.json index e038012..315cea0 100644 --- a/configs/conf.json +++ b/configs/conf.json @@ -210,7 +210,9 @@ "libraryVersionNameForTests":"" }, { - "library":"BuildSysPro" + "library":"BuildSysPro", + "_comment":"IncludeDirectory says modelica://BuildSysPro/Resources/C-Sources, which does not exist; the IBPSA C sources are in IBPSA/Resources/C-Sources (Resources/IBPSA/C-Sources in 3.5.0 and older). Some of them call str*/malloc/ModelicaError without including the header", + "extraCustomCommands":["setCFlags(getCFlags() + \" -include string.h -include stdlib.h -include ModelicaUtilities.h \\\"-I$libraryLocation/IBPSA/Resources/C-Sources\\\" \\\"-I$libraryLocation/Resources/IBPSA/C-Sources\\\"\")"] }, { "library":"BusinessSimulation" diff --git a/testmodel.py b/testmodel.py index da5e1c7..00e59a6 100755 --- a/testmodel.py +++ b/testmodel.py @@ -508,10 +508,13 @@ def simulateCmd(resimulate): execTimeTranslateModel=monotonic()-start simres = None +buildFailed = False if useSimulate: simres = res or {} - # A failed translate/build is only reported in the messages of the record - res = not (simres.get("messages") or "").startswith("Failed to build model") + # A failed translate/build is only reported in the messages of the record; the + # translation clocks below say which of the two it was + buildFailed = (simres.get("messages") or "").startswith("Failed to build model") + res = True err = omc.sendExpression("OpenModelica.Scripting.getErrorString()") total = omc.sendExpression("OpenModelica.Scripting.Internal.Time.timerTock(OpenModelica.Scripting.Internal.Time.RT_CLOCK_SIMULATE_TOTAL)")-total_before buildmodel = omc.sendExpression("OpenModelica.Scripting.Internal.Time.timerTock(OpenModelica.Scripting.Internal.Time.RT_CLOCK_BUILD_MODEL)") @@ -573,6 +576,10 @@ def simulateCmd(resimulate): # a resimulate leaves it in the simulation time execstat["build"] = simres["timeCompile"] if useSimulate else 0.0 execstat["phase"] = 5 + if buildFailed: + with open(errFile, 'a+') as fp: + fp.write(simres.get("messages") or "") + writeResultAndExit(0, False, omc, omc_new) else: if isWin: res = checkOutputTimeout("\"%s\\share\\omc\\scripts\\Compile.bat\" %s gcc %s parallel dynamic 24 0" % (conf["omhome"], conf["fileName"], msysEnvironment), conf["ulimitOmc"], conf)