File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 2
2
3
3
#include < gtest/gtest.h>
4
4
5
+ #include < libenvpp/detail/get.hpp>
5
6
#include < string_view>
6
7
7
8
#include " omp.h"
@@ -15,15 +16,14 @@ TEST(util_tests, extracts_correct_namespace) {
15
16
EXPECT_EQ (kNs , " my::nested" );
16
17
}
17
18
18
- TEST (util_tests, threads_control_check_openmp_disabled_valgrind ) {
19
- int ppc_num_threads = ppc::util::GetNumThreads ( );
19
+ TEST (util_tests, GetNumThreadsEnvUnsetReturn ) {
20
+ const auto num_threads_env_var = env::get< int >( " PPC_NUM_THREADS " );
20
21
21
- int omp_num_threads = -1 ;
22
- #pragma omp parallel default(none) shared(omp_num_threads) num_threads(ppc::util::GetNumThreads())
23
- omp_num_threads = omp_get_num_threads ();
24
-
25
- // Check Result
26
- ASSERT_EQ (ppc_num_threads, omp_num_threads);
22
+ if (num_threads_env_var.has_value ()) {
23
+ EXPECT_EQ (ppc::util::GetNumThreads (), omp_get_num_threads ());
24
+ } else {
25
+ GTEST_SKIP () << " PPC_NUM_THREADS environment variable is set, skipping test" ;
26
+ }
27
27
}
28
28
29
29
namespace test_ns {
You can’t perform that action at this time.
0 commit comments