forked from open-ideas/IDEAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Create a unittest
Bram van der Heijde edited this page Aug 31, 2016
·
2 revisions
Creating a unittest is not hard, so try to do it for every model you create. Here are the steps:
- Make an example for your model (a minimalistic model that can be simulated as such)
- Run a simulation with the inputs/simulation settings you would like to have in the unittest
- Make a plot of the variables you want to compare in the unittest. Every time the unittest will be run, you model will be simulated and the result will be compared with the reference result for each of these variables.
- Go to File/Generate Script
- Check Plot setup (you can also store this script as a command such that the example can be run and plotted from the Commands menu)
- Save the
.mos
file that will contain the command log in the right place in the IDEAS/Resources/Scripts/... folder - Open the generated file in a text editor and paste the
simulateModel()
from Dymola at the beginning of the file. Be careful only to keep lines with asimulateModel()
or plot command.
That's all. From now on, your example model will always be checked in the unittests.