]> granicus.if.org Git - graphviz/commitdiff
add ctest to the Ubuntu 21.04 ASan test in CI
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 5 Jul 2021 10:11:57 +0000 (12:11 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 7 Jul 2021 04:53:27 +0000 (06:53 +0200)
This adds a new test template that is based on the default test
template, but replaces the script section in order to be able to set
up and execute ctest without affecting tests on older OSes.

.gitlab-ci.yml

index 3ef34db910b885f4497e5165aefe9154a9d9b822..5e828dc70829f3ad402a335e33d89ea2ed0d4809 100644 (file)
@@ -230,10 +230,30 @@ portable-source:
     except:
         - tags
 
+.test_template_including_ctest: &test_definition_including_ctest
+    stage: test
+    script:
+        - ci/install-packages.sh
+        - export GV_VERSION=$( cat VERSION )
+        - export OS_ID=$( cat OS_ID )
+        - pushd build
+        - ctest --output-on-failure
+        - popd
+        - python3 -m pytest --verbose --junitxml=report.xml ci/tests.py tests rtest
+    artifacts:
+        reports:
+            junit: ./report.xml
+    except:
+        - tags
+
 .linux_test_template: &linux_test_definition
     <<: *test_definition
     image: "$CI_REGISTRY_IMAGE/$IMAGE:$CI_COMMIT_SHA"
 
+.linux_test_template_including_ctest: &linux_test_definition_including_ctest
+    <<: *test_definition_including_ctest
+    image: "$CI_REGISTRY_IMAGE/$IMAGE:$CI_COMMIT_SHA"
+
 centos7-build:
     <<: *rpm_build_definition
     needs:
@@ -446,6 +466,7 @@ ubuntu21-04-cmake-build:
         # fail on any compiler warnings
         - export CFLAGS=-Werror
         - export CXXFLAGS=-Werror
+        - export CMAKE_OPTIONS="-Dwith_cxx_tests=ON"
         - echo experimental > COLLECTION
     tags:
         - linux
@@ -464,7 +485,7 @@ ubuntu21-04-cmake-ASan-build-for-ctest:
         # fail on any compiler warnings
         - export CFLAGS=-Werror
         - export CXXFLAGS=-Werror
-        - export CMAKE_OPTIONS="-Duse_sanitizers=ON"
+        - export CMAKE_OPTIONS="-Duse_sanitizers=ON -Dwith_cxx_tests=ON "
         - echo experimental > COLLECTION
     # override the deb_build_definition artifacts since we need more
     # files from the build directory when running ctest in the test
@@ -798,8 +819,8 @@ ubuntu21-04-cmake-test:
     variables:
       IMAGE: ubuntu-21.04
 
-ubuntu21.04-cmake-ASan-test:
-    <<: *linux_test_definition
+ubuntu21.04-cmake-ASan-test-including-ctest:
+    <<: *linux_test_definition_including_ctest
     before_script:
         - export build_system="cmake"
         - export CFLAGS=" -g -fsanitize=address,undefined"