From a6927cb8140858c34e05d1a954626b9849fbcdfc Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sat, 15 Jun 2024 07:52:23 -0700 Subject: [PATCH] Add support for CMake Presets (#348) * dev container + vscode extensions * exploring cmake presets for CI * ignore user presets * add configure to build preset windows ran in debug, which means the multi config needs more help * coverage preset * creating a fuzzing preset * fuzzing fix cwd + more configs to preset * move cmake set vars to right section https://learn.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-170 "You can set C and C++ compilers by using cacheVariables.CMAKE_C_COMPILER and cacheVariables.CMAKE_CXX_COMPILER in a Configure Preset. It's equivalent to passing -D CMAKE_C_COMPILER= and -D CMAKE_CXX_COMPILER= to CMake from the command line." * fix workdir for new fuzz run targets * split up presets into more files * fix include order (liking this less) * add asan to presets * fix copy paste * add asan build preset * move ubsan to presets * replace mustache with a cmake script * touch ups * restore file to void merge conflicts * fix order for args * remove action wrapper more quotes for inputs * revert bad render of boost_json * fix casing * format changes * test to see if output is working * last try * git revert moving mustache to cmake * cmake not enough for presets * drop ci prefix * new test for `library_ROOT` search path * install with presets * cmake --install does not take a preset * install with preset is not yet supported https://gitlab.kitware.com/cmake/cmake/-/issues/23208 * add missing build step * more global fuzzing flags to toolchain file * fixup toolchain in presets * fix pathing and limit configs to tested platforms * clean up + use presets for clang-tidy * dry up sanitizer flags * try install with a preset * remove duplicated test * notes about hunter test * skip checking the compiler since this causes errors with the same CMake uses in combinations with the fuzz sanitizer flag https://github.com/prince-chrismc/jwt-cpp/actions/runs/7481024827/job/20361722539?pr=33 ``` /usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x22 CMakeFiles/cmTC_ff7c6.dir/testCCompiler.c.o: in function `main': testCCompiler.c:(.text.main[main]+0x0): multiple definition of `main'; /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a(FuzzerMain.cpp.o):(.text.main+0x0): first defined here /usr/bin/ld: /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a(FuzzerMain.cpp.o): in function `main': (.text.main+0x12): undefined reference to `LLVMFuzzerTestOneInput' ``` * remove system name to disable cross compiling * tests do not pass clang-tidy * drop toolchain, use target specific flags * leave flags in cmake * missing deps + clean apt files * remove some code duplication * fix typo * devcontainers fix, test and add wolfssl refactored installer to have a script that could be reused * add missing build context * pass version to script * dont use bash syntax * fix typo * upload tar.gz for new releases * revert name to manually trigger it * Update and rename nuget.yml to release.yml * disable nuget for testing * add a zip as well * back to basics * remove remove testing code * update workflow name * enable testing needs to be in the root * add a test preset and use it in some workflows * fix linting tests * bump github actions * bump python setup * drop dev containers * dont install openssl on windows * revert merge conflicts * fix whitespace * fix private claims example to have a valid token #351 * put back versioned format I dont remember why, it looks like it was debugging --- .github/workflows/cmake.yml | 31 +++++- .github/workflows/cross-platform.yml | 13 +-- .github/workflows/jwt.yml | 71 +++++-------- .github/workflows/lint.yml | 10 +- .github/workflows/ssl.yml | 24 +++-- .gitignore | 8 +- .vscode/extensions.json | 10 ++ CMakeLists.txt | 1 + CMakePresets.json | 33 ++++++ cmake/CMakePresets.json | 48 +++++++++ example/CMakeLists.txt | 1 + example/CMakePresets.json | 32 ++++++ example/private-claims.cpp | 2 +- tests/CMakeLists.txt | 1 - tests/CMakePresets.json | 146 +++++++++++++++++++++++++++ 15 files changed, 351 insertions(+), 80 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 CMakePresets.json create mode 100644 cmake/CMakePresets.json create mode 100644 example/CMakePresets.json create mode 100644 tests/CMakePresets.json diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 968770356..12e8a884b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,10 +22,8 @@ jobs: - name: setup run: | - mkdir build - cd build - cmake .. -DJWT_BUILD_EXAMPLES=OFF - sudo make install + cmake --preset release + sudo cmake --build --preset release --target install - name: test working-directory: tests/cmake @@ -95,6 +93,29 @@ jobs: cmake . -DTEST:STRING="defaults-enabled" cmake --build . + preset-support-but-not-enough: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/install/cmake + with: + version: "3.24.4" + url: "https://cmake.org/files/v3.24/cmake-3.24.4.tar.gz" + - uses: ./.github/actions/install/gtest + + - name: setup + run: | + mkdir build + cd build + cmake .. -DJWT_BUILD_EXAMPLES=ON -DJWT_BUILD_TESTS=ON + sudo make install + + - name: test + run: | + cd tests/cmake + cmake . -DTEST:STRING="defaults-enabled" + cmake --build . + custom-install-linux: runs-on: ubuntu-latest steps: @@ -117,7 +138,7 @@ jobs: root-hint-install-linux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest - name: setup diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml index 7d0a7a0e3..a4f23a354 100644 --- a/.github/workflows/cross-platform.yml +++ b/.github/workflows/cross-platform.yml @@ -14,22 +14,17 @@ jobs: steps: - uses: actions/checkout@v4 - - run: cmake -E make_directory ${{ github.workspace }}/build - name: configure - shell: bash # access regardless of the host operating system - working-directory: ${{ github.workspace }}/build - run: cmake $GITHUB_WORKSPACE -DJWT_BUILD_EXAMPLES=ON + run: cmake --preset examples - name: build - working-directory: ${{ github.workspace }}/build - shell: bash - run: cmake --build . + run: cmake --build --preset examples - name: test run: | - cmake --build build/ --target rsa-create-run - cmake --build build/ --target rsa-verify-run + cmake --build --preset examples --target rsa-create-run + cmake --build --preset examples --target rsa-verify-run - if: github.event_name == 'push' && always() uses: ./.github/actions/badge diff --git a/.github/workflows/jwt.yml b/.github/workflows/jwt.yml index 2291cbb54..46eed9718 100644 --- a/.github/workflows/jwt.yml +++ b/.github/workflows/jwt.yml @@ -18,14 +18,9 @@ jobs: - uses: ./.github/actions/install/open-source-parsers-jsoncpp - name: configure - run: | - mkdir build - cd build - cmake .. -DJWT_BUILD_EXAMPLES=OFF -DJWT_BUILD_TESTS=ON -DJWT_ENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug - + run: cmake --preset coverage - name: run - working-directory: build - run: make jwt-cpp-test coverage + run: cmake --build --preset coverage - uses: coverallsapp/github-action@v2 with: @@ -38,21 +33,19 @@ jobs: steps: - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest - - uses: ./.github/actions/install/gtest - name: configure - run: | - mkdir build - cd build - cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DJWT_ENABLE_FUZZING=ON + run: cmake --preset ci-fuzzing + - name: build + run: cmake --build --preset ci-fuzzing - name: run run: | - cmake --build build/ --target jwt-cpp-fuzz-BaseEncodeFuzz-run - cmake --build build/ --target jwt-cpp-fuzz-BaseDecodeFuzz-run - cmake --build build/ --target jwt-cpp-fuzz-TokenDecodeFuzz-run + cmake --build --preset ci-fuzzing --target jwt-cpp-fuzz-BaseEncodeFuzz-run + cmake --build --preset ci-fuzzing --target jwt-cpp-fuzz-BaseDecodeFuzz-run + cmake --build --preset ci-fuzzing --target jwt-cpp-fuzz-TokenDecodeFuzz-run - asan: # Based on https://gist.github.com/jlblancoc/44be9d4d466f0a973b1f3808a8e56782 + asan: runs-on: ubuntu-latest strategy: fail-fast: false @@ -69,46 +62,34 @@ jobs: version: ${{ matrix.openssl.tag }} - name: configure - run: | - mkdir build - cd build - cmake .. -DJWT_BUILD_TESTS=ON -DCMAKE_CXX_FLAGS="-fsanitize=address -fsanitize=leak -g" \ - -DCMAKE_C_FLAGS="-fsanitize=address -fsanitize=leak -g" \ - -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address -fsanitize=leak" \ - -DCMAKE_MODULE_LINKER_FLAGS="-fsanitize=address -fsanitize=leak" + run: cmake --preset ci-asan + - name: build + run: cmake --build --preset ci-asan - name: run - working-directory: build run: | - make - export ASAN_OPTIONS=check_initialization_order=true:detect_stack_use_after_return=true:fast_unwind_on_malloc=0 - ./example/rsa-create - ./example/rsa-verify - ./example/jwks-verify - ./tests/jwt-cpp-test + cmake --build --preset ci-asan --target private-claims-run + cmake --build --preset ci-asan --target rsa-create-run + cmake --build --preset ci-asan --target rsa-verify-run + cmake --build --preset ci-asan --target jwks-verify-run + cmake --build --preset ci-asan --target jwt-cpp-test-run ubsan: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest - uses: ./.github/actions/install/gtest - name: configure - run: | - mkdir build - cd build - cmake .. -DJWT_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=20 \ - -DCMAKE_CXX_FLAGS="-fsanitize=undefined -fsanitize=return -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize-recover=all -g" \ - -DCMAKE_C_FLAGS="-fsanitize=undefined -fsanitize=return -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize-recover=all -g" \ - -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=undefined -fsanitize=return -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize-recover=all" \ - -DCMAKE_MODULE_LINKER_FLAGS="-fsanitize=undefined -fsanitize=return -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize-recover=all" + run: cmake --preset ci-ubsan + - name: build + run: cmake --build --preset ci-ubsan -DCMAKE_CXX_STANDARD=20 - name: run - working-directory: build run: | - make - export UBSAN_OPTIONS=print_stacktrace=1 - ./example/rsa-create - ./example/rsa-verify - ./tests/jwt-cpp-test + cmake --build --preset ci-ubsan --target private-claims-run + cmake --build --preset ci-ubsan --target rsa-create-run + cmake --build --preset ci-ubsan --target rsa-verify-run + cmake --build --preset ci-ubsan --target jwks-verify-run + cmake --build --preset ci-ubsan --target jwt-cpp-test-run diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ced7ca450..6d8410b39 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,7 +36,7 @@ jobs: matrix: files: ["**/CMakeLists.txt", "cmake/code-coverage.cmake"] steps: - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: python-version: "3.x" - run: pip install cmakelang @@ -54,13 +54,9 @@ jobs: - uses: lukka/get-cmake@latest - uses: actions/checkout@v4 - name: configure - run: | - mkdir build - cd build - cmake .. -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-fix" + run: cmake --preset examples -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-fix" - name: run - working-directory: build - run: make + run: cmake --build --preset examples - uses: ./.github/actions/process-linting-results with: linter_name: clang-tidy diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index a60c6f7a6..d96e3ddbb 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -27,10 +27,10 @@ jobs: version: ${{ matrix.openssl.tag }} - name: configure - run: cmake . -DJWT_BUILD_TESTS=ON -DOPENSSL_ROOT_DIR=/tmp - - run: make + run: cmake --preset unit-tests -DOPENSSL_ROOT_DIR=/tmp + - run: cmake --build --preset unit-tests - name: test - run: ./tests/jwt-cpp-test + run: ctest --preset unit-tests - if: github.event_name == 'push' && always() uses: ./.github/actions/badge @@ -50,8 +50,10 @@ jobs: version: "openssl-3.0.5" - name: configure - run: cmake . -DJWT_BUILD_TESTS=ON -DOPENSSL_ROOT_DIR=/tmp -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1" - - run: make + run: cmake --preset unit-tests -DOPENSSL_ROOT_DIR=/tmp -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1" + - run: cmake --build --preset unit-tests + - name: test + run: ctest --preset unit-tests libressl: runs-on: ubuntu-latest @@ -69,10 +71,10 @@ jobs: version: ${{ matrix.libressl }} - name: configure - run: cmake . -DJWT_BUILD_TESTS=ON -DJWT_SSL_LIBRARY:STRING=LibreSSL - - run: make + run: cmake --preset unit-tests -DJWT_SSL_LIBRARY:STRING=LibreSSL + - run: cmake --build --preset unit-tests - name: test - run: ./tests/jwt-cpp-test + run: ctest --preset unit-tests - if: github.event_name == 'push' && always() uses: ./.github/actions/badge @@ -98,10 +100,10 @@ jobs: version: ${{ matrix.wolfssl.ref }} - name: configure - run: cmake . -DJWT_BUILD_TESTS=ON -DJWT_SSL_LIBRARY:STRING=wolfSSL - - run: make + run: cmake --preset unit-tests -DJWT_SSL_LIBRARY:STRING=wolfSSL + - run: cmake --build --preset unit-tests - name: test - run: ./tests/jwt-cpp-test + run: ctest --preset unit-tests - if: github.event_name == 'push' && always() uses: ./.github/actions/badge diff --git a/.gitignore b/.gitignore index dc994bd2c..a594c29b7 100644 --- a/.gitignore +++ b/.gitignore @@ -306,9 +306,15 @@ $RECYCLE.BIN/ test *.o *.o.d -.vscode + +# IDE-specific files +.vscode/ +.vscode/!extensions.json # Allow to provide recommended extensions + # ClangD cache files .cache build/* package-lock.json + +CMakeUserPresets.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..59e6f7d8f --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + "recommendations": [ + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", + "ms-vscode.cmake-tools", + "twxs.cmake", + "matepek.vscode-catch2-test-adapter", + "GitHub.vscode-github-actions" + ] +} diff --git a/CMakeLists.txt b/CMakeLists.txt index ad9632a35..474605c00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,6 +158,7 @@ if(JWT_BUILD_EXAMPLES) endif() if(JWT_BUILD_TESTS) + enable_testing() add_subdirectory(tests) endif() diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 000000000..03dc92250 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,33 @@ +{ + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "include": [ + "example/CMakePresets.json", + "tests/CMakePresets.json" + ], + "configurePresets": [ + { + "name": "dev", + "displayName": "Development", + "inherits": "debug", + "environment": { + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + }, + "cacheVariables": { + "JWT_BUILD_EXAMPLES": "ON", + "JWT_BUILD_TESTS": "ON" + } + } + ], + "buildPresets": [ + { + "name": "dev", + "configurePreset": "dev", + "configuration": "Debug" + } + ] +} \ No newline at end of file diff --git a/cmake/CMakePresets.json b/cmake/CMakePresets.json new file mode 100644 index 000000000..8c4fb85af --- /dev/null +++ b/cmake/CMakePresets.json @@ -0,0 +1,48 @@ +{ + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "configurePresets": [ + { + "name": "default", + "displayName": "Default Config", + "hidden": true, + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "JWT_BUILD_EXAMPLES": "OFF", + "JWT_BUILD_TESTS": "OFF" + } + }, + { + "name": "debug", + "displayName": "Debug", + "inherits": "default", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "release", + "displayName": "Release", + "inherits": "default", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ], + "buildPresets": [ + { + "name": "debug", + "configurePreset": "debug", + "configuration": "Debug" + }, + { + "name": "release", + "configurePreset": "release", + "configuration": "Release" + } + ] +} \ No newline at end of file diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 94b749ecb..3f87f424e 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -17,6 +17,7 @@ add_custom_target(print-claims-run COMMAND print-claims) add_executable(private-claims private-claims.cpp) target_link_libraries(private-claims jwt-cpp::jwt-cpp) +add_custom_target(private-claims-run COMMAND private-claims) add_executable(rsa-create rsa-create.cpp) target_link_libraries(rsa-create jwt-cpp::jwt-cpp) diff --git a/example/CMakePresets.json b/example/CMakePresets.json new file mode 100644 index 000000000..b4838835a --- /dev/null +++ b/example/CMakePresets.json @@ -0,0 +1,32 @@ +{ + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "include": [ + "../cmake/CMakePresets.json" + ], + "configurePresets": [ + { + "name": "examples", + "displayName": "Build Examples", + "inherits": "release", + "cacheVariables": { + "JWT_BUILD_EXAMPLES": "ON" + } + } + ], + "buildPresets": [ + { + "name": "examples", + "configurePreset": "examples", + "configuration": "Release", + "targets": [ + "rsa-create", + "rsa-verify" + ] + } + ] +} \ No newline at end of file diff --git a/example/private-claims.cpp b/example/private-claims.cpp index 730cf40ed..cd4375c32 100644 --- a/example/private-claims.cpp +++ b/example/private-claims.cpp @@ -21,7 +21,7 @@ int main() { .set_issuer("auth.mydomain.io") .set_audience("mydomain.io") .set_issued_at(time) - .set_not_before(time + sec{15}) + .set_not_before(time - sec{15}) .set_expires_at(time + sec{15} + min{2}) .set_payload_claim("boolean", picojson::value(true)) .set_payload_claim("integer", picojson::value(int64_t{12345})) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 356aa3b80..6c7b75504 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,7 +6,6 @@ if(JWT_DISABLE_PICOJSON) message(FATAL_ERROR "Tests requires the picojson support to be enabled!") endif() -enable_testing() include(GoogleTest) if(HUNTER_ENABLED) hunter_add_package(GTest) diff --git a/tests/CMakePresets.json b/tests/CMakePresets.json new file mode 100644 index 000000000..ee1af5b39 --- /dev/null +++ b/tests/CMakePresets.json @@ -0,0 +1,146 @@ +{ + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "include": [ + "../cmake/CMakePresets.json" + ], + "configurePresets": [ + { + "name": "linux", + "hidden": true, + "description": "This is only available on Linux", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name": "coverage", + "inherits": ["debug", "linux"], + "displayName": "Coverage", + "description": "This is only available on Linux", + "cacheVariables": { + "JWT_BUILD_TESTS": "ON", + "JWT_ENABLE_COVERAGE": "ON" + } + }, + { + "name": "unit-tests", + "inherits": ["debug"], + "displayName": "Unit Tests", + "cacheVariables": { + "JWT_BUILD_TESTS": "ON" + } + }, + { + "name": "ci-fuzzing", + "inherits": ["debug", "linux"], + "displayName": "Fuzz Testing", + "description": "This is only available on Linux with Clang", + "cacheVariables": { + "JWT_ENABLE_FUZZING": "ON", + "CMAKE_C_COMPILER": "clang", + "CMAKE_CXX_COMPILER": "clang++" + } + }, + { + "name": "ci-asan", + "inherits": ["debug", "linux"], + "displayName": "Address/Leak Sanitizer", + "description": "This is only available on Linux", + "environment": { + "ASAN_FLAGS": "-fsanitize=address -fsanitize=leak", + "ASAN_OPTIONS": "check_initialization_order=true:detect_stack_use_after_return=true:fast_unwind_on_malloc=0" + }, + "cacheVariables": { + "JWT_BUILD_EXAMPLES": "ON", + "JWT_BUILD_TESTS": "ON", + "CMAKE_C_FLAGS": "$env{ASAN_FLAGS}", + "CMAKE_CXX_FLAGS": "$env{ASAN_FLAGS}", + "CMAKE_EXE_LINKER_FLAGS": "$env{ASAN_FLAGS}", + "CMAKE_MODULE_LINKER_FLAGS": "$env{ASAN_FLAGS}" + } + }, + { + "name": "ci-ubsan", + "inherits": ["debug", "linux"], + "displayName": "Undefined Behavior Sanitizer", + "description": "This is only available on Linux", + "environment": { + "UBSAN_FLAGS": "-fsanitize=undefined -fsanitize=return -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize-recover=all", + "UBSAN_OPTIONS": "print_stacktrace=1" + }, + "cacheVariables": { + "JWT_BUILD_EXAMPLES": "ON", + "JWT_BUILD_TESTS": "ON", + "CMAKE_C_FLAGS": "$env{UBSAN_FLAGS}", + "CMAKE_CXX_FLAGS": "$env{UBSAN_FLAGS}", + "CMAKE_EXE_LINKER_FLAGS": "$env{UBSAN_FLAGS}", + "CMAKE_MODULE_LINKER_FLAGS": "$env{UBSAN_FLAGS}" + } + } + ], + "buildPresets": [ + { + "name": "coverage", + "configurePreset": "coverage", + "configuration": "Debug", + "targets": [ + "jwt-cpp-test", + "coverage" + ] + }, + { + "name": "unit-tests", + "configurePreset": "unit-tests", + "configuration": "Debug", + "targets": [ + "jwt-cpp-test" + ] + }, + { + "name": "ci-fuzzing", + "configurePreset": "ci-fuzzing", + "targets": [ + "jwt-cpp-fuzz-BaseEncodeFuzz", + "jwt-cpp-fuzz-BaseDecodeFuzz", + "jwt-cpp-fuzz-TokenDecodeFuzz" + ] + }, + { + "name": "ci-asan", + "configurePreset": "ci-asan", + "targets": [ + "rsa-create", + "rsa-verify", + "jwks-verify", + "jwt-cpp-test" + ] + }, + { + "name": "ci-ubsan", + "configurePreset": "ci-ubsan", + "targets": [ + "rsa-create", + "rsa-verify", + "jwks-verify", + "jwt-cpp-test" + ] + } + ], + "testPresets": [ + { + "name": "unit-tests", + "description": "Run the unit tests", + "configurePreset": "unit-tests", + "execution": { + "noTestsAction": "error" + } + } + ] +} \ No newline at end of file