GLVis  v4.2
Accurate and flexible finite element visualization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
README
                       GLVis visualization tool

                 _/_/_/  _/      _/      _/  _/
              _/        _/      _/      _/        _/_/_/
             _/  _/_/  _/      _/      _/  _/  _/_/
            _/    _/  _/        _/  _/    _/      _/_/
             _/_/_/  _/_/_/_/    _/      _/  _/_/_/

                         https://glvis.org

Automated testing for GLVis

This directory contains scripts and data for regression testing of GLVis:

Dependencies

Running tests with the test driver requires an installation of Python, with the scikit-image package. Install it using pip or your distribution's package manager.

CMake is required to run the automated tests as they are used in Github Actions. The tests also expect .png images, so GLVis should be built with PNG support.

CMake-based testing

The test cases for automated testing are defined using CTest, and can be found in the CMakeLists.txt file in this directory. This is the method that is used by the Github Actions tests.

To run all the tests:

Note that a set of baselines need to be generated manually for your specific system, due to differences in rendering between operating systems and graphics hardware. After the first run of ctest on master, run make rebaseline in the build directory. This will copy the generated images from the test run to a system-specific baseline directory.

Standalone testing

You can also run an individual test case outside of CTest, with the following command:

```sh python3 glvis_driver.py -e [path to glvis] \ -s [path to stream file] \ -b [path to stream baseline directory] \ -a [additional commands to pass to glvis] ```

for example

```sh python3 glvis_driver.py -e ../glvis -s data/streams/shaper.saved -b data/baselines/local -a "-lw 1 -mslw 1 -nohidpi" ```

A screenshot named "test.[stream file name].png" will be generated. If no path to a stream baseline directory is given, the test will exit; otherwise it will attempt to find and open the corresponding screenshot in the baseline directory and compare the two images.

Details: Screenshot-based testing

As implemented in the glvis_driver.py test, structural similarity (SSIM) is used to determine similarity between the generated test screenshot and the baseline screenshot.

The current cutoff for an image and its baseline is set to 0.999; this allows for minor differences in rendering output.

Details: Baselines

Two sets of public baselines are maintained: ubuntu-20.04 and macos-10.15, each representing their corresponding Github Actions virtual environment. These are selected based on the value of the GLVIS_BASELINE_SYS CMake variable (set to local by default).

You should leave this variable unset for development purposes, even if your development platform shares the same operating system; baselines are usually generated in these virtual environments with software rendering, and may not match the output of your specific system/graphics hardware.

Reminder: after running ctest on master, developers can run make rebaseline to populate the local baseline with reference figures.