Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added a test for the OMEdit-flags to the cpp-runtime-testsuite
- Loading branch information
Marcus Walther
committed
Aug 28, 2015
1 parent
f3d6c3a
commit 708894f
Showing
4 changed files
with
87 additions
and
1 deletion.
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
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
29 changes: 29 additions & 0 deletions
29
openmodelica/cppruntime/omedit/BouncingBall_OMEdit_flags.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,29 @@ | ||
// name: BouncingBall_OMEdit_flags | ||
// keywords: events | ||
// status: correct | ||
// teardown_command: rm -rf BouncingBall.log libModelica.dll BouncingBall.cpp BouncingBall.libs BouncingBall.h BouncingBall.makefile output.log Functions.h Functions.cpp | ||
// cflags: +simCodeTarget=Cpp | ||
// | ||
// Event handling | ||
// | ||
|
||
loadFile("../BouncingBall.mo"); | ||
setCommandLineOptions("+simCodeTarget=Cpp"); getErrorString(); | ||
simulate(BouncingBall,method="dassl",stopTime=1.0, tolerance=1e-10, numberOfIntervals=100,outputFormat="mat",simflags="-port=41442 -logFormat=xml -override=startTime=0,stopTime=4,stepSize=0.008,tolerance=0.0001,solver=dassl,outputFormat=mat,variableFilter=.* -r=BouncingBall_res.mat -dasslJacobian=coloredNumerical -emit_protected -w -lv=LOG_STATS"); | ||
res := OpenModelica.Scripting.compareSimulationResults("BouncingBall_res.mat", | ||
"ReferenceFiles/BouncingBall.mat", | ||
"BouncingBall_diff.csv",0.01,0.0001, | ||
{"h","v"}); | ||
|
||
|
||
// Result: | ||
// true | ||
// true | ||
// "" | ||
// record SimulationResult | ||
// resultFile = "BouncingBall_res.mat", | ||
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 100, tolerance = 1e-10, method = 'dassl', fileNamePrefix = 'BouncingBall', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-port=41442 -logFormat=xml -override=startTime=0,stopTime=4,stepSize=0.008,tolerance=0.0001,solver=dassl,outputFormat=mat,variableFilter=.* -r=BouncingBall_res.mat -dasslJacobian=coloredNumerical -emit_protected -w -lv=LOG_STATS'", | ||
// messages = "" | ||
// end SimulationResult; | ||
// {"Files Equal!"} | ||
// 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,47 @@ | ||
TEST = ../../../rtest -v | ||
|
||
TESTFILES = \ | ||
BouncingBall_OMEdit_flags.mos | ||
|
||
FAILINGTESTFILES= | ||
|
||
# Dependency files that are not .mo .mos or Makefile | ||
# Add them here or they will be cleaned. | ||
DEPENDENCIES = \ | ||
*.mo \ | ||
*.mos \ | ||
Makefile | ||
|
||
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) |