From c0980de3afc0e5785e069dcfdd7068ca5581a95e Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sat, 29 Sep 2012 19:53:52 +0200 Subject: [PATCH] Testsuite updates; run it as part of CI builds. Only can run a quick build because of Travis time restrictions. Should try to find a set of most-likely-to-fail command line args, maybe "-O -gc -fPIC"? --- .travis.yml | 1 + CMakeLists.txt | 8 ++++++++ tests/d2/CMakeLists.txt | 15 +++++++++++++++ tests/d2/dmd-testsuite | 2 +- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/d2/CMakeLists.txt diff --git a/.travis.yml b/.travis.yml index e8eedeea..1f4782b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ before_script: script: - cmake -DD_VERSION=$DVER -DLLVM_CONFIG=/usr/bin/llvm-config-3.0 - make + - make test || { cat Testing/Temporary/LastTest.log; exit 1; } notifications: email: diff --git a/CMakeLists.txt b/CMakeLists.txt index a8b2b8a8..58ead6e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -339,3 +339,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") install(DIRECTORY bash_completion.d DESTINATION ${CONF_INST_DIR}) endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + +# +# Test targets. +# +enable_testing() +if(D_VERSION EQUAL 2) + add_subdirectory(tests/d2) +endif() diff --git a/tests/d2/CMakeLists.txt b/tests/d2/CMakeLists.txt new file mode 100644 index 00000000..e275a632 --- /dev/null +++ b/tests/d2/CMakeLists.txt @@ -0,0 +1,15 @@ +include(CheckTypeSize) +check_type_size(void* ptr_size) +if(${ptr_size} MATCHES "^4$") + set(model 32) +elseif(${ptr_size} MATCHES "^8$") + set(model 64) +endif() + +set(DMD_TEST_MODEL "${model}" CACHE STRING + "The model argument to use for compiling the D2 testsuite. Defaults to system bitness.") + +get_property(ldmd_path TARGET ldmd2 PROPERTY LOCATION) + +add_test(NAME dmd-testsuite WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests/d2/dmd-testsuite + COMMAND make RESULTS_DIR=${CMAKE_BINARY_DIR}/dmd_test_results DMD=${ldmd_path} MODEL=${DMD_TEST_MODEL} quick) diff --git a/tests/d2/dmd-testsuite b/tests/d2/dmd-testsuite index b6145220..7dc22d03 160000 --- a/tests/d2/dmd-testsuite +++ b/tests/d2/dmd-testsuite @@ -1 +1 @@ -Subproject commit b6145220cd266322519619b0cef8b271a0456240 +Subproject commit 7dc22d030cd939a58bcffe325d6f984e8fce49d2