Skip to content
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:

  1. Make an example for your model (a minimalistic model that can be simulated as such)
  2. Run a simulation with the inputs/simulation settings you would like to have in the unittest
  3. 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.
  4. Go to File/Generate Script
  5. 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)
  6. Save the .mos file that will contain the command log in the right place in the IDEAS/Resources/Scripts/... folder
  7. 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 a simulateModel() or plot command.

That's all. From now on, your example model will always be checked in the unittests.

Clone this wiki locally