summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* cmake: Add Python tests only when building with Python supportAlexis Hildebrandt2024-07-081-1/+6
| | | | Fixes #2324
* Merge branch 'master' into modernize-test-scriptsAlexis Hildebrandt2023-12-051-9/+1
|\
| * test: Remove Python2 specific testsAlexis Hildebrandt2023-12-051-9/+1
| |
* | tests: Modernize test scriptsAlexis Hildebrandt2023-12-051-1/+1
|/ | | | by using argparse and pathlib and removing Python 2 specific code.
* Update docs for move to GitHub ActionsMartin Michlmayr2021-08-241-1/+1
|
* run demo.py test only when Python is enabledMartin Michlmayr2020-05-181-5/+7
| | | | | | | | Commit 92b6072ffd ("run demo.py with ctest") made demo.py part of the test suite. But we can only run it if Python is enabled in ledger. Fixes #1910
* run demo.py with ctestAndy Clayton2020-05-181-0/+6
| | | | | Fix error from newer cmake/FindPython versions not printing internal Python_EXECUTABLE variable.
* py3: ensure python output is not lostAndy Clayton2020-03-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unbuffer python's stdio to avoid output getting stuck in buffer when stdout is not a TTY. Normally buffers are flushed by `Py_Finalize` but Boost has a long-standing issue preventing the proper shutdown of the interpreter with `Py_Finalize` when embedded [1]. This applies the same fix as 139beba but to any ledger usage rather than only the test suite. I removed `PYTHONUNBUFFERED=1` from tests as there is no expectation that users should need to have this set for ledger to function. For example without this fix piping ledger into cat usually loses any output (unless the output is large enough to cause the buffer to flush): $ ./ledger -f "test/baseline/feat-value_py3.test" reg <class 'bool'> True [...] $ ./ledger -f "test/baseline/feat-value_py3.test" reg | cat $ Interestingly `--verify` causes `python_interpreter_t` to be destroyed -- it doesn't appear to be otherwise -- which does call `Py_Finalize`. As expected this fixes the issue but can also crash due to the boost issue mentioned above: $ ./ledger -f "test/baseline/feat-value_py3.test" --verify reg <class 'bool'> True [...] Segmentation fault (core dumped) $ ./ledger -f "test/baseline/feat-value_py3.test" --verify reg | cat <class 'bool'> True [...] $ 1. https://www.boost.org/doc/libs/1_62_0/libs/python/doc/html/tutorial/tutorial/embedding.html
* fix setting TZ in testsAndy Clayton2020-03-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was regressed in 139beba which set `PYTHONUNBUFFERED` to fix other test issues. When setting multiple environment variables in this way they need to be delimited with semicolons rather than spaces. As it is `PYTHONUNBUFFERED` is being set to `1 TZ=America/Chicago`. The CMake docs are not as clear about this as they probably should be. This can be verified by throwing together a CTestTestfile.cmake: add_test(incorrect_env "printenv" "PYTHONUNBUFFERED" "TZ") set_tests_properties(incorrect_env PROPERTIES ENVIRONMENT "PYTHONUNBUFFERED=1 TZ=America/Chicago") add_test(correct_env "printenv" "PYTHONUNBUFFERED" "TZ") set_tests_properties(correct_env PROPERTIES ENVIRONMENT "PYTHONUNBUFFERED=1;TZ=America/Chicago") When run with `ctest -V`: 1: Test command: /usr/bin/printenv "PYTHONUNBUFFERED" "TZ" 1: Environment variables: 1: PYTHONUNBUFFERED=1 TZ=America/Chicago 1: Test timeout computed to be: 10000000 1: 1 TZ=America/Chicago 1/2 Test #1: incorrect_env ....................***Failed 0.00 sec test 2 Start 2: correct_env 2: Test command: /usr/bin/printenv "PYTHONUNBUFFERED" "TZ" 2: Environment variables: 2: PYTHONUNBUFFERED=1 2: TZ=America/Chicago 2: Test timeout computed to be: 10000000 2: 1 2: America/Chicago 2/2 Test #2: correct_env ...................... Passed 0.00 sec
* test: split value_py.test into py2/py3 versions.Dimitri John Ledkov2019-12-071-0/+8
|
* test: Unbreak one more test case with python3 bridgeDimitri John Ledkov2019-12-061-3/+3
| | | | | | | | | | | python3 has buffered output by default, hence testcase option_py returned no output when executed under test harness. I think this is a real problem in the way python interpreter is embeded, and i.e. stdout is not flushed until after test case has died. However, running things unbuffered seems to make everything work. But for some reason I had to adjust 1057.test slightly. I have no idea what those numbers mean, and if running things unbuffered break stuff.
* Modernize CMake using backported FindPython module.Dimitri John Ledkov2019-12-051-5/+5
|
* Do not set dependencies for target checkTim Landscheidt2019-01-221-4/+0
| | | | | | The set_target_properties() commands themselves do not cause the tests to run if the target check is made, and as the target check executes ctest, all tests will be run anyway.
* [tests] Set timezone for running testsAlexis Hildebrandt2015-08-071-1/+8
| | | | so that the tests run with a consistent environment.
* [travis] Run documentation checks as reportsAlexis Hildebrandt2015-07-281-1/+3
| | | | which are allowed to fail instead of strict tests.
* [tests] Refactor CheckTests.py into custom scriptsAlexis Hildebrandt2015-01-211-4/+6
|
* [doc] Add CheckTests to ctestAlexis Hildebrandt2015-01-151-1/+6
| | | | | | | to check whether all available ledger options documented and are being tested. Signed-off-by: Alexis Hildebrandt <afh@surryhill.net>
* Fix and re-enable DocTestsAlexis Hildebrandt2014-11-291-12/+11
|
* avoid policy warning with recent CMake versionsJohann Klähn2014-09-101-8/+6
| | | | See `cmake --help-policy CMP0026` with CMake ≥ 3.0.
* Cosmetic change - format code consistentlyMartin Michlmayr2014-05-181-5/+5
| | | | | Add a space between if and the opening bracket, between a closing round bracket and the following opening curly bracket, etc.
* Temporarily disable the DocTestsJohn Wiegley2014-04-171-11/+12
|
* Add proper argument parsing to DocTests.pyAlexis Hildebrandt2014-02-091-1/+1
|
* Check examples in documentation when running testsAlexis Hildebrandt2014-02-071-0/+12
| | | | | The DocTests.py script will parse a given texinfo file for specially marked examples, run the ledger command from the example, and check the result against the example output from the documentation.
* fix ctest rulesJohann Klähn2013-01-171-1/+1
|
* Enable the baseline and manual testsJohn Wiegley2012-05-201-3/+28
|
* Converted the Ledger build system to use CMakeJohn Wiegley2012-05-201-0/+16