Skip to content

Commit

Permalink
- Adding new tests to API checkSettings()
Browse files Browse the repository at this point in the history
  - In the CWD: try to create a file, then remove it


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5792 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jul 5, 2010
1 parent 1528f62 commit c4e97f2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Compiler/Interactive.mo
Expand Up @@ -1874,17 +1874,20 @@ algorithm
local
list<Values.Value> vals;
list<String> vars;
String omhome,omlib,omcpath,os,platform,usercflags,senddata,res,workdir,gcc,confcmd;
Boolean omcfound,gcc_res;
String omhome,omlib,omcpath,os,platform,usercflags,senddata,res,workdir,gcc,confcmd,touch_file;
Boolean omcfound,gcc_res,touch_res,rm_res;
equation
vars = {"OPENMODELICAHOME","OPENMODELICALIBRARY","OMC_PATH","OMC_FOUND","MODELICAUSERCFLAGS","WORKING_DIRECTORY","OS","SENDDATALIBS","C_COMPILER","C_COMPILER_RESPONDING","CONFIGURE_CMDLINE"};
vars = {"OPENMODELICAHOME","OPENMODELICALIBRARY","OMC_PATH","OMC_FOUND","MODELICAUSERCFLAGS","WORKING_DIRECTORY","CREATE_FILE_WORKS","REMOVE_FILE_WORKS","OS","SENDDATALIBS","C_COMPILER","C_COMPILER_RESPONDING","CONFIGURE_CMDLINE"};
omhome = Util.makeValueOrDefault(System.readEnv,"OPENMODELICAHOME","");
omlib = Util.makeValueOrDefault(System.readEnv,"OPENMODELICALIBRARY","");
omcpath = omhome +& "/bin/omc" +& System.getExeExt();
omcfound = System.regularFileExists(omcpath);
os = System.os();
touch_file = "omc.checksettings.create_file_test";
usercflags = Util.makeValueOrDefault(System.readEnv,"MODELICAUSERCFLAGS","");
workdir = System.pwd();
touch_res = 0 == System.systemCall("touch " +& touch_file);
rm_res = 0 == System.systemCall("rm " +& touch_file);
platform = System.platform();
senddata = System.getSendDataLibs();
gcc = System.getCCompiler();
Expand All @@ -1894,6 +1897,8 @@ algorithm
Values.STRING(omcpath),Values.BOOL(omcfound),
Values.STRING(usercflags),
Values.STRING(workdir),
Values.BOOL(touch_res),
Values.BOOL(rm_res),
Values.STRING(os),Values.STRING(senddata),
Values.STRING(gcc),Values.BOOL(gcc_res),Values.STRING(confcmd)};
res = ValuesUtil.valString(Values.RECORD(Absyn.IDENT("OpenModelica.Diagnostics.ImportantValues"),vals,vars,-1));
Expand Down

0 comments on commit c4e97f2

Please sign in to comment.