File Coverage: t/01-validation.t

# File Coverage

File: | t/01-validation.t
Coverage: | 100.0%

line | stmt | bran | cond | sub | pod | time | code
--- | --- | --- | --- | --- | --- | --- | ---
1 | 1 1 1 |  |  | 1 |  | 2949 1 24 | use strict;
2 | 1 1 1 |  |  | 1 |  | 3 4 37 | use warnings;
3 |
4 | 1 1 1 |  |  | 1 |  | 256 866 99 | use FindBin qw/$Bin/;
5 | 1 1 1 |  |  | 1 |  | 234 496 4 | use lib qq{$Bin/../lib};
6 |
7 | 1 1 1 |  |  | 1 |  | 444 68606 6 | use Test::More;
8 | 1 1 1 |  |  | 1 |  | 437 2250 2 | use Test::Exception;
9 |
10 | 1 1 1 1 1 |  |  | 1 |  | 87867 969 3 1 21 | use_ok('OpenMP::Environment');
11 |
12 | 1 |  |  |  |  | 394 | my $env = OpenMP::Environment->new;
13 | 1 |  |  |  |  | 2 | isa_ok( $env, 'OpenMP::Environment' );
14 |
15 | 1 |  |  |  |  | 268 | note q{Testing validation for all OpenMP Environmental Variables that have checks implemented};
16 |
17 |  |  |  |  |  |  | # OMP_CANCELLATION
18 | 1 |  |  |  |  | 390 | note q{## OMP_CANCELLATION's valid values are: 'TRUE', 'FALSE', and may be unset};
19 | 1 |  |  |  |  | 311 | is $env->omp_cancellation(q{TRUE}), q{TRUE}, q{OMP_CANCELLATION can be set to 'TRUE' };
20 | 1 |  |  |  |  | 288 | is $env->omp_cancellation(q{true}), q{TRUE}, q{OMP_CANCELLATION can be set to 'TRUE' via 'true' };
21 | 1 |  |  |  |  | 429 | is $env->unset_omp_cancellation(), q{TRUE}, q{unset_omp_cancellation returns last known value if OMP_CANCELLATION is set};
22 | 1 |  |  |  |  | 284 | is $env->omp_cancellation(q{FALSE}), q{FALSE}, q{OMP_CANCELLATION can be set to 'FALSE' };
23 | 1 |  |  |  |  | 276 | is $env->omp_cancellation(q{false}), q{FALSE}, q{OMP_CANCELLATION can be set to 'FALSE' via 'false' };
24 | 1 |  |  |  |  | 280 | is $env->unset_omp_cancellation(), q{FALSE}, q{unset_omp_cancellation returns last known value if OMP_CANCELLATION is set};
25 | 1 |  |  |  |  | 271 | is $env->omp_cancellation, undef, q{OMP_CANCELLATION has indeed been unset};
26 | 1 |  |  |  |  | 337 | ok !exists( $ENV{OMP_CANCELLATION} ), q/$ENV{OMP_CANCELLATION} doesn't exist, as expected/;
27 | 1 1 |  |  | 1 |  | 254 35 | dies_ok( sub { $env->omp_cancellation(q{Invalid value xxx}) }, q{omp_cancellation dies on invalid input} );
28 |
29 |  |  |  |  |  |  | # OMP_DISPLAY_AFFINITY
30 | 1 |  |  |  |  | 262 | note q{## OMP_DISPLAY_AFFINITY's valid values are: 'TRUE', 'FALSE', and may be unset};
31 | 1 |  |  |  |  | 430 | is $env->omp_display_affinity(q{TRUE}), q{TRUE}, q{OMP_DISPLAY_AFFINITY can be set to 'TRUE'};
32 | 1 |  |  |  |  | 276 | is $env->omp_display_affinity(q{true}), q{TRUE}, q{OMP_DISPLAY_AFFINITY upper-cases 'true'};
33 | 1 |  |  |  |  | 273 | is $env->unset_omp_display_affinity(), q{TRUE}, q{unset_omp_display_affinity returns last known value};
34 | 1 |  |  |  |  | 269 | is $env->omp_display_affinity(q{FALSE}), q{FALSE}, q{OMP_DISPLAY_AFFINITY can be set to 'FALSE'};
35 | 1 |  |  |  |  | 281 | is $env->omp_display_affinity(q{false}), q{FALSE}, q{OMP_DISPLAY_AFFINITY upper-cases 'false'};
36 | 1 |  |  |  |  | 271 | is $env->unset_omp_display_affinity(), q{FALSE}, q{unset_omp_display_affinity returns last known value};
37 | 1 |  |  |  |  | 270 | is $env->omp_display_affinity, undef, q{OMP_DISPLAY_AFFINITY has been unset};
38 | 1 1 |  |  | 1 |  | 323 34 | dies_ok( sub { $env->omp_display_affinity(q{sometimes}) }, q{omp_display_affinity dies on invalid input} );
39 |
40 |  |  |  |  |  |  | # OMP_DYNAMIC
41 | 1 |  |  |  |  | 260 | note q{## OMP_DYNAMIC's valid values are: 'true', 1, 'false', 0, and may be unset};
42 | 1 |  |  |  |  | 420 | is $env->omp_dynamic(q{true}), q{true}, q{OMP_DYNAMIC can be set to 'true' via 'true' };
43 | 1 |  |  |  |  | 276 | is $env->unset_omp_dynamic(), q{true}, q{unset_omp_dynamic returns last known value if OMP_DYNAMIC is set};
44 | 1 |  |  |  |  | 269 | is $env->omp_dynamic(q{1}), q{1}, q{OMP_DYNAMIC can be set to '1' via '1' };
45 | 1 |  |  |  |  | 274 | is $env->unset_omp_dynamic(), q{1}, q{unset_omp_dynamic returns last known value if OMP_DYNAMIC is set};
46 | 1 |  |  |  |  | 272 | is $env->omp_dynamic(q{false}), undef, q{OMP_DYNAMIC can be set to 'false' via 'false' };
47 | 1 |  |  |  |  | 322 | is $env->unset_omp_dynamic(), undef, q{unset_omp_dynamic returns undef when OMP_DYNAMIC already doesn't exist};
48 | 1 |  |  |  |  | 326 | is $env->omp_dynamic(q{1}), q{1}, q{OMP_DYNAMIC can be set to '1' via '1' };
49 | 1 |  |  |  |  | 270 | is $env->omp_dynamic(q{0}), 1, q{OMP_DYNAMIC can be unset via '0', if set returns 1};
50 | 1 |  |  |  |  | 272 | is $env->unset_omp_dynamic(), undef, q{unset_omp_dynamic returns last known value if OMP_DYNAMIC is set, including undef if unset};
51 | 1 |  |  |  |  | 327 | is $env->omp_dynamic, undef, q{OMP_DYNAMIC has indeed been unset};
52 | 1 |  |  |  |  | 318 | ok !exists( $ENV{OMP_DYNAMIC} ), q/$ENV{OMP_DYNAMIC} doesn't exist, as expected/;
53 | 1 1 |  |  | 1 |  | 247 29 | dies_ok( sub { $env->omp_dynamic(q{Invalid value xxx}) }, q{omp_dynamic dies on invalid input} );
54 |
55 |  |  |  |  |  |  | # OMP_NESTED
56 | 1 |  |  |  |  | 290 | note q{## OMP_NESTED's valid values are: 'TRUE', 'FALSE', and may be unset};
57 | 1 |  |  |  |  | 456 | is $env->omp_nested(q{TRUE}), q{TRUE}, q{OMP_NESTED can be set to 'TRUE' };
58 | 1 |  |  |  |  | 273 | is $env->omp_nested(q{true}), q{TRUE}, q{OMP_NESTED can be set to 'TRUE' via 'true' };
59 | 1 |  |  |  |  | 287 | is $env->unset_omp_nested(), q{TRUE}, q{unset_omp_nested returns last known value if OMP_NESTED is set};
60 | 1 |  |  |  |  | 270 | is $env->omp_nested(q{TRUE}), q{TRUE}, q{OMP_NESTED can be set to 'TRUE' };
61 | 1 |  |  |  |  | 270 | is $env->omp_nested(q{FALSE}), q{TRUE}, q{OMP_NESTED is deleted from %ENV when set to 'FALSE' };
62 | 1 |  |  |  |  | 292 | is $env->omp_nested(q{false}), undef, q{OMP_NESTED is deleted from %ENV when set to 'false' };
63 | 1 |  |  |  |  | 350 | is $env->unset_omp_nested(), undef, q{unset_omp_nested returns last known value if OMP_NESTED is set};
64 | 1 |  |  |  |  | 715 | is $env->omp_nested, undef, q{OMP_NESTED has indeed been unset};
65 | 1 |  |  |  |  | 238 | ok !exists( $ENV{OMP_NESTED} ), q/$ENV{OMP_NESTED} doesn't exist, as expected/;
66 | 1 1 |  |  | 1 |  | 185 27 | dies_ok( sub { $env->omp_nested(q{Invalid value xxx}) }, q{omp_nested dies on invalid input} );
67 |
68 |  |  |  |  |  |  | # OMP_WAIT_POLICY
69 | 1 |  |  |  |  | 192 | note q{## OMP_WAIT_POLICY's valid values are: 'ACTIVE', 'PASSIVE', and may be unset};
70 | 1 |  |  |  |  | 327 | is $env->omp_wait_policy(q{ACTIVE}), q{ACTIVE}, q{OMP_WAIT_POLICY can be set to 'ACTIVE' };
71 | 1 |  |  |  |  | 213 | is $env->omp_wait_policy(q{active}), q{ACTIVE}, q{OMP_WAIT_POLICY can be set to 'ACTIVE' via 'active' };
72 | 1 |  |  |  |  | 202 | is $env->unset_omp_wait_policy(), q{ACTIVE}, q{unset_omp_wait_policy returns last known value if OMP_WAIT_POLICY is set};
73 | 1 |  |  |  |  | 201 | is $env->omp_wait_policy(q{PASSIVE}), q{PASSIVE}, q{OMP_WAIT_POLICY can be set to 'PASSIVE' };
74 | 1 |  |  |  |  | 202 | is $env->omp_wait_policy(q{passive}), q{PASSIVE}, q{OMP_WAIT_POLICY can be set to 'PASSIVE' via 'passive' };
75 | 1 |  |  |  |  | 201 | is $env->unset_omp_wait_policy(), q{PASSIVE}, q{unset_omp_wait_policy returns last known value if OMP_WAIT_POLICY is set};
76 | 1 |  |  |  |  | 200 | is $env->omp_wait_policy, undef, q{OMP_WAIT_POLICY has indeed been unset};
77 | 1 |  |  |  |  | 243 | ok !exists( $ENV{OMP_WAIT_POLICY} ), q/$ENV{OMP_WAIT_POLICY} doesn't exist, as expected/;
78 | 1 1 |  |  | 1 |  | 187 22 | dies_ok( sub { $env->omp_wait_policy(q{Invalid value xxx}) }, q{omp_wait_policy dies on invalid input} );
79 |
80 |  |  |  |  |  |  | # GOMP_DEBUG
81 | 1 |  |  |  |  | 191 | note q{## GOMP_DEBUG's valid values are: '1', '0', and may be unset};
82 | 1 |  |  |  |  | 309 | is $env->gomp_debug(q{1}), q{1}, q{GOMP_DEBUG can be set to '1' };
83 | 1 |  |  |  |  | 207 | is $env->unset_gomp_debug(), q{1}, q{unset_gomp_debug returns last known value if GOMP_DEBUG is set};
84 | 1 |  |  |  |  | 202 | is $env->gomp_debug(q{0}), q{0}, q{GOMP_DEBUG can be set to '0' };
85 | 1 |  |  |  |  | 203 | is $env->unset_gomp_debug(), q{0}, q{unset_gomp_debug returns last known value if GOMP_DEBUG is set};
86 | 1 |  |  |  |  | 201 | is $env->gomp_debug, undef, q{GOMP_DEBUG has indeed been unset};
87 | 1 |  |  |  |  | 238 | ok !exists( $ENV{GOMP_DEBUG} ), q/$ENV{GOMP_DEBUG} doesn't exist, as expected/;
88 | 1 1 |  |  | 1 |  | 204 22 | dies_ok( sub { $env->gomp_debug(q{Invalid value xxx}) }, q{gomp_debug dies on invalid input} );
89 |
90 |  |  |  |  |  |  | # OMP_DISPLAY_ENV
91 | 1 |  |  |  |  | 190 | note q{## OMP_DISPLAY_ENV's valid values are: 'TRUE', 'VERBOSE', 'FALSE', and may be unset};
92 | 1 |  |  |  |  | 305 | is $env->omp_display_env(q{TRUE}), q{TRUE}, q{OMP_DISPLAY_ENV can be set to 'TRUE' };
93 | 1 |  |  |  |  | 210 | is $env->omp_display_env(q{true}), q{TRUE}, q{OMP_DISPLAY_ENV can be set to 'TRUE' via 'true' };
94 | 1 |  |  |  |  | 203 | is $env->unset_omp_display_env(), q{TRUE}, q{unset_omp_display_env returns last known value if OMP_DISPLAY_ENV is set};
95 | 1 |  |  |  |  | 204 | is $env->omp_display_env(q{VERBOSE}), q{VERBOSE}, q{OMP_DISPLAY_ENV can be set to 'VERBOSE' };
96 | 1 |  |  |  |  | 212 | is $env->omp_display_env(q{verbose}), q{VERBOSE}, q{OMP_DISPLAY_ENV can be set to 'VERBOSE' via 'verbose' };
97 | 1 |  |  |  |  | 200 | is $env->unset_omp_display_env(), q{VERBOSE}, q{unset_omp_display_env returns last known value if OMP_DISPLAY_ENV is set};
98 | 1 |  |  |  |  | 202 | is $env->omp_display_env(q{FALSE}), q{FALSE}, q{OMP_DISPLAY_ENV can be set to 'FALSE' };
99 | 1 |  |  |  |  | 200 | is $env->omp_display_env(q{false}), q{FALSE}, q{OMP_DISPLAY_ENV can be set to 'FALSE' via 'false' };
100 | 1 |  |  |  |  | 213 | is $env->unset_omp_display_env(), q{FALSE}, q{unset_omp_display_env returns last known value if OMP_DISPLAY_ENV is set};
101 | 1 |  |  |  |  | 217 | is $env->omp_display_env, undef, q{OMP_DISPLAY_ENV has indeed been unset};
102 | 1 |  |  |  |  | 247 | ok !exists( $ENV{OMP_DISPLAY_ENV} ), q/$ENV{OMP_DISPLAY_ENV} doesn't exist, as expected/;
103 | 1 1 |  |  | 1 |  | 191 22 | dies_ok( sub { $env->omp_display_env(q{Invalid value xxx}) }, q{omp_display_env dies on invalid input} );
104 |
105 |  |  |  |  |  |  | # OMP_TARGET_OFFLOAD
106 | 1 |  |  |  |  | 191 | note q{## OMP_TARGET_OFFLOAD's valid values are: 'MANDATORY', 'DISABLED', 'DEFAULT', and may be unset};
107 | 1 |  |  |  |  | 320 | is $env->omp_target_offload(q{MANDATORY}), q{MANDATORY}, q{OMP_TARGET_OFFLOAD can be set to 'MANDATORY' };
108 | 1 |  |  |  |  | 227 | is $env->omp_target_offload(q{mandatory}), q{MANDATORY}, q{OMP_TARGET_OFFLOAD can be set to 'MANDATORY' via 'mandatory' };
109 | 1 |  |  |  |  | 203 | is $env->unset_omp_target_offload(), q{MANDATORY}, q{unset_omp_target_offload returns last known value if OMP_TARGET_OFFLOAD is set};
110 | 1 |  |  |  |  | 199 | is $env->omp_target_offload(q{DISABLED}), q{DISABLED}, q{OMP_TARGET_OFFLOAD can be set to 'DISABLED' };
111 | 1 |  |  |  |  | 211 | is $env->omp_target_offload(q{disabled}), q{DISABLED}, q{OMP_TARGET_OFFLOAD can be set to 'DISABLED' via 'disabled' };
112 | 1 |  |  |  |  | 202 | is $env->unset_omp_target_offload(), q{DISABLED}, q{unset_omp_target_offload returns last known value if OMP_TARGET_OFFLOAD is set};
113 | 1 |  |  |  |  | 202 | is $env->omp_target_offload(q{DEFAULT}), q{DEFAULT}, q{OMP_TARGET_OFFLOAD can be set to 'DEFAULT' };
114 | 1 |  |  |  |  | 204 | is $env->omp_target_offload(q{default}), q{DEFAULT}, q{OMP_TARGET_OFFLOAD can be set to 'DEFAULT' via 'default' };
115 | 1 |  |  |  |  | 203 | is $env->unset_omp_target_offload(), q{DEFAULT}, q{unset_omp_target_offload returns last known value if OMP_TARGET_OFFLOAD is set};
116 | 1 |  |  |  |  | 202 | is $env->omp_target_offload, undef, q{OMP_TARGET_OFFLOAD has indeed been unset};
117 | 1 |  |  |  |  | 240 | ok !exists( $ENV{OMP_TARGET_OFFLOAD} ), q/$ENV{OMP_TARGET_OFFLOAD} doesn't exist, as expected/;
118 | 1 1 |  |  | 1 |  | 187 25 | dies_ok( sub { $env->omp_target_offload(q{Invalid value xxx}) }, q{omp_target_offload dies on invalid input} );
119 |
120 |  |  |  |  |  |  | # >= 1
121 |  |  |  |  |  |  | # OMP_DEFAULT_DEVICE
122 | 1 |  |  |  |  | 192 | note q{## OMP_DEFAULT_DEVICE's valid values are integers 0 or greater (>= 0)};
123 | 1 |  |  |  |  | 310 | is $env->omp_default_device(0), 0, q{OMP_DEFAULT_DEVICE can be set to 0};
124 | 1 |  |  |  |  | 203 | is $env->unset_omp_default_device(), 0, q{unset_omp_default_device returns last known value if OMP_DEFAULT_DEVICE is set};
125 | 1 |  |  |  |  | 202 | is $env->omp_default_device(q{0}), q{0}, q{OMP_DEFAULT_DEVICE can be set to '0'};
126 | 1 |  |  |  |  | 202 | is $env->unset_omp_default_device(), q{0}, q{unset_omp_default_device returns last known value if OMP_DEFAULT_DEVICE is set};
127 | 1 |  |  |  |  | 236 | for my $i ( 1 .. 10 ) {
128 | 10 |  |  |  |  | 1944 | is $env->omp_default_device($i), $i, qq{OMP_DEFAULT_DEVICE can be set to $i};
129 | 10 |  |  |  |  | 2023 | is $env->unset_omp_default_device(), $i, q{unset_omp_default_device returns last known value if OMP_DEFAULT_DEVICE is set};
130 | 10 |  |  |  |  | 2044 | is $env->omp_default_device(qq{$i}), qq{$i}, qq{OMP_DEFAULT_DEVICE can be set to '$i'};
131 | 10 |  |  |  |  | 2063 | is $env->unset_omp_default_device(), qq{$i}, q{unset_omp_default_device returns last known value if OMP_DEFAULT_DEVICE is set};
132 |  |  |  |  |  |  | }
133 | 1 1 |  |  | 1 |  | 213 23 | dies_ok( sub { $env->omp_default_device(-1) }, q{omp_default_device dies on invalid input (-1)} );
134 | 1 1 |  |  | 1 |  | 203 22 | dies_ok( sub { $env->omp_default_device(-2) }, q{omp_default_device dies on invalid input (-2)} );
135 | 1 1 |  |  | 1 |  | 200 22 | dies_ok( sub { $env->omp_default_device(q{foo}) }, q{omp_default_device dies on invalid input ('foo')} );
136 |
137 |  |  |  |  |  |  | # OMP_MAX_TASK_PRIORITY
138 | 1 |  |  |  |  | 193 | note q{## OMP_MAX_TASK_PRIORITY's valid values are integers 0 or greater (>= 0)};
139 | 1 |  |  |  |  | 311 | is $env->omp_max_task_priority(0), 0, q{OMP_MAX_TASK_PRIORITY can be set to 0};
140 | 1 |  |  |  |  | 205 | is $env->unset_omp_max_task_priority(), 0, q{unset_omp_max_task_priority returns last known value if OMP_MAX_TASK_PRIORITY is set};
141 | 1 |  |  |  |  | 216 | is $env->omp_max_task_priority(q{0}), q{0}, q{OMP_MAX_TASK_PRIORITY can be set to '0'};
142 | 1 |  |  |  |  | 203 | is $env->unset_omp_max_task_priority(), q{0}, q{unset_omp_max_task_priority returns last known value if OMP_MAX_TASK_PRIORITY is set};
143 | 1 |  |  |  |  | 215 | for my $i ( 1 .. 10 ) {
144 | 10 |  |  |  |  | 1844 | is $env->omp_max_task_priority($i), $i, qq{OMP_MAX_TASK_PRIORITY can be set to $i};
145 | 10 |  |  |  |  | 2023 | is $env->unset_omp_max_task_priority(), $i, q{unset_omp_max_task_priority returns last known value if OMP_MAX_TASK_PRIORITY is set};
146 | 10 |  |  |  |  | 2035 | is $env->omp_max_task_priority(qq{$i}), qq{$i}, qq{OMP_MAX_TASK_PRIORITY can be set to '$i'};
147 | 10 |  |  |  |  | 2074 | is $env->unset_omp_max_task_priority(), qq{$i}, q{unset_omp_max_task_priority returns last known value if OMP_MAX_TASK_PRIORITY is set};
148 |  |  |  |  |  |  | }
149 | 1 1 |  |  | 1 |  | 206 22 | dies_ok( sub { $env->omp_max_task_priority(-1) }, q{omp_max_task_priority dies on invalid input (-1)} );
150 | 1 1 |  |  | 1 |  | 199 21 | dies_ok( sub { $env->omp_max_task_priority(-2) }, q{omp_max_task_priority dies on invalid input (-2)} );
151 | 1 1 |  |  | 1 |  | 196 21 | dies_ok( sub { $env->omp_max_task_priority(q{foo}) }, q{omp_max_task_priority dies on invalid input ('foo')} );
152 |
153 |  |  |  |  |  |  | # >= 0
154 |  |  |  |  |  |  | # OMP_MAX_ACTIVE_LEVELS
155 | 1 |  |  |  |  | 197 | note q{## OMP_MAX_ACTIVE_LEVELS's valid values are integers 0 or greater (>= 1)};
156 | 1 |  |  |  |  | 317 | for my $i ( 1 .. 10 ) {
157 | 10 |  |  |  |  | 1852 | is $env->omp_max_active_levels($i), $i, qq{OMP_MAX_ACTIVE_LEVELS can be set to $i};
158 | 10 |  |  |  |  | 2038 | is $env->unset_omp_max_active_levels(), $i, q{unset_omp_max_active_levels returns last known value if OMP_MAX_ACTIVE_LEVELS is set};
159 | 10 |  |  |  |  | 2042 | is $env->omp_max_active_levels(qq{$i}), qq{$i}, qq{OMP_MAX_ACTIVE_LEVELS can be set to '$i'};
160 | 10 |  |  |  |  | 2054 | is $env->unset_omp_max_active_levels(), qq{$i}, q{unset_omp_max_active_levels returns last known value if OMP_MAX_ACTIVE_LEVELS is set};
161 |  |  |  |  |  |  | }
162 | 1 1 |  |  | 1 |  | 204 23 | dies_ok( sub { $env->omp_max_active_levels(0) }, q{omp_max_active_levels dies on invalid input (0)} );
163 | 1 1 |  |  | 1 |  | 198 29 | dies_ok( sub { $env->omp_max_active_levels(-1) }, q{omp_max_active_levels dies on invalid input (-1)} );
164 | 1 1 |  |  | 1 |  | 197 22 | dies_ok( sub { $env->omp_max_active_levels(-2) }, q{omp_max_active_levels dies on invalid input (-2)} );
165 | 1 1 |  |  | 1 |  | 205 21 | dies_ok( sub { $env->omp_max_active_levels(q{foo}) }, q{omp_max_active_levels dies on invalid input ('foo')} );
166 |
167 |  |  |  |  |  |  | # OMP_NUM_THREADS
168 | 1 |  |  |  |  | 220 | note q{## OMP_NUM_THREADS's valid values are integers 0 or greater (>= 1)};
169 | 1 |  |  |  |  | 364 | for my $i ( 1 .. 10 ) {
170 | 10 |  |  |  |  | 1826 | is $env->omp_num_threads($i), $i, qq{OMP_NUM_THREADS can be set to $i};
171 | 10 |  |  |  |  | 2037 | is $env->unset_omp_num_threads(), $i, q{unset_omp_num_threads returns last known value if OMP_NUM_THREADS is set};
172 | 10 |  |  |  |  | 2055 | is $env->omp_num_threads(qq{$i}), qq{$i}, qq{OMP_NUM_THREADS can be set to '$i'};
173 | 10 |  |  |  |  | 2077 | is $env->unset_omp_num_threads(), qq{$i}, q{unset_omp_num_threads returns last known value if OMP_NUM_THREADS is set};
174 |  |  |  |  |  |  | }
175 | 1 1 |  |  | 1 |  | 205 23 | dies_ok( sub { $env->omp_num_threads(0) }, q{omp_num_threads dies on invalid input (0)} );
176 | 1 1 |  |  | 1 |  | 198 22 | dies_ok( sub { $env->omp_num_threads(-1) }, q{omp_num_threads dies on invalid input (-1)} );
177 | 1 1 |  |  | 1 |  | 198 21 | dies_ok( sub { $env->omp_num_threads(-2) }, q{omp_num_threads dies on invalid input (-2)} );
178 | 1 1 |  |  | 1 |  | 204 22 | dies_ok( sub { $env->omp_num_threads(q{foo}) }, q{omp_num_threads dies on invalid input ('foo')} );
179 | 1 |  |  |  |  | 192 | is $env->omp_num_threads(q{8,4,2}), q{8,4,2}, q{OMP_NUM_THREADS accepts a nested-level list};
180 | 1 |  |  |  |  | 207 | is $env->unset_omp_num_threads(), q{8,4,2}, q{nested-level OMP_NUM_THREADS list can be unset};
181 | 1 |  |  |  |  | 203 | is $env->omp_num_threads(q{8, 4, 2}), q{8, 4, 2}, q{OMP_NUM_THREADS accepts whitespace around list separators};
182 | 1 |  |  |  |  | 201 | is $env->unset_omp_num_threads(), q{8, 4, 2}, q{whitespace-preserving OMP_NUM_THREADS list can be unset};
183 | 1 1 |  |  | 1 |  | 205 22 | dies_ok( sub { $env->omp_num_threads(q{8,0,2}) }, q{omp_num_threads rejects zero in a nested-level list} );
184 | 1 1 |  |  | 1 |  | 197 21 | dies_ok( sub { $env->omp_num_threads(q{8,,2}) }, q{omp_num_threads rejects an empty nested-level list item} );
185 | 1 1 |  |  | 1 |  | 196 34 | dies_ok( sub { $env->omp_num_threads(q{8,foo,2}) }, q{omp_num_threads rejects a non-integer nested-level list item} );
186 |
187 |  |  |  |  |  |  | # OMP_NUM_TEAMS
188 | 1 |  |  |  |  | 194 | note q{## OMP_NUM_TEAMS's valid values are integers 0 or greater (>= 1)};
189 | 1 |  |  |  |  | 311 | for my $i ( 1 .. 10 ) {
190 | 10 |  |  |  |  | 1825 | is $env->omp_num_teams($i), $i, qq{OMP_NUM_TEAMS can be set to $i};
191 | 10 |  |  |  |  | 2054 | is $env->unset_omp_num_teams(), $i, q{unset_omp_num_teams returns last known value if OMP_NUM_TEAMS is set};
192 | 10 |  |  |  |  | 2008 | is $env->omp_num_teams(qq{$i}), qq{$i}, qq{OMP_NUM_TEAMS can be set to '$i'};
193 | 10 |  |  |  |  | 2023 | is $env->unset_omp_num_teams(), qq{$i}, q{unset_omp_num_teams returns last known value if OMP_NUM_TEAMS is set};
194 |  |  |  |  |  |  | }
195 | 1 1 |  |  | 1 |  | 206 23 | dies_ok( sub { $env->omp_num_teams(0) }, q{omp_num_teams dies on invalid input (0)} );
196 | 1 1 |  |  | 1 |  | 202 22 | dies_ok( sub { $env->omp_num_teams(-1) }, q{omp_num_teams dies on invalid input (-1)} );
197 | 1 1 |  |  | 1 |  | 195 21 | dies_ok( sub { $env->omp_num_teams(-2) }, q{omp_num_teams dies on invalid input (-2)} );
198 | 1 1 |  |  | 1 |  | 194 21 | dies_ok( sub { $env->omp_num_teams(q{foo}) }, q{omp_num_teams dies on invalid input ('foo')} );
199 |
200 |  |  |  |  |  |  | # OMP_THREAD_LIMIT
201 | 1 |  |  |  |  | 191 | note q{## OMP_THREAD_LIMIT's valid values are integers 0 or greater (>= 1)};
202 | 1 |  |  |  |  | 309 | for my $i ( 1 .. 10 ) {
203 | 10 |  |  |  |  | 1860 | is $env->omp_thread_limit($i), $i, qq{OMP_THREAD_LIMIT can be set to $i};
204 | 10 |  |  |  |  | 2031 | is $env->unset_omp_thread_limit(), $i, q{unset_omp_thread_limit returns last known value if OMP_THREAD_LIMIT is set};
205 | 10 |  |  |  |  | 2024 | is $env->omp_thread_limit(qq{$i}), qq{$i}, qq{OMP_THREAD_LIMIT can be set to '$i'};
206 | 10 |  |  |  |  | 2028 | is $env->unset_omp_thread_limit(), qq{$i}, q{unset_omp_thread_limit returns last known value if OMP_THREAD_LIMIT is set};
207 |  |  |  |  |  |  | }
208 | 1 1 |  |  | 1 |  | 210 23 | dies_ok( sub { $env->omp_thread_limit(0) }, q{omp_thread_limit dies on invalid input (0)} );
209 | 1 1 |  |  | 1 |  | 197 22 | dies_ok( sub { $env->omp_thread_limit(-1) }, q{omp_thread_limit dies on invalid input (-1)} );
210 | 1 1 |  |  | 1 |  | 197 22 | dies_ok( sub { $env->omp_thread_limit(-2) }, q{omp_thread_limit dies on invalid input (-2)} );
211 | 1 1 |  |  | 1 |  | 199 21 | dies_ok( sub { $env->omp_thread_limit(q{foo}) }, q{omp_thread_limit dies on invalid input ('foo')} );
212 |
213 |  |  |  |  |  |  | # OMP_TEAMS_THREAD_LIMIT
214 | 1 |  |  |  |  | 192 | note q{## OMP_TEAMS_THREAD_LIMIT's valid values are integers 0 or greater (>= 1)};
215 | 1 |  |  |  |  | 319 | for my $i ( 1 .. 10 ) {
216 | 10 |  |  |  |  | 1861 | is $env->omp_teams_thread_limit($i), $i, qq{OMP_THREAD_LIMIT can be set to $i};
217 | 10 |  |  |  |  | 2034 | is $env->unset_omp_teams_thread_limit(), $i, q{unset_omp_teams_thread_limit returns last known value if OMP_THREAD_LIMIT is set};
218 | 10 |  |  |  |  | 2060 | is $env->omp_teams_thread_limit(qq{$i}), qq{$i}, qq{OMP_THREAD_LIMIT can be set to '$i'};
219 | 10 |  |  |  |  | 2035 | is $env->unset_omp_teams_thread_limit(), qq{$i}, q{unset_omp_teams_thread_limit returns last known value if OMP_THREAD_LIMIT is set};
220 |  |  |  |  |  |  | }
221 | 1 1 |  |  | 1 |  | 206 22 | dies_ok( sub { $env->omp_teams_thread_limit(0) }, q{omp_teams_thread_limit dies on invalid input (0)} );
222 | 1 1 |  |  | 1 |  | 198 22 | dies_ok( sub { $env->omp_teams_thread_limit(-1) }, q{omp_teams_thread_limit dies on invalid input (-1)} );
223 | 1 1 |  |  | 1 |  | 196 21 | dies_ok( sub { $env->omp_teams_thread_limit(-2) }, q{omp_teams_thread_limit dies on invalid input (-2)} );
224 | 1 1 |  |  | 1 |  | 195 21 | dies_ok( sub { $env->omp_teams_thread_limit(q{foo}) }, q{omp_teams_thread_limit dies on invalid input ('foo')} );
225 |
226 |  |  |  |  |  |  | ## not validated, but test set/unset
227 |  |  |  |  |  |  | ## no convenient 'uc' filters, either
228 |  |  |  |  |  |  | # OMP_ALLOCATOR
229 | 1 |  |  |  |  | 192 | ok $env->omp_allocator(q{omp_high_bw_mem_alloc}), q{omp_allocator sets a predefined allocator};
230 | 1 |  |  |  |  | 214 | is $env->unset_omp_allocator(), q{omp_high_bw_mem_alloc}, q{unset_omp_allocator returns last known value};
231 | 1 |  |  |  |  | 204 | ok $env->omp_allocator(q{omp_low_lat_mem_space:pinned=true,partition=nearest}), q{omp_allocator passes complex allocator syntax through};
232 | 1 |  |  |  |  | 190 | is $env->unset_omp_allocator(), q{omp_low_lat_mem_space:pinned=true,partition=nearest}, q{complex OMP_ALLOCATOR value can be unset};
233 |
234 |  |  |  |  |  |  | # OMP_AFFINITY_FORMAT
235 | 1 |  |  |  |  | 206 | ok $env->omp_affinity_format(q{thread %n affinity %A}), q{omp_affinity_format sets an affinity display format};
236 | 1 |  |  |  |  | 190 | is $env->unset_omp_affinity_format(), q{thread %n affinity %A}, q{unset_omp_affinity_format returns last known value};
237 |
238 |  |  |  |  |  |  | # OMP_PROC_BIND
239 | 1 |  |  |  |  | 201 | ok $env->omp_proc_bind(q{TRUE}), q{omp_proc_bind sets arbitrary value ok, no validation (yet)};
240 | 1 |  |  |  |  | 190 | is $env->unset_omp_proc_bind(), q{TRUE}, q{unset_omp_proc_bind returns last known value if OMP_PROC_BIND is set};
241 | 1 |  |  |  |  | 199 | ok $env->omp_proc_bind(q{FALSE}), q{omp_proc_bind sets arbitrary value ok, no validation (yet)};
242 | 1 |  |  |  |  | 190 | is $env->unset_omp_proc_bind(), q{FALSE}, q{unset_omp_proc_bind returns last known value if OMP_PROC_BIND is set};
243 | 1 |  |  |  |  | 202 | ok $env->omp_proc_bind(q{MASTER,CLOSE,SPREAD}), q{omp_proc_bind sets arbitrary value ok, no validation (yet)};
244 | 1 |  |  |  |  | 190 | is $env->unset_omp_proc_bind(), q{MASTER,CLOSE,SPREAD}, q{unset_omp_proc_bind returns last known value if OMP_PROC_BIND is set};
245 |
246 |  |  |  |  |  |  | # OMP_PLACES
247 | 1 |  |  |  |  | 221 | ok $env->omp_places(q/{0,1,2}, {3,4,6}, {7,8,9}, {10,11,12}/), q{omp_places sets arbitrary value ok, no validation (yet)};
248 | 1 |  |  |  |  | 199 | is $env->unset_omp_places(), q/{0,1,2}, {3,4,6}, {7,8,9}, {10,11,12}/, q{unset_omp_places returns last known value if OMP_PLACES is set};
249 |
250 |  |  |  |  |  |  | # OMP_STACKSIZE
251 | 1 |  |  |  |  | 204 | ok $env->omp_stacksize(1024), q{omp_stacksize sets arbitrary value ok, no validation (yet)};
252 | 1 |  |  |  |  | 189 | is $env->unset_omp_stacksize(), 1024, q{unset_omp_stacksize returns last known value if OMP_STACKSIZE is set};
253 | 1 |  |  |  |  | 201 | ok $env->omp_stacksize(q{1024G}), q{omp_stacksize sets arbitrary value ok, no validation (yet)};
254 | 1 |  |  |  |  | 188 | is $env->unset_omp_stacksize(), q{1024G}, q{unset_omp_stacksize returns last known value if OMP_STACKSIZE is set};
255 |
256 |  |  |  |  |  |  | # OMP_SCHEDULE
257 | 1 |  |  |  |  | 208 | ok $env->omp_schedule(q{static,10}), q{omp_schedule sets arbitrary (static,10) value ok, no validation (yet)};
258 | 1 |  |  |  |  | 191 | is $env->unset_omp_schedule(), q{static,10}, q{unset_omp_schedule returns last known value if OMP_SCHEDULE is set};
259 | 1 |  |  |  |  | 202 | ok $env->omp_schedule(q{dynamic,10}), q{omp_schedule sets arbitrary (dynamic,10) value ok, no validation (yet)};
260 | 1 |  |  |  |  | 188 | is $env->unset_omp_schedule(), q{dynamic,10}, q{unset_omp_schedule returns last known value if OMP_SCHEDULE is set};
261 | 1 |  |  |  |  | 201 | ok $env->omp_schedule(q{guided,10}), q{omp_schedule sets arbitrary (guided,10) value ok, no validation (yet)};
262 | 1 |  |  |  |  | 209 | is $env->unset_omp_schedule(), q{guided,10}, q{unset_omp_schedule returns last known value if OMP_SCHEDULE is set};
263 |
264 |  |  |  |  |  |  | # GOMP_CPU_AFFINITY
265 | 1 |  |  |  |  | 204 | ok $env->gomp_cpu_affinity(q{0 3 1-2 4-15:2}), q{gomp_cpu_affinity sets arbitrary (0 3 1-2 4-15:2) value ok, no validation (yet)};
266 | 1 |  |  |  |  | 194 | is $env->unset_gomp_cpu_affinity(), q{0 3 1-2 4-15:2}, q{unset_gomp_cpu_affinity returns last known value if OMP_PLACES is set};
267 |
268 |  |  |  |  |  |  | # GOMP_STACKSIZE
269 | 1 |  |  |  |  | 204 | ok $env->gomp_stacksize(1024), q{gomp_stacksize sets arbitrary (1024) value ok, no validation (yet)};
270 | 1 |  |  |  |  | 189 | is $env->unset_gomp_stacksize(), 1024, q{unset_gomp_stacksize returns last known value if GOMP_STACKSIZE is set};
271 |
272 |  |  |  |  |  |  | # GOMP_SPINCOUNT
273 | 1 |  |  |  |  | 202 | ok $env->gomp_spincount(q{not sure about this one}), q{gomp_spincount sets arbitrary value ok, no validation (yet)};
274 | 1 |  |  |  |  | 191 | is $env->unset_gomp_spincount(), q{not sure about this one}, q{unset_gomp_spincount returns last known value if GOMP_SPINCOUNT is set};
275 |
276 |  |  |  |  |  |  | # GOMP_RTEMS_THREAD_POOLS
277 | 1 |  |  |  |  | 201 | ok $env->gomp_rtems_thread_pools(q{not sure about this one}), q{gomp_rtems_thread_pools sets arbitrary value ok, no validation (yet)};
278 | 1 |  |  |  |  | 189 | is $env->unset_gomp_rtems_thread_pools(), q{not sure about this one}, q{unset_gomp_rtems_thread_pools returns last known value if GOMP_RTEMS_THREAD_POOLS is set};
279 |
280 | 1 |  |  |  |  | 201 | done_testing;
281 |
282 | 1 |  |  |  |  | 680 | exit;