Test VS - BredaUniversityGames/JenkinsLib GitHub Wiki

vs.test()

Runs C++ tests using CTest or GoogleTest and publishes JUnit results to Jenkins.

Usage

stages {
    git.sync()
    vs.build()
    vs.test()
    // ...
}

Note: vs.test() must be used with vs.build() — it reads the build configuration from context.

Parameters

Parameter Default Description
VS_TEST_FRAMEWORK CTest Test framework: CTest or GoogleTest
VS_TEST_EXECUTABLE (empty) Path to test executable (GoogleTest) or CTest build directory

Test Frameworks

CTest

Runs tests via CMake's CTest. Set VS_TEST_EXECUTABLE to the CMake build directory (the folder containing CTestTestfile.cmake).

GoogleTest

Runs a GoogleTest executable directly. Set VS_TEST_EXECUTABLE to the path of the compiled test binary.

How It Works

  1. Runs the selected test framework with JUnit XML output
  2. Publishes JUnit results to Jenkins
  3. Marks the build as UNSTABLE if any tests fail
⚠️ **GitHub.com Fallback** ⚠️