Login
Testing the Project
Login

The testing process of the project made from three steps:

  1. Compile the code in the debug mode. This tests not only validate the code but also checks the code syntax. This step can be executed by use command:

    ./build.sh

  2. Compile and execute the unit tests of the project. This step check correctness of some code logic. To run the tests once, type in console:

    nim others/tests.nims 1

  3. Static code analysis with the AdaControl. This probably is the longest step. It checks the code syntax, but also can detect some common problems with the code (like direct use of global variables or reduceable scope of use statement). To start this step, you will need AdaControl installed on your computer. After that, enter the obj directory and type in console:

    adactl -f ../others/adacontrol/rules.aru -p ../steamsky.gpr -r steamsky-tcl-cargv-chelper-unicode-sax-dom-input_sources

    or you can use Tcl script:

    others/adacontrol/check.tcl rules.aru

The code must pass all three steps without any error or warning. In very exceptional cases, some AdaControl rules can be disabled, but each case considered separately. At this moment, it happens very rarely.

Tips

If you want to test only one file with the AdaControl you can type in console in obj directory:

adactl -f ../others/adacontrol/rules.aru -p ../steamsky.gpr ../src/file_to_test.adb

The rules for AdaControl are split on three files: