Skip to content

Let Ninja generate the old-tree fixture of TestOptionsConfiguration (#514) - #515

Merged
AM-L merged 2 commits into
developfrom
514-test-options-ninja
Nov 10, 2026
Merged

AM-L merged 2 commits into
developfrom
514-test-options-ninja

Conversation

@ambroise-leclerc

Copy link
Copy Markdown
Collaborator

Closes #514.

Problem

TestOptionsConfiguration failed when Ninja was the default generator (CMAKE_GENERATOR=Ninja): the OLD_TREE branch of test/cmake/test-options/CMakeLists.txt returned before any project(), and Ninja refuses to generate such a tree ("The detected version of Ninja () is less than the version of Ninja required").

Changes

  • The fixture declares project(TestOptions LANGUAGES NONE) before returning; the former options are still declared with option(), so their cache entries stay typed BOOL.
  • CheckTestOptions.cmake repeats the old-tree upgrade with -G Ninja when Ninja is installed, so the case no longer depends on the machine's default generator.

Tests

  • Windows 11, CMake 4.3.4: the script passes with CMAKE_GENERATOR=Ninja and with the default generator; with the fixture change reverted, the new step fails ("old build tree with Ninja: status 1") under the default generator. ctest -R "^TestOptionsConfiguration$" passes.
  • Linux (WSL, Ubuntu 26.10, CMake 4.3.4): the script passes with the default generator and with CMAKE_GENERATOR=Ninja.

Not run

  • The rest of the CTest suite: only test scripts change. macOS was not tried.

Copilot AI balanced review requested due to automatic review settings November 10, 2026 08:36
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2398c81e-aab7-43f9-88cd-19c8a4644be6
Commits

Reviewing files that changed from the base of the PR and between 2f58ca7 and fc0b3d5.

Files selected for processing: 2

  • test/cmake/CheckTestOptions.cmake
  • test/cmake/test-options/CMakeLists.txt

No actionable comments were generated in the recent review.

Walkthrough

Le test de configuration vérifie les options de migration sous Ninja lorsque cet outil est disponible. Le fixture d’arbre ancien appelle désormais project() avant de quitter le chemin OLD_TREE.

Changes: Test des options sous Ninja

Layer / File(s) Summary
Scénarios de migration et fixture
test/cmake/CheckTestOptions.cmake, test/cmake/test-options/CMakeLists.txt
Le test ajoute deux scénarios conditionnels sous Ninja pour vérifier les options de test et de couverture dans un ancien arbre et un ancien cache non migré. Le fixture OLD_TREE appelle project(TestOptions LANGUAGES NONE) avant son retour.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Suggested reviewers: am-l

Merge Risk: Minimal · previous review 2f58c

No merge-blocking risk was identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed Le titre résume clairement le changement principal : utiliser Ninja pour générer le fixture OLD_TREE de TestOptionsConfiguration.
Description check Passed La description explique le problème avec Ninja, les changements apportés au fixture et au test, ainsi que les résultats des tests exécutés.
Linked Issues check Passed L’objectif de l’issue #514 est satisfait. Dans test/cmake/test-options/CMakeLists.txt, le cas OLD_TREE appelle maintenant project(TestOptions LANGUAGES NONE) avant return(). Les appels `option…
Out of Scope Changes check Passed Les deux changements portent sur le scénario OLD_TREE et ses tests dans CheckTestOptions.cmake. Ils répondent directement au défaut de génération décrit dans l’issue #514. Aucun changement sans li…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

L’objectif de l’issue #514 est satisfait. Dans test/cmake/test-options/CMakeLists.txt, le cas OLD_TREE appelle maintenant project(TestOptions LANGUAGES NONE) avant return(). Les appels option() restent avant project(), ce qui préserve les entrées de cache de type BOOL. CheckTestOptions.cmake ajoute aussi un scénario explicite avec -G Ninja lorsque Ninja est disponible. Le résumé des tests indique que le script passe avec Ninja et avec le générateur par défaut.

Full details: Out of Scope Changes check

Explanation

Les deux changements portent sur le scénario OLD_TREE et ses tests dans CheckTestOptions.cmake. Ils répondent directement au défaut de génération décrit dans l’issue #514. Aucun changement sans lien avec cet objectif n’apparaît dans le diff examiné.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 92242a91-2d16-47a8-afa2-c1ada8bbbce4
Commits

Reviewing files that changed from the base of the PR and between 3af5848 and 2f58ca7.

Files selected for processing: 2

  • test/cmake/CheckTestOptions.cmake
  • test/cmake/test-options/CMakeLists.txt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

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.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

A moderate-severity active finding remains in test/cmake/CheckTestOptions.cmake where the Ninja regression/upgrade fixture has misleading comments and fragile detection that may skip coverage or fail to assert the Ninja generator, so the change needs corrections before approval.

1 open issue
What changed in this PR

Fixes TestOptionsConfiguration failing under Ninja by making the “old tree” fixture a valid CMake project and by explicitly exercising the upgrade path with Ninja when available.

Changes:

  • Add project(TestOptions LANGUAGES NONE) to the OLD_TREE fixture branch so generators like Ninja can generate the build tree.
  • Update CheckTestOptions.cmake to re-run the old-tree upgrade with -G Ninja when Ninja is detected, reducing dependence on the machine’s default generator.
File Description
test/​cmake/​test-options/​CMakeLists.txt Ensures the OLD_TREE fixture declares a minimal project(... LANGUAGES NONE) so Ninja can generate the build tree before the early return.
test/​cmake/​CheckTestOptions.cmake Adds an additional old-tree upgrade/configure pass using -G Ninja when Ninja is available to keep the regression coverage independent of the default generator.

Review effort: Balanced

Comment thread test/cmake/CheckTestOptions.cmake Resolved
@AM-L
AM-L merged commit a9f811f into develop Nov 10, 2026
9 checks passed
@AM-L
AM-L deleted the 514-test-options-ninja branch November 10, 2026 09:29
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.

TestOptionsConfiguration échoue quand Ninja est le générateur par défaut (CMAKE_GENERATOR=Ninja)

3 participants