Commit 7f2051f6 authored by Michael Tesch's avatar Michael Tesch
Browse files

Add CI test subset with coverage badge

parent f982d989
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
image: fedora:41
image: fedora:43

variables:
  GIT_DEPTH: 3
@@ -38,7 +38,24 @@ build-cpp17:
  - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

# Manual pipeline - tests (triggered manually)
# CI tests — lightweight subset with coverage (runs automatically)
test-ci:
  stage: test
  script:
  - dnf install -y gcc-c++ make cmake git lcov
  - cmake -Bbuild -H. -DCPPDUALS_CI_TESTING=ON -DCPPDUALS_CODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug
  - cmake --build build
  - cd build && ctest --output-on-failure
  - lcov --directory . --capture --output-file coverage.info --ignore-errors inconsistent,mismatch
  - lcov --extract coverage.info '*/duals/*' --output-file coverage.info --ignore-errors unused
  - lcov --list coverage.info --ignore-errors empty,mismatch
  - lcov --summary coverage.info --ignore-errors empty
  coverage: '/lines[.\s]*:\s*(\d+\.?\d*)%/'
  rules:
  - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

# Full test suite (triggered manually)
test:
  stage: test
  script:
+5 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
#
cmake_minimum_required (VERSION 3.14)
project (cppduals
  VERSION 0.8.3
  VERSION 0.8.4
  LANGUAGES C CXX
  )
include (GNUInstallDirs)
@@ -44,6 +44,7 @@ endif ()
set_property (CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS 17 20)

option (CPPDUALS_TESTING "Enable testing" OFF)
option (CPPDUALS_CI_TESTING "Build only lightweight CI test subset" OFF)
option (CPPDUALS_BENCHMARK "Enable benchmarking" OFF)
option (CPPDUALS_USE_LIBCXX "When testing use flags for libc++" OFF)
set (EIGEN3_INCLUDE_DIRS "" CACHE PATH "Path to Eigen includes" )
@@ -53,6 +54,9 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wpedantic")
endif ()

if (CPPDUALS_CI_TESTING)
  set (CPPDUALS_TESTING ON)
endif (CPPDUALS_CI_TESTING)
if (CPPDUALS_BENCHMARK)
  set (CPPDUALS_TESTING ON)
endif (CPPDUALS_BENCHMARK)
+10 −0
Original line number Diff line number Diff line
@@ -339,6 +339,16 @@ also licensed under MPL-2.0.
ChangeLog
=========

v0.8.4
------

- inline `partials<T,N>` into `duals/multidual` for self-contained headers.
- add CI test subset (`CPPDUALS_CI_TESTING`) with gcov/lcov coverage reporting for GitLab badge.
- add float and long double test instantiations for all math functions.
- improve test coverage: pow() edge cases, atan zero-dpart, operator>> parsing, I/O type suffixes.
- remove stale `duals/dual_fmt.h` references from documentation.
- bump CI image to Fedora 43.

v0.8.3
------

+5 −4
Original line number Diff line number Diff line
@@ -7,8 +7,9 @@ existing `dual<T>` becomes `dual<T, int N=1>`. All existing code
compiles unchanged (N=1 default).

1. Replace the `dual<T>` class in `duals/dual` with `dual<T, int N=1>`
   from `duals/multidual`.  Remove `duals/partials` and
   `duals/multidual` as separate headers.
   from `duals/multidual`.  Remove `duals/multidual` as a separate
   header.  (`duals/partials` already inlined into `duals/multidual`
   in v0.8.4.)

2. Update `duals/dual_eigen` — add `int N` template parameter to
   `NumTraits`, `ScalarBinaryOpTraits`, and the unary functors
@@ -17,9 +18,9 @@ compiles unchanged (N=1 default).
3. Update SIMD headers (`duals/arch/{SSE,AVX,NEON}/Dual.h`,
   `ComplexDual.h`) — specialize for `dual<T,1>` only.

5. Run full existing test suite — must pass unchanged.
4. Run full existing test suite — must pass unchanged.

6. Update equivalency tests to compile against the unified header.
5. Update equivalency tests to compile against the unified header.

### Verification gate

+5 −0
Original line number Diff line number Diff line
@@ -2057,3 +2057,8 @@ th.markdownTableHeadCenter, td.markdownTableBodyCenter {
  background:#fff
 }
}

/* Hide the Doxygen 1.16+ main navigation bar */
#main-nav {
  display: none !important;
}
Loading