Skip to content

Development Setup

We work with CMake for building and testing the project. The usual things apply. We also have different CMake presets for using sanitizers and different compilers etc.

  1. Build requirements

    Terminal window
    apt install cmake gcc ninja-build
  2. Build and run tests

    Terminal window
    cmake -B build -G Ninja
    cmake --build build
    ./build/tests/tests
  1. Build

    Terminal window
    cmake --build build --target tests
  2. Run

    The tests can be run using ctest

    Terminal window
    ctest --test-dir build

    or just

    Terminal window
    ./build/tests/tests

Tests can be written in an .itl or directly in CUDA C++.

Most tests are generated using the test_converter.py script. Simply do:

Terminal window
python tests/test_converter.py

The tests are written in ITL. They come from various other interval arithmetic libraries. To write new ones, add a new file into the itl folder and provide tests in the ITL format. E.g.,

/*
Multiline comment
*/
// regular comment
testcase section.test1 {
add [10.0, 20.0] [13.0, 17.0] = [23.0, 37.0];
sub [10.0, 20.0] [13.0, 16.0] = [-6.0, 7.0];
neg [-infinity, infinity] = [-infinity, infinity];
pos [10.0, 20.0] = [10.0, 20.0];
}
testcase test_outside_of_section {
isEmpty [nai] = false; // nai stands for not-an-interval
isEmpty [empty] = true;
convexHull [1.0,3.0] [entire] = [entire]; // entire = [-∞, ∞]
cbrt [0x40p0, 0x7dp0] = [4.0, 5.0]; // hexfloat supported
}