-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
991 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
TEST = rtest -v | ||
|
||
TESTFILES = \ | ||
PNlib.Examples.ConTest.LoopAndArcweight.mos \ | ||
PNlib.Examples.ConTest.PCtoTC.mos \ | ||
PNlib.Examples.ConTest.SinglePC.mos \ | ||
PNlib.Examples.ConTest.SingleTC.mos \ | ||
PNlib.Examples.ConTest.Speed.mos \ | ||
PNlib.Examples.ConTest.TCtoPC.mos \ | ||
PNlib.Examples.ConTest.ZeroPlace.mos \ | ||
PNlib.Examples.DisTest.ConflictPrio.mos \ | ||
PNlib.Examples.DisTest.DisLoopAndArcweight.mos \ | ||
PNlib.Examples.DisTest.InputConflictPrio.mos \ | ||
PNlib.Examples.DisTest.OutputConflictPrio.mos \ | ||
PNlib.Examples.DisTest.PDtoTD.mos \ | ||
PNlib.Examples.DisTest.SinglePD.mos \ | ||
PNlib.Examples.DisTest.SingleTD.mos \ | ||
PNlib.Examples.DisTest.TDtoPD.mos \ | ||
|
||
# test that currently fail. Move up when fixed. | ||
# Run make failingtest | ||
FAILINGTESTFILES = \ | ||
PNlib.Examples.ConTest.Conflict.mos \ | ||
PNlib.Examples.ConTest.ConflictLoop.mos \ | ||
PNlib.Examples.DisTest.ConflictProb.mos \ | ||
PNlib.Examples.DisTest.InputConflictProb.mos \ | ||
PNlib.Examples.DisTest.OutputConflictProb.mos \ | ||
PNlib.Examples.DisTest.SixConflictProb.mos \ | ||
|
||
# Dependency files that are not .mo .mos or Makefile | ||
# Add them here or they will be cleaned. | ||
DEPENDENCIES = \ | ||
*.mos \ | ||
Makefile \ | ||
rtest \ | ||
|
||
CLEAN = `ls | grep -w -v -f deps.tmp` | ||
|
||
.PHONY : test clean getdeps failingtest | ||
|
||
test: | ||
@echo | ||
@echo Running tests... | ||
@echo | ||
@echo OPENMODELICAHOME=" $(OPENMODELICAHOME) " | ||
@$(TEST) $(TESTFILES) | ||
|
||
# Cleans all files that are not listed as dependencies | ||
clean: | ||
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp | ||
@rm -f $(CLEAN) | ||
|
||
# Run this if you want to list out the files (dependencies). | ||
# do it after cleaning and updating the folder | ||
# then you can get a list of file names (which must be dependencies | ||
# since you got them from repository + your own new files) | ||
# then add them to the DEPENDENCIES. You can find the | ||
# list in deps.txt | ||
getdeps: | ||
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp | ||
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt | ||
@echo Dependency list saved in deps.txt. | ||
@echo Copy the list from deps.txt and add it to the Makefile @DEPENDENCIES | ||
|
||
failingtest: | ||
@echo | ||
@echo Running failing tests... | ||
@echo | ||
@$(TEST) $(FAILINGTESTFILES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// name: PNlib.Examples.ConTest.Conflict | ||
// keywords: PNlib, continuous | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.ConTest.Conflict); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.ConTest.Conflict_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.ConTest.Conflict.mat", | ||
"PNlib.Examples.ConTest.Conflict_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// true | ||
// "Notification: Automatically loaded package Modelica 3.2.1 due to uses annotation. | ||
// Notification: Automatically loaded package Complex 3.2.1 due to uses annotation. | ||
// Notification: Automatically loaded package ModelicaServices 3.2.1 due to uses annotation. | ||
// " | ||
// record SimulationResult | ||
// resultFile = "", | ||
// simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'PNlib.Examples.ConTest.Conflict', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''", | ||
// messages = "Failed to build model: PNlib.Examples.ConTest.Conflict" | ||
// end SimulationResult; | ||
// "Warning: The initial conditions are not fully specified. Use +d=initialization for more information. | ||
// Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information. | ||
// [CodegenC.tpl:7236:11-7236:11:writable] Error: Template error: tupleReturnVariableUpdates: Unhandled expression. {P1.outTransition[1].decreasingFactor, P1.outTransition[2].decreasingFactor} | ||
// " | ||
// {"Error opening file: PNlib.Examples.ConTest.Conflict_res.mat"} | ||
// "Error: Failed to open simulation result c:/Users/Lennart/Documents/GitHub/PNlib/ToolCoverage/OpenModelica/PNlib.Examples.ConTest.Conflict_res.mat: No such file or directory | ||
// " | ||
// endResult |
26 changes: 26 additions & 0 deletions
26
Testing/OpenModelica/PNlib.Examples.ConTest.LoopAndArcweight.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: PNlib.Examples.ConTest.LoopAndArcweight | ||
// keywords: PNlib, continuous | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.ConTest.LoopAndArcweight); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.ConTest.LoopAndArcweight_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.ConTest.LoopAndArcweight.mat", | ||
"PNlib.Examples.ConTest.LoopAndArcweight_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: PNlib.Examples.ConTest.PCtoTC | ||
// keywords: PNlib, continuous | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.ConTest.PCtoTC); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.ConTest.PCtoTC_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.ConTest.PCtoTC.mat", | ||
"PNlib.Examples.ConTest.PCtoTC_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: PNlib.Examples.ConTest.SinglePC | ||
// keywords: PNlib, continuous | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.ConTest.SinglePC); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.ConTest.SinglePC_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.ConTest.SinglePC.mat", | ||
"PNlib.Examples.ConTest.SinglePC_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: PNlib.Examples.ConTest.SingleTC | ||
// keywords: PNlib, continuous | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.ConTest.SingleTC); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.ConTest.SingleTC_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.ConTest.SingleTC.mat", | ||
"PNlib.Examples.ConTest.SingleTC_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: PNlib.Examples.ConTest.Speed | ||
// keywords: PNlib, continuous | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.ConTest.Speed); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.ConTest.Speed_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.ConTest.Speed.mat", | ||
"PNlib.Examples.ConTest.Speed_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: PNlib.Examples.ConTest.TCtoPC | ||
// keywords: PNlib, continuous | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.ConTest.TCtoPC); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.ConTest.TCtoPC_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.ConTest.TCtoPC.mat", | ||
"PNlib.Examples.ConTest.TCtoPC_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: PNlib.Examples.ConTest.ZeroPlace | ||
// keywords: PNlib, continuous | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.ConTest.ZeroPlace); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.ConTest.ZeroPlace_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.ConTest.ZeroPlace.mat", | ||
"PNlib.Examples.ConTest.ZeroPlace_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// endResult |
26 changes: 26 additions & 0 deletions
26
Testing/OpenModelica/PNlib.Examples.DisTest.ConflictPrio.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: PNlib.Examples.DisTest.ConflictPrio | ||
// keywords: PNlib, discrete | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.DisTest.ConflictPrio); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.DisTest.ConflictPrio_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.DisTest.ConflictPrio.mat", | ||
"PNlib.Examples.DisTest.ConflictPrio_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// endResult |
26 changes: 26 additions & 0 deletions
26
Testing/OpenModelica/PNlib.Examples.DisTest.DisLoopAndArcweight.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: PNlib.Examples.DisTest.DisLoopAndArcweight | ||
// keywords: PNlib, discrete | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.DisTest.DisLoopAndArcweight); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.DisTest.DisLoopAndArcweight_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.DisTest.DisLoopAndArcweight.mat", | ||
"PNlib.Examples.DisTest.DisLoopAndArcweight_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// endResult |
26 changes: 26 additions & 0 deletions
26
Testing/OpenModelica/PNlib.Examples.DisTest.InputConflictPrio.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: PNlib.Examples.DisTest.InputConflictPrio | ||
// keywords: PNlib, discrete | ||
// status: correct | ||
|
||
loadFile("../../PNlib/package.mo"); getErrorString(); | ||
simulate(PNlib.Examples.DisTest.InputConflictPrio); getErrorString(); | ||
res := OpenModelica.Scripting.compareSimulationResults("PNlib.Examples.DisTest.InputConflictPrio_res.mat", | ||
"../../ReferenceFiles/PNlib.Examples.DisTest.InputConflictPrio.mat", | ||
"PNlib.Examples.DisTest.InputConflictPrio_diff.csv", 0.01, 0.0001, | ||
{ | ||
"P1.t", | ||
"P2.t", | ||
"P3.t", | ||
"T1.fire", | ||
"T1.instantaneousSpeed", | ||
"T1.maximumSpeed", | ||
"T2.fire", | ||
"T2.instantaneousSpeed", | ||
"T2.maximumSpeed", | ||
"T3.fire", | ||
"T3.instantaneousSpeed", | ||
"T3.maximumSpeed" | ||
}); getErrorString(); | ||
|
||
// Result: | ||
// endResult |
Oops, something went wrong.