Skip to content
Damien Picard edited this page Aug 5, 2015 · 13 revisions

IDEAS Unit tests

This topic explains how to run the IDEAS unit tests. The instructions work on Linux and on Windows.

Download BuildingsPy:

First you need to download BuildingsPy from https://github.com/lbl-srg/BuildingsPy:

git clone [email protected]:lbl-srg/BuildingsPy.git

Install BuildingsPy:

This package needs to be built and installed. Open terminal in the just downloaded BuildingsPy directory and execute in Linux:

python setup.py build
sudo python setup.py install

In Windows, make sure you have the administrator rights and execute:

python setup.py build
python setup.py install

BuildingsPy is now installed.

Run Unit test:

Open the file IDEAS/IDEAS/RunUnitTests.py and make sure you use the desired number of processors by adapting tester.setNumberOfThreads(4). By default the file uses 4 processors. The unit tests can be run by opening terminal in the IDEAS root directory and executing the following commands:

cd IDEAS/IDEAS
python RunUnitTests.py

The unit tests may not run if you do not have TidyLib installed. Since installing this can be quite cumbersome it is easier to disable the HTML checking functionality. This has been done by default in the script included in the library.

On windows, it also seems that using parallel processes does not work. Make sure that the code in RunUnitTests.py looks then like:

# Cancel the html check, as the tidy lib is not properly installed
rt=r.Tester(check_html=False, executable='dymola')

""" number of parallel processes started."""
# Bug for more than 1 thread.
rt.setNumberOfThreads(1)
rt.run()

Notice that you can also run only the unittests contained in one package using the function rt.setSinglePackage('MyLibrary.MyModel').

Clone this wiki locally