mikemirzayanov a591441e36 wip před 9 měsíci
..
docker a591441e36 wip před 9 měsíci
lib 93fbb69298 all tests před 9 měsíci
scripts ec8f9f8595 wip před 9 měsíci
src 6a52d7ded3 WIP: tests před 1 rokem
test-000_compile-all-cpp 83754eac80 gitignore, shell scripts reformat and small changes před 1 rokem
test-001_run-sval-case-nval a76c6f05e1 setTestCase supports 0-based test cases indices (migrates them silently to 1-based) před 1 rokem
test-002_run-fcmp-wcmp 139afc4c51 skipBom only in checker-mode for output, more tests před 1 rokem
test-003_run-rnd 5d63abc4e0 `$CPP -v` before test, test rnd.partition(1, 0, 0) před 1 rokem
test-004_use-test.h 545b3e41ff Merge branch 'master' into opt-defaults před 1 rokem
test-005_no-register 925cb4e212 Check on testlib exit that register-function has been actually called před 1 rokem
test-005_opts 14bf287607 Extract test-005_opts, supress->suppress před 1 rokem
test-006_interactors b3fad97bf2 wip před 9 měsíci
README.md fbaddab134 tests/README.md před 1 rokem
file-runner.py b3fad97bf2 wip před 9 měsíci
run.sh a591441e36 wip před 9 měsíci
t.bat 47fbf578bf Set executable flags for test scripts před 1 rokem
t.sh 47fbf578bf Set executable flags for test scripts před 1 rokem

README.md

Tests

Some features of the library are covered by tests. If you understand well how this or that functionality of the library works, then you can add a test for it.

First of all, consider adding a test to test-004_use-test.h (carefully study the design of this test).

Note the use of test-ref script in the tests, which checks that a process has exited with the expected exit code, standard output, and standard error.

It is highly desirable to cover all new functionality with tests. If the functionality is such that it is not very difficult to write tests, then the presence of tests is required.

CI

On each push and pull requests tests will run. Please make sure that your changes didn't break them.

How run tests locally

Use tests\run.sh. Also you can use t.sh (or t.bat) to run shortcut of run.sh g++ 11 v0 $*.

Parameters (use can use all combinations):

  • g++, clang++, msvc - to specify compiler(s)
  • 11, 14, 17, 20, 23 - to specify standard(s)
  • vxx (example v10) - to try -10 suffix to run compilers, like g++-10, use v0 to run without any suffixes
  • test- - to specify test(s)

Examples:

  • bash run.sh - to run all tests on all compilers on multiple standards
  • bash run.sh g++ - to run all tests on g++ on multiple standards
  • bash run.sh g++ 11 - to run all tests on g++ with --std=c++11
  • bash run.sh g++ 11 test-001_run-sval - to run test-001_run-sval on g++ with --std=c++11
  • bash run.sh test-001_run-sval - to run test-001_run-sval on all compilers on multiple standards
  • bash run.sh g++ 11 17 - to run all tests on g++ with --std=c++11 and with --std=c++17