Skip to content

Commit

Permalink
added some tests for inStream
Browse files Browse the repository at this point in the history
see: ticket:3885

Belonging to [master]:
  - OpenModelica/OpenModelica-testsuite#1018
  • Loading branch information
vruge authored and OpenModelica-Hudson committed Sep 1, 2018
1 parent 6ded654 commit 4d29ace
Show file tree
Hide file tree
Showing 12 changed files with 763 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -332,6 +332,9 @@ simulationinheritances.log: omc-diff
simulationinlineFunction.log: omc-diff
$(MAKE) -C simulation/modelica/inlineFunction -f Makefile test > $@
@echo $@ done
simulationinStream.log: omc-diff
$(MAKE) -C simulation/modelica/inStream -f Makefile test > $@
@echo $@ done
simulationjapaneselanguage.log: omc-diff
$(MAKE) -C simulation/modelica/japaneselanguage -f Makefile test > $@
@echo $@ done
Expand Down
1 change: 0 additions & 1 deletion openmodelica/cruntime/optimization/benchmark/Makefile
@@ -1,6 +1,5 @@
TEST = ../../../../rtest -v


TESTFILES = \
runDrumBoiler.mos \
runExReduceDrumBoiler.mos \
Expand Down
3 changes: 3 additions & 0 deletions simulation/modelica/inStream/.gitattributes
@@ -0,0 +1,3 @@
*.mo text encoding=UTF-8
*.mos text encoding=UTF-8
Makefile text encoding=UTF-8
4 changes: 4 additions & 0 deletions simulation/modelica/inStream/.gitignore
@@ -0,0 +1,4 @@
*
!*.mos
!*.mo
!Makefile
55 changes: 55 additions & 0 deletions simulation/modelica/inStream/Makefile
@@ -0,0 +1,55 @@
TEST = ../../../rtest -v

TESTFILES = \
Test6.mos \
Test7.mos \
Test8.mos \
Test9.mos \
Test10.mos \
Test11.mos \


# test that currently fail. Move up when fixed.
# Run make failingtest
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)
38 changes: 38 additions & 0 deletions simulation/modelica/inStream/Test10.mos
@@ -0,0 +1,38 @@
//name: Test10
//status: correct

loadModel(Modelica);
getErrorString();


loadFile("TestStreamConnectorsNoActualStreamEvaluateParams.mo");
getErrorString();

setCommandLineOptions("+d=newInst");
getErrorString();

simulate(TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test10, stopTime=15);
getErrorString();

val(mixer.pipe2.inlet.h_outflow, {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
val(mixer.pipe1.inlet.h_outflow, {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
val(pipe.outlet.h_outflow, {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
// Result:
// true
// ""
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test10_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 15.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test10', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// {80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0}
// {160000.0,160000.0,160000.0,160000.0,160000.0,160000.0,160000.0,160000.0,160000.0,160000.0,160000.0,160000.0,160000.0,160000.0,160000.0,160000.0}
// {120000.0,120000.0,120000.0,120000.0,120000.0,120000.0,120000.0,120000.0,120000.0,120000.0,120000.0,120000.0,120000.0,120000.0,120000.0,120000.0}
// endResult
36 changes: 36 additions & 0 deletions simulation/modelica/inStream/Test11.mos
@@ -0,0 +1,36 @@
//name: Test11
//status: correct

loadModel(Modelica);
getErrorString();


loadFile("TestStreamConnectorsNoActualStreamEvaluateParams.mo");
getErrorString();

setCommandLineOptions("+d=newInst");
getErrorString();

simulate(TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test11, stopTime=15);
getErrorString();

val(pipe2.outlet.h_outflow, {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
val(pipe1.outlet.h_outflow, {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
// Result:
// true
// ""
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test11_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 15.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test11', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// {80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0}
// {80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0}
// endResult
34 changes: 34 additions & 0 deletions simulation/modelica/inStream/Test6.mos
@@ -0,0 +1,34 @@
//name: Test6
// status: correct

loadModel(Modelica);
getErrorString();


loadFile("TestStreamConnectorsNoActualStreamEvaluateParams.mo");
getErrorString();

setCommandLineOptions("+d=newInst");
getErrorString();

simulate(TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test6, stopTime=15);
getErrorString();

val(pipe3.outlet.h_outflow,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
// Result:
// true
// ""
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test6_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 15.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test6', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// {300000.0,300000.0,300000.0,300000.0,300000.0,300000.0,300000.0,300000.0,300000.0,300000.0,300000.0,300000.0,300000.0,300000.0,300000.0,300000.0}
// endResult
38 changes: 38 additions & 0 deletions simulation/modelica/inStream/Test7.mos
@@ -0,0 +1,38 @@
//name: Test7
//status: correct

loadModel(Modelica);
getErrorString();


loadFile("TestStreamConnectorsNoActualStreamEvaluateParams.mo");
getErrorString();

setCommandLineOptions("+d=newInst");
getErrorString();

simulate(TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test7, stopTime=15);
getErrorString();

val(pipe1.inlet.h_outflow,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
val(pipe2.inlet.h_outflow,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
val(pipe3.inlet.h_outflow,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
// Result:
// true
// ""
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test7_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 15.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test7', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// {199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108,199999.9640000108}
// {399999.9040000288,399999.9040000288,399999.9040000289,399999.9040000288,399999.9040000288,399999.9040000287,399999.9040000288,399999.9040000288,399999.9040000287,399999.9040000288,399999.9040000288,399999.9040000287,399999.9040000288,399999.9040000288,399999.9040000287,399999.9040000288}
// {80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0}
// endResult
38 changes: 38 additions & 0 deletions simulation/modelica/inStream/Test8.mos
@@ -0,0 +1,38 @@
//name: Test8
//status: correct

loadModel(Modelica);
getErrorString();


loadFile("TestStreamConnectorsNoActualStreamEvaluateParams.mo");
getErrorString();

setCommandLineOptions("+d=newInst");
getErrorString();

simulate(TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test8, stopTime=15);
getErrorString();

val(pipe1.inlet.h_outflow,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
val(pipe2.inlet.h_outflow,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
val(pipe3.inlet.h_outflow,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
// Result:
// true
// ""
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test8_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 15.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test8', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// {80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0}
// {80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0}
// {80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0}
// endResult
38 changes: 38 additions & 0 deletions simulation/modelica/inStream/Test9.mos
@@ -0,0 +1,38 @@
//name: Test9
//status: correct

loadModel(Modelica);
getErrorString();


loadFile("TestStreamConnectorsNoActualStreamEvaluateParams.mo");
getErrorString();

setCommandLineOptions("+d=newInst");
getErrorString();

simulate(TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test9, stopTime=15);
getErrorString();

val(pipe1.inlet.h_outflow,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
val(pipe2.inlet.h_outflow,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
val(pipe3.inlet.h_outflow,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15});
// Result:
// true
// ""
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test9_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 15.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'TestStreamConnectorsNoActualStreamEvaluateParams.TestModels.Test9', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// {200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0}
// {80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0,80000.0}
// {200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0,200000.0}
// endResult

0 comments on commit 4d29ace

Please sign in to comment.