diff options
author | Aina Niemetz <aina.niemetz@gmail.com> | 2018-09-12 09:15:04 -0700 |
---|---|---|
committer | Mathias Preiner <mathias.preiner@gmail.com> | 2018-09-22 16:30:59 -0700 |
commit | 89042eec4f63f0aebd3e540dbca5e01714d152b4 (patch) | |
tree | 748d4d337f265daa0e8110cd7032eb7618e00f9d /test/CMakeLists.txt | |
parent | 479aebfc657eb9bc90fad550f51ec3b3d2efec76 (diff) |
cmake: Added target check
Targets 'check', 'units', 'systemtests' and 'regress' are now run in
parallel with the number of available cores by default. This can be
overriden by passing ARGS=-jN.
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r-- | test/CMakeLists.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 000000000..2e062bd85 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,30 @@ +# Determine number of threads available, used to configure (default) parallel +# execution of custom test targets (can be overriden with ARGS=-jN). +include(ProcessorCount) +ProcessorCount(NTHREADS) +if(NTHREADS EQUAL 0) + set(NTHREADS 1) +endif() + +#-----------------------------------------------------------------------------# +# Add subdirectories + +add_subdirectory(regress) +add_subdirectory(system) + +if(BUILD_BINDINGS_JAVA) + add_subdirectory(java) +endif() + +if(ENABLE_UNIT_TESTING) + add_subdirectory(unit) +endif() + +#-----------------------------------------------------------------------------# +# Add target 'check', builds and runs +# > unit tests +# > regression tests of levels 0 and 1 +# > system tests + +add_custom_target(check + COMMAND ctest --output-on-failure -LE "regress[2-4]" -j${NTHREADS} $(ARGS)) |