Skip to content

Commit cd6607b

Browse files
authored
Adding content of julia call file to sim log (#228)
1 parent ea582ef commit cd6607b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

basemodelica.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def precompile_testbaesmodelica(systemImage: os.PathLike | None = None) -> None:
5050
'Pkg.develop(path="TestBaseModelica");'
5151
'Pkg.precompile("TestBaseModelica")')
5252
else:
53-
print("Pre-compiling Julia system image %s for TestBaseModelica."
53+
print("Pre-compiling Julia system image %s for TestBaseModelica. "
5454
"This might take a while." % systemImage)
5555

5656
jl.seval('create_sysimage(["TestBaseModelica"];'

testmodel.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,12 @@ def sendExpressionOldOrNew(cmd):
554554
cmd += " --sysimage=%s" % conf["julia-system-image"]
555555
cmd += " %s" % juliaCallFile
556556
with open(simFile,"w") as fp:
557+
with open(juliaCallFile, "r") as juliaFile:
558+
file_content = juliaFile.read()
559+
fp.write("%s_test.jl:\n\n" % conf["modelName"])
560+
fp.write(file_content)
561+
fp.write("\n")
562+
557563
fp.write("%s\n" % (cmd))
558564
res = checkOutputTimeout(
559565
"(rm -f %s.pipe ; mkfifo %s.pipe ; head -c 1048576 < %s.pipe >> %s & %s > %s.pipe 2>&1)"

0 commit comments

Comments
 (0)