[pkg-d-commits] [ldc] 32/95: Build LDC D unittests on demand only

Matthias Klumpp mak at moszumanska.debian.org
Thu Jul 13 20:53:57 UTC 2017


This is an automated email from the git hooks/post-receive script.

mak pushed a commit to annotated tag v1.3.0-beta1
in repository ldc.

commit 2d38752e457521d4fc0b64701d74460fdd4953b4
Author: Martin <noone at nowhere.com>
Date:   Sun Feb 26 03:18:00 2017 +0100

    Build LDC D unittests on demand only
---
 .travis.yml    | 12 ++++++------
 CMakeLists.txt | 24 +++++++++---------------
 appveyor.yml   | 16 ++++++++--------
 circle.yml     |  8 ++++----
 4 files changed, 27 insertions(+), 33 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 658d205..7c8c567 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -82,8 +82,6 @@ script:
   # Outputs some environment info, plus makes sure we only run the test suite
   # if we could actually build the executable.
   - bin/ldc2 -version || exit 1
-  # run the general unittests
-  - bin/ldc2_test -version
   # Build Phobos & druntime unittest modules.
   -
     if [[ "${OPTS}" == *-DMULTILIB?ON* ]]; then
@@ -94,11 +92,13 @@ script:
       make -j3 druntime-ldc-unittest-debug druntime-ldc-unittest;
     fi
   # Run dmd-testsuite.
-  - CC="" DMD_TESTSUITE_MAKE_ARGS=-j3 ctest --verbose -R "dmd-testsuite"
-  # Run LLVM IR testsuite.
-  - ctest --output-on-failure -V -R "lit-tests"
+  - CC="" DMD_TESTSUITE_MAKE_ARGS=-j3 ctest -V -R "dmd-testsuite"
+  # Run lit testsuite.
+  - ctest -V -R "lit-tests"
+  # Build and run LDC D unittests.
+  - ctest --output-on-failure -R "ldc2-unittest"
   # Link and run Phobos & druntime unittest runners.
-  - ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests"
+  - ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"
 
 after_success:
   -
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 64f349c..38fe96f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -710,25 +710,19 @@ add_subdirectory(tools)
 #
 enable_testing()
 
-# build unittest executable
-
-set(LDC_TEST_EXE ldc2_test)
-set(LDC_TEST_EXE_NAME ${PROGRAM_PREFIX}${LDC_TEST_EXE}${PROGRAM_SUFFIX})
-set(LDC_TEST_EXE_FULL ${PROJECT_BINARY_DIR}/bin/${LDC_TEST_EXE_NAME}${CMAKE_EXECUTABLE_SUFFIX})
-add_custom_target(${LDC_TEST_EXE} ALL DEPENDS ${LDC_TEST_EXE_FULL})
-
-set(LDC_TEST_D_COMPILE_ARGS
-    -unittest
-    ${LDC_D_SOURCE_FILES}
-)
-
+# LDC unittest executable (D unittests only).
+set(LDC_UNITTEST_EXE_FULL ${PROJECT_BINARY_DIR}/bin/${LDC_EXE_NAME}-unittest${CMAKE_EXECUTABLE_SUFFIX})
 build_d_executable(
-    "${LDC_TEST_EXE_FULL}"
-    "${LDC_TEST_D_COMPILE_ARGS}"
+    "${LDC_UNITTEST_EXE_FULL}"
+    "-unittest;${LDC_D_SOURCE_FILES}"
     "$<TARGET_LINKER_FILE:${LDC_LIB}>"
-    "${LDC_D_SOURCE_FILES};${PROJECT_BINARY_DIR}/${DDMDFE_PATH}/id.d"
+    "${LDC_D_SOURCE_FILES}"
     "${LDC_LIB}"
 )
+add_custom_target(ldc2-unittest DEPENDS ${LDC_UNITTEST_EXE_FULL})
+add_test(NAME build-ldc2-unittest COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ldc2-unittest)
+add_test(NAME ldc2-unittest COMMAND ${LDC_UNITTEST_EXE_FULL} --version)
+set_tests_properties(ldc2-unittest PROPERTIES DEPENDS build-ldc2-unittest)
 
 add_subdirectory(runtime)
 if(D_VERSION EQUAL 2)
diff --git a/appveyor.yml b/appveyor.yml
index e055703..1103db0 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -184,18 +184,18 @@ test_script:
   - ps: 'echo "import std.stdio; void main() { writeln(""Hello world!""); }" > hello.d'
   - bin\ldc2 hello.d
   - hello.exe
-  # Run general unittests
-  - bin\ldc2_test -version
   # Compile the druntime & phobos unit tests
   - ninja -j2 druntime-ldc-unittest-debug phobos2-ldc-unittest-debug druntime-ldc-unittest phobos2-ldc-unittest
-  # Execute dmd-testsuite
+  # Run dmd-testsuite
   - if "%APPVEYOR_JOB_ARCH%"=="x64" ( set OS=Win_64) else ( set OS=Win_32)
   - set DMD_TESTSUITE_MAKE_ARGS=-j2
-  - ctest --verbose -R dmd-testsuite
-  # Execute the LLVM IR tests
-  - ctest --output-on-failure -V -R lit-tests
-  # Execute the unit tests
-  - ctest -j2 --output-on-failure -E "dmd-testsuite|lit-tests"
+  - ctest -V -R "dmd-testsuite"
+  # Run lit testsuite
+  - ctest -V -R "lit-tests"
+  # Build and run LDC D unittests
+  - ctest --output-on-failure -R "ldc2-unittest"
+  # Link and run Phobos & druntime unittest runners
+  - ctest -j2 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"
 
 #---------------------------------#
 #     deployment configuration    #
diff --git a/circle.yml b/circle.yml
index de8a669..ea84c86 100644
--- a/circle.yml
+++ b/circle.yml
@@ -61,12 +61,12 @@ test:
     - bin/ldc2 -version || exit 1
 
   override:
-    - bin/ldc2_test -version
     - make -j2 phobos2-ldc-unittest-debug phobos2-ldc-unittest
     - make -j3 druntime-ldc-unittest-debug druntime-ldc-unittest
-    - CC="" DMD_TESTSUITE_MAKE_ARGS=-j3 ctest --verbose -R "dmd-testsuite"
-    - ctest --output-on-failure -V -R "lit-tests"
-    - ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests"
+    - CC="" DMD_TESTSUITE_MAKE_ARGS=-j3 ctest -V -R "dmd-testsuite"
+    - ctest -V -R "lit-tests"
+    - ctest --output-on-failure -R "ldc2-unittest"
+    - ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"
 
 # To add more value the test results could be collected, see https://circleci.com/docs/test-metadata
 # A way how to convert the ctest output is described here:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git



More information about the pkg-d-commits mailing list