Skip to content

Commit

Permalink
translateModelFMU returns empty string on failure
Browse files Browse the repository at this point in the history
This makes it possible to script the result of translateModelFMU, to
compare the result with empty string (or the expected string).
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Oct 4, 2017
1 parent da38b3e commit c520576
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Compiler/Script/CevalScriptBackend.mo
Expand Up @@ -1317,11 +1317,17 @@ algorithm
(cache,ret_val,st_1) := buildModelFMU(cache, env, className, st, str1, str2, filenameprefix, true);
then (cache,ret_val,st_1);

case (cache,env,"translateModelFMU", _,st,_)
then (cache,Values.STRING(""),st);

case (cache,env,"buildModelFMU", Values.CODE(Absyn.C_TYPENAME(className))::Values.STRING(str1)::Values.STRING(str2)::Values.STRING(filenameprefix)::Values.ARRAY(valueLst=cvars)::_,st,_)
algorithm
(cache,ret_val,st_1) := buildModelFMU(cache, env, className, st, str1, str2, filenameprefix, true, list(ValuesUtil.extractValueString(vv) for vv in cvars));
then (cache,ret_val,st_1);

case (cache,env,"buildModelFMU", _,st,_)
then (cache,Values.STRING(""),st);

case (cache,env,"translateModelXML",{Values.CODE(Absyn.C_TYPENAME(className)),Values.STRING(filenameprefix)},st,_)
equation
filenameprefix = Util.stringReplaceChar(filenameprefix,".","_");
Expand Down

0 comments on commit c520576

Please sign in to comment.