Skip to content

Conversation

mhalk
Copy link
Contributor

@mhalk mhalk commented Aug 22, 2025

Note: this only applies to 'standalone' builds, i.e. when:
LIBOMPTEST_BUILD_STANDALONE evaluates to 'ON'.

Use std::vector<std::pair<std::string, TestSuite>> instead of a std::map.

Background:
In some cases it could happen that the test execution order would change vs. the order of appearance.
This can lead to suite failures when e.g. testing for device initialization because it is performed by the first executed test case.
By storing the test suites and cases in order of appearance this issue is avoided. (So far GoogleTest has behaved in the same way.)

Note: this only applies to 'standalone' builds, i.e. when:
LIBOMPTEST_BUILD_STANDALONE evaluates to 'ON'.

Use std::vector<std::pair<std::string, TestSuite>> instead of a std::map.

Background:
In some cases it could happen that the test execution order would change vs.
the order of appearance. This can lead to suite failures when e.g. testing for
device initialization because it is performed by the first executed test case.
By storing the test suites and cases in order of appearance this issue is avoided.
(So far GoogleTest has behaved in the same way.)
@llvmbot llvmbot added openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime labels Aug 22, 2025
@mhalk mhalk requested review from jprotze, jplehr and dhruvachak August 22, 2025 16:24
Copy link
Contributor

@jplehr jplehr left a comment

Choose a reason for hiding this comment

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

LGTM

@jplehr jplehr merged commit e146855 into llvm:main Aug 22, 2025
12 checks passed
@mhalk mhalk deleted the mhalk/fix/openmp-omptest-standalone-enforce-order branch August 22, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants