Intro_Course_3_1_3 - nasa/gunns GitHub Wiki

Intro Course 3.1.3: Build & Run the Tests

Once you have the standalone GUNNS environment setup, you can build & run some unit tests and test sims within the GUNNS repository.

Unit Tests

Note that these unit tests only work in the standalone environment. To run the units tests for a single code folder such as gunns/core, change directories into its test/ subfolder and do:

$ make clean; make cleanlib; make

This builds and runs our CPPUNIT unit test framework for the folder and outputs results for the tests, code coverage, and Valgrind memory error checks.

You can also run all of the unit tests for the entire gunns/ repo and all of its internal dependencies. From the gunns/ folder, do:

$ source test/make_all_ut.sh

This loops through all the gunns code test folders and runs their unit tests, and outputs a summary of them all at the end (takes a few minutes to run). Note that not all unit tests necessarily pass in all GUNNS releases.

Test Trick Sim

We have a simple Trick sim within the gunns/ repo that can verify your environment setup. Change directories into gunns/sims/SIM_test/ and do:

$ make clean; trick-CP

A successful build will output an S_main_… .exe file to the sim folder. Run this with:

$ ./S_main*.exe RUN_test/input.py

Mode the sim to RUN, and verify that GUNNS is running properly by looking in this file:

logs/TS_Health_and_Status.out

in which you should see only INFO messages similar to these, and no WARN or ERR messages:

INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/Gunns.cpp:360 initialize() | testSimObject.fluid.netSolver initialized with 3 links, 3 nodes, solver: NORMAL, islands: OFF, run: RUN.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/Gunns.cpp:360 initialize() | testSimObject.elect.netSolver initialized with 3 links, 3 nodes, solver: NORMAL, islands: OFF, run: RUN.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/Gunns.cpp:360 initialize() | testSimObject.thermal.netSolver initialized with 9 links, 14 nodes, solver: NORMAL, islands: OFF, run: RUN.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/Gunns.cpp:360 initialize() | testSimObject.superFluid.netSolver initialized with 6 links, 5 nodes, solver: NORMAL, islands: OFF, run: RUN.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/network/GunnsSuperNetworkBase.cpp:393 initialize() | testSimObject.superFluid has sub-network: testSimObject.subFluid1.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/network/GunnsSuperNetworkBase.cpp:393 initialize() | testSimObject.superFluid has sub-network: testSimObject.subFluid2.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/Gunns.cpp:360 initialize() | testSimObject.superElect.netSolver initialized with 6 links, 5 nodes, solver: NORMAL, islands: OFF, run: RUN.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/network/GunnsSuperNetworkBase.cpp:393 initialize() | testSimObject.superElect has sub-network: testSimObject.subElect1.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/network/GunnsSuperNetworkBase.cpp:393 initialize() | testSimObject.superElect has sub-network: testSimObject.subElect2.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/Gunns.cpp:360 initialize() | testSimObject.superThermal.netSolver initialized with 18 links, 27 nodes, solver: NORMAL, islands: OFF, run: RUN.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/network/GunnsSuperNetworkBase.cpp:393 initialize() | testSimObject.superThermal has sub-network: testSimObject.subThermal1.
INFO | GUNNS | +000 00:00:00 | 2018-04-22T00:23:37Z | /users/jharvey1/repos/gunns/core/network/GunnsSuperNetworkBase.cpp:393 initialize() | testSimObject.superThermal has sub-network: testSimObject.subThermal2.

Previous Page / Next Page

⚠️ **GitHub.com Fallback** ⚠️