From 1cea14757ac42a7dd8cbb34dbcebbc167bb7c827 Mon Sep 17 00:00:00 2001 From: AntoineGautier Date: Thu, 18 May 2023 16:24:11 +0200 Subject: [PATCH] Test --- Buildings/Resources/Scripts/travis/dymola/dymola | 6 ++++++ .../Resources/Scripts/travis/templates/BoilerPlant.py | 9 ++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Buildings/Resources/Scripts/travis/dymola/dymola b/Buildings/Resources/Scripts/travis/dymola/dymola index 37c4a00b9de..e9c6076bdc6 100755 --- a/Buildings/Resources/Scripts/travis/dymola/dymola +++ b/Buildings/Resources/Scripts/travis/dymola/dymola @@ -4,6 +4,12 @@ cur_dir=`pwd` bas_nam=`basename ${cur_dir}` sha_dir=`dirname ${cur_dir}` + +echo 'DEBUG: Content of bas_nam' +ls $bas_nam +echo 'DEBUG: Content of sha_dir' +ls $sha_dir + # If the current directory is part of the argument list, # replace it with . as the docker may have a different file structure arg_lis=`echo $@ | sed -e "s|${cur_dir}|.|g"` diff --git a/Buildings/Resources/Scripts/travis/templates/BoilerPlant.py b/Buildings/Resources/Scripts/travis/templates/BoilerPlant.py index 6216fcaae40..f581b7d8070 100755 --- a/Buildings/Resources/Scripts/travis/templates/BoilerPlant.py +++ b/Buildings/Resources/Scripts/travis/templates/BoilerPlant.py @@ -289,16 +289,11 @@ def simulateCase(arg, simulator): cwd = os.getcwd() output_dir_path = tempfile.mkdtemp(prefix=output_dir_prefix, dir=cwd) - # The following makes dymola worker cd into outputDirectory. - s = Simulator(arg[0], outputDirectory=os.path.relpath(output_dir_path)) - if simulator == 'Dymola': + s = Simulator(arg[0], outputDirectory=os.path.relpath(output_dir_path), packagePath=os.path.abspath(cwd)) s.addPreProcessingStatement(r'Advanced.TranslationInCommandLog:=true;') - s.addPreProcessingStatement(r'cd') - print(os.getcwd()) - print(os.listdir(os.pardir)) - s.addPreProcessingStatement(r'openModel(path="../package.mo", changeDirectory=false);') if simulator == 'Optimica': + s = Simulator(arg[0], outputDirectory=os.path.relpath(output_dir_path)) # Set MODELICAPATH (only in child process, so this won't affect main process). os.environ['MODELICAPATH'] = os.path.abspath(os.path.pardir)