Running Tests
-------------

notes for all items:
${OSPRAY_SOURCE_DIR} is the ospray source root.
PATH and LD_LIBRARY_PATH should contain ${OSPRAY_BUILD_DIR}.

1. Build OSPRay

Compile OSPRay in a build directory of your choosing. We will refer
to this directory as ${OSPRAY_BUILD_DIR}.

2. Generate baseline images (OPTIONAL)

Build OSPRay with OSPRAY_TESTING on.  Only
generate new images for a test that has changed.  To generate new images for a specific
test run ./ospTestSuite --gtest_filter="*TESTNAME*" --dump-img --baseline-dir=test_image_data/
which will create images in a folder called test_image_data.

To make new images for all tests, In ${OSPRAY_BUILD_DIR}, run the
"generate_baseline.sh" script:

% ${OSPRAY_SOURCE_DIR}/scripts/tests/generate_baseline.sh

This will output generated images in a folder named generated_test_images.
These images will not automatically be used as baseline images for the tests
unless put into the correct folder (<OSPRAY_BUILD_DIR>/build_regression_tests/regression_test_baseline/)
or the update script is used (5).

3. Run regression tests

To verify whether a change to the codebase broke anything, run

% ${OSPRAY_SOURCE_DIR}/scripts/tests/run_tests.sh ${OSPRAY_SOURCE_DIR} <ISA>

* where ISA is empty if using own generated images, or "AVX2" or "AVX512SKX" to 
* download golden images for that ISA target

This will download golden baseline images into a folder named
build_regression_tests/regression_test_baseline in
the current working directory (OSPRAY_BUILD_DIR) and run tests to compare them.

4.  To run an individual test
./ospTestSuite --gtest_list_tests
this will output a list of test names
./ospTestSuite --gest_filter="*NAME*"
will run a single test

5.  Add or update generated test images to ospray
Use the included update_test_baseline.sh script and then send
the resulting files to ospray developers
or do the following steps:

call md5sum on the resulting .png files.  Add a .png.md5 file to
tests/baseling/TESTNAME.png.md5 with the value of the checksum.  rename
the .png file to be the checksum value, and then send this to OSPRay Devs who
will add it to https://github.com/ospray/ospray-test-data /
https://www.ospray.org/ospray-test-data/.
