Skip to content

[Tests] Migrate C++ tests to Conan v2 - #145

Merged
feltech merged 3 commits into
OpenAssetIO:mainfrom
feltech:conan2-migration
Nov 18, 2026
Merged

feltech merged 3 commits into
OpenAssetIO:mainfrom
feltech:conan2-migration

Conversation

@feltech

@feltech feltech commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Part of OpenAssetIO/OpenAssetIO#1313. Part of #123.

OpenAssetIO has moved to Conan v2, and TraitGen is the only other project in the org using Conan, so migrate the C++ tests to match.

  • Pin conan==2.34.0, update the conan install command line, and add a copy of OpenAssetIO's vfx24.profile.
  • Download the prebuilt OpenAssetIO release archive instead of building it from source in a Docker container, so the ctest job can be matrixed across Linux, macOS and Windows. Also passes /wd4996 on MSVC instead of the unrecognised -Wno-deprecated-declarations.
  • A third commit re-enables sanitizers on Linux (the ci preset, which only disabled them for the old ASWF image, is removed in favour of lint). With sanitizers, GCC emits a false positive -Wmaybe-uninitialized from libstdc++'s <regex> via Catch2 (already an -isystem include), so it is downgraded to non-fatal for sanitized GCC builds. Linting/sanitizers still only run on Linux; macOS and Windows use the test preset.

@feltech
feltech requested a review from a team as a code owner November 17, 2026 16:31
@feltech
feltech requested a balanced review from Copilot November 17, 2026 18:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the Conan 2 migration and cross-platform C++ test updates.

No open issues 🎉

What changed in this PR

Migrates the C++ test infrastructure to Conan 2, aligning it with OpenAssetIO and extending CI coverage to Linux, macOS, and Windows.

Changes:

  • Pins Conan 2.34.0, updates dependency installation, and adds a VFX Reference Platform profile.
  • Replaces Docker-based OpenAssetIO builds with prebuilt release archives for cross-platform testing.
  • Adjusts deprecation checks for Clang and MSVC and re-enables Linux sanitizers.
File Description
tests/​generators/​test_cpp.py Updates Conan arguments and selects host/build profiles.
tests/​generators/​cpp/​vfx24.profile Adds a dependency profile aligned with OpenAssetIO releases.
tests/​generators/​cpp/​src/​test.cpp Explicitly names the deprecated type to trigger Clang warnings.
tests/​generators/​cpp/​src/​CMakeLists.txt Handles MSVC warnings and multi-config test builds.
tests/​generators/​cpp/​CMakePresets.json Removes the sanitizer-disabled CI preset.
tests/​generators/​cpp/​cmake/​DefaultTargetProperties.cmake Makes GCC’s potentially false-positive uninitialized warnings nonfatal in sanitized builds.
tests/​ctest-requirements.txt Pins Conan to version 2.34.0.
README.md Documents Conan 2 and the test dependency profile.
.github/​workflows/​test.yml Adds cross-platform C++ testing using OpenAssetIO release archives.
.github/​workflows/​code-quality.yml Updates a comment referencing the OpenAssetIO version pin.
.github/​build_openassetio/​action.yml Removes the obsolete source-build action.

Review effort: Balanced

@foundry-markf foundry-markf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just questions

Comment thread tests/generators/cpp/src/CMakeLists.txt Resolved

@foundry-markf foundry-markf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

feltech and others added 3 commits November 18, 2026 16:09
Part of OpenAssetIO/OpenAssetIO#1313.

The upstream OpenAssetIO repository has moved to Conan v2, and this
is the only other project in the organisation using Conan, so migrate
the C++ tests to match.

Conan v2 has no default profile, so supply one explicitly rather than
requiring `conan profile detect`. Copy OpenAssetIO's `vfx24.profile`
(a platform-agnostic Jinja template, aligned to VFX Reference Platform
CY2024) so that dependencies are built consistently with the OpenAssetIO
release builds.

Signed-off-by: David Feltell <david.feltell@foundry.com>
Part of OpenAssetIO#123.

Previously the C++ tests ran on Ubuntu only, inside an ASWF Docker
container, against an OpenAssetIO that was built from source by a
separate `build-openassetio` job on every CI run.

Instead, download the pre-built RelWithDebInfo release archive from the
OpenAssetIO GitHub release (see OpenAssetIO/OpenAssetIO#1201), which
removes the OpenAssetIO build from our CI (see
OpenAssetIO/OpenAssetIO#1235) and lets the `ctest` job be matrixed
across Linux, macOS and Windows. The now unused `build_openassetio`
action and the ASWF container are removed.

Signed-off-by: David Feltell <david.feltell@foundry.com>
Part of OpenAssetIO#123.

The `ci` preset existed only to disable the address and undefined
behaviour sanitizers, which the ASWF Docker image used for CI did not
support. Now that CI runs natively, drop the preset and use `lint` on
Linux, enabling sanitizers.

With sanitizers enabled, GCC reports a false positive
`-Wmaybe-uninitialized` from within libstdc++'s `<regex>`, as used by
Catch2. This is not a missing `SYSTEM` include: Catch2 is already an
`-isystem` include, but GCC still reports instantiation of the template
code. Downgrade just that warning to a non-fatal one for sanitized GCC
builds, rather than disabling it, so it remains visible.

Verified locally with GCC 13: the full `lint` preset passes.

Signed-off-by: David Feltell <david.feltell@foundry.com>

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: David Feltell <david.feltell@foundry.com>
@feltech
feltech merged commit d31ae62 into OpenAssetIO:main Nov 18, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants