2010-10-31 00:40:24 +04:00
|
|
|
Running regression tests:
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
Prerequisites: cmake, python
|
|
|
|
|
|
|
|
cd tests
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake ..
|
|
|
|
make
|
|
|
|
make test
|
|
|
|
|
2011-11-05 18:20:53 +04:00
|
|
|
Running on Windows:
|
2011-10-16 05:14:35 +04:00
|
|
|
|
|
|
|
First, get a normal build working by following instructions at
|
|
|
|
http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows
|
|
|
|
Then, from the QT command prompt:
|
|
|
|
|
|
|
|
cd tests
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake .. -DCMAKE_BUILD_TYPE=Release
|
|
|
|
sed -i s/\/MD/\/MT/ CMakeCache.txt
|
|
|
|
cmake ..
|
|
|
|
nmake -f Makefile
|
|
|
|
nmake -f Makefile test
|
2010-10-31 00:40:24 +04:00
|
|
|
|
2011-11-05 18:20:53 +04:00
|
|
|
Running on headless (no X) servers:
|
|
|
|
|
|
|
|
Xvnc :5 -screen 0 800x600x24 &
|
|
|
|
DISPLAY=:5 make test
|
|
|
|
|
|
|
|
|
2010-07-11 21:22:24 +04:00
|
|
|
Adding a new regression test:
|
2010-10-31 00:40:24 +04:00
|
|
|
------------------------------
|
2010-07-11 21:22:24 +04:00
|
|
|
|
|
|
|
1) create a test file at an appropriate location under testdata/
|
|
|
|
2) if the test is non-obvious, create a human readable description of the test in the same directory (e.g testdata/scad/mytest.txt)
|
2011-09-04 04:58:09 +04:00
|
|
|
3) if a new test app was written, this must be added to tests/CMakeLists.txt
|
|
|
|
4) Add the tests to the test apps for which you want them to run (in tests/CMakeLists.txt)
|
|
|
|
5) run the test with the environment variable TEST_GENERATE=1, e.g.:
|
2011-04-29 20:02:54 +04:00
|
|
|
$ TEST_GENERATE=1 ctest -R mytest
|
2010-07-11 21:22:24 +04:00
|
|
|
(this will generate a mytest-expected.txt file which is used for regression testing)
|
2011-09-04 04:58:09 +04:00
|
|
|
6) manually verify that the output is correct (tests/regression/<testapp>/mytest-expected.<suffix>)
|
|
|
|
7) run the test normally and verify that it passes:
|
2010-07-11 21:22:24 +04:00
|
|
|
$ ctest -R mytest
|
|
|
|
|
2011-09-19 02:53:33 +04:00
|
|
|
Troubleshooting a failed test:
|
|
|
|
------------------------------
|
|
|
|
|
2011-10-09 05:02:40 +04:00
|
|
|
You can run a single test by passing the test name to ctest:
|
|
|
|
$ ctest -R throwntogethertest_sphere
|
2011-09-19 02:53:33 +04:00
|
|
|
|
2011-10-09 05:02:40 +04:00
|
|
|
You can run a series of tests by passing part of a name to ctest:
|
2011-09-19 02:53:33 +04:00
|
|
|
$ ctest -R cgalpng # runs all cgalpng tests
|
|
|
|
$ ctest -R sphere # runs all sphere tests
|
2011-10-09 05:02:40 +04:00
|
|
|
|
2011-09-19 02:53:33 +04:00
|
|
|
Logs of test runs are found in tests/build/Testing/Temporary
|
|
|
|
Expected results are found in tests/regression/*
|
|
|
|
Actual results are found in tests/build/testname-output/*
|
|
|
|
|
2011-10-09 05:02:40 +04:00
|
|
|
You can also compile a single test program:
|
|
|
|
|
|
|
|
$ make cgalpngtest
|