Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions configs/sanityCheck.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,20 @@
"referenceFileExtension": "csv",
"referenceFileNameDelimiter": ".",
"referenceFiles": "sanityCheck/ReferenceFiles"
},
{
"library": "MyOtherLibrary",
"libraryVersion": "1.0.0",
"loadFileCommands": [
"loadFile(\"sanityCheck/MyOtherLibrary/package.mo\")"
],
"referenceFileExtension": "csv",
"referenceFileNameDelimiter": ".",
"referenceFiles":{
"giturl":"https://github.com/OpenModelica/OMLibraryTestingTests",
"destination":"ReferenceFiles/MyOtherLibrary",
"git-ref": "main",
"git-directory": "ReferenceResults"
}
}
]
27 changes: 27 additions & 0 deletions sanityCheck/MyOtherLibrary/package.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package MyOtherLibrary "My other awesome Modelica library"
package Mechanics
package MultiBody
package Examples
model Pendulum
extends Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum;
annotation(
experiment(StopTime=5)
);
end Pendulum;
end Examples;
end MultiBody;
end Mechanics;
package Blocks
package Examples
model PID_Controller
extends Modelica.Blocks.Examples.PID_Controller;
annotation(
experiment(StopTime=4)
);
end PID_Controller;
end Examples;
end Blocks;
annotation(
uses(Modelica(version = "4.0.0")),
version = "1.0.0");
end MyOtherLibrary;
22 changes: 17 additions & 5 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ def fflush():

def check_output_log(*popenargs, **kwargs):
if DEBUG:
fflush()
print("run: check_output", popenargs, kwargs)
print("\n")
fflush()
return subprocess.check_output(*popenargs, **kwargs)

def check_call_log(*popenargs, **kwargs):
if DEBUG:
fflush()
print("run: check_call", popenargs, kwargs)
print("\n")
fflush()
return subprocess.check_call(*popenargs, **kwargs)

def rmtree(f):
Expand All @@ -119,8 +119,8 @@ def runCommand(cmd, prefix, timeout):
process = [None]
def target():
if DEBUG:
fflush()
print("run: Popen %s, %s, %d\n" %(cmd, prefix, timeout))
fflush()
with open(os.devnull, 'w') as FNULL:
if isWin:
process[0] = subprocess.Popen(cmd, shell=True, stdin=FNULL, stdout=FNULL, stderr=FNULL)
Expand Down Expand Up @@ -413,8 +413,20 @@ def testHelloWorld(cmd):
(c["referenceFiles"],c["referenceFilesURL"]) = preparedReferenceDirs[destination]
continue
giturl = c["referenceFiles"]["giturl"]
destination = os.path.normpath(c["referenceFiles"]["destination"])
destinationReal = os.path.normpath(os.path.realpath(destination))
destination = c["referenceFiles"]["destination"]
if DEBUG:
print("destination %s" % destination)
destination = os.path.normpath(destination)
if DEBUG:
print("normalized destination %s" % destination)
print("not os.path.isdir(destination): %s" % (not os.path.isdir(destination)))
destinationReal = os.path.realpath(destination)
if DEBUG:
print("destinationReal %s" % destinationReal)
destinationReal = os.path.normpath(destinationReal)
if DEBUG:
print("normalized destinationReal %s" % destinationReal)
print("referenceFiles:", c["referenceFiles"])

if not os.path.isdir(destination):
if "git-directory" in c["referenceFiles"]:
Expand Down