Skip to content

Commit ec92be4

Browse files
committedMar 11, 2025·
made updates to testing infrastructure to support 5.10.1 on GH actions
(cherry picked from commit 696b5ec) Signed-off-by: O. Odler, 577 <oodler@cpan.org>
1 parent 8b11d2c commit ec92be4

19 files changed

+271
-41
lines changed
 

‎.github/workflows/other-perls.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: false # Ensures that one failing job does not cancel others
1010
matrix:
1111
os: ["ubuntu-latest","ubuntu-22.04"]
12-
perl: ["5.40","5.38","5.36","5.34","5.32","5.30","5.28","5.26","5.24","5.22","5.20","5.18","5.16","5.14","5.12"]
12+
perl: ["5.40","5.38","5.36","5.34","5.32","5.30","5.28","5.26","5.24","5.22","5.20","5.18","5.16","5.14","5.12","5.10"]
1313
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
1414

1515
steps:
@@ -26,8 +26,11 @@ jobs:
2626
- name: Install Required Perl Modules
2727
run: |
2828
cpanm --verbose --notest Module::Build Inline::C Alien::OpenMP \
29-
Util::H2O::More File::Temp Test::Exception Test::Deep \
29+
Util::H2O::More File::Temp Test::Exception \
3030
OpenMP::Environment File::ShareDir
31+
32+
# Conditionally install Test::Deep if Perl version >= 5.12
33+
perl -e 'exit 1 if $] < 5.012' && cpanm --verbose --notest Test::Deep || echo "Skipping Test::Deep for Perl < 5.12"
3134
3235
- name: Run Tests
3336
run: ./test-runner.sh

‎Changes

+6
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,9 @@
109109
for perls 5.12 and 5.14 via GH Actions CI testing
110110
- added a secondary test that doesn't run `dzil test`
111111
so we can test on perls <= 5.18
112+
113+
0.2.6 03/11/2025 01:18:00 AM MST
114+
- update dist.ini to require Test::Deeply on if perl >= 5.12
115+
- module is tested down to 5.10.1 (cpanm --notest), though some
116+
prereqs may technically have higher perl requirments, please
117+
let oodler@cpan.org know if this causes problems for you

‎dist.ini

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ OpenMP::Environment = 0
1818
Util::H2O::More = >= 0.3.4
1919
Test::More = 0
2020
Test::Exception = 0
21-
Test::Deep = 0
2221
Digest::MD5 = 0
2322
File::Temp = 0
23+
[DynamicPrereqs::Meta]
24+
condition = has_perl 5.012
25+
prereq = Test::Deep 0
2426
[Prereqs]
2527
Alien::OpenMP = 0
2628
Inline::C = 0

‎lib/OpenMP/Simple.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use strict;
44
use warnings;
55
use Alien::OpenMP;
66

7-
our $VERSION = q{0.2.5};
7+
our $VERSION = q{0.2.6};
88

99
# This module is a wrapper around a ".h" file that is injected into Alien::OpenMP
1010
# via Inline:C's AUTO_INCLUDE feature. This header file constains C macros for reading

‎t-flapping/12-PerlOMP_2D_AoA_TO_2D_INT_ARRAY_r.t

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -61,8 +73,13 @@ foreach my $thread_count (qw/2/) {
6173
my $seen_threads = shift @$aref_new;
6274
is $seen_rows, scalar @$aref_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
6375
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
64-
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
65-
cmp_deeply $aref_new, $expected, qq{PerlOMP_2D_AoA_TO_2D_INT_ARRAY worked to convert original ARRAY reference to raw C 2D array of ints};
76+
if ($has_test_deep) {
77+
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
78+
cmp_deeply $aref_new, $expected, qq{PerlOMP_2D_AoA_TO_2D_INT_ARRAY worked to convert original ARRAY reference to raw C 2D array of ints};
79+
}
80+
else {
81+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 2; }
82+
}
6683
}
6784

6885
done_testing;

‎t-skipped/16-PerlOMP_2D_AoA_TO_2D_INT_ARRAY_r.t

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -61,8 +73,13 @@ foreach my $thread_count (qw/2/) {
6173
my $seen_threads = shift @$aref_new;
6274
is $seen_rows, scalar @$aref_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
6375
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
64-
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
65-
cmp_deeply $aref_new, $expected, qq{PerlOMP_2D_AoA_TO_2D_INT_ARRAY worked to convert original ARRAY reference to raw C 2D array of ints};
76+
if ($has_test_deep) {
77+
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
78+
cmp_deeply $aref_new, $expected, qq{PerlOMP_2D_AoA_TO_2D_INT_ARRAY worked to convert original ARRAY reference to raw C 2D array of ints};
79+
}
80+
else {
81+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 2; }
82+
}
6683
}
6784

6885
done_testing;

‎t/00-PerlOMP_Array_Counting.t

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
87

98
# build and load subroutines
109
use OpenMP::Simple;

‎t/11-PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY.t

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -66,8 +78,13 @@ SKIP: {
6678
my $seen_threads = shift @$aref_new;
6779
is $seen_elements, scalar @$row_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
6880
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
69-
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
70-
cmp_deeply $aref_new, $expected, qq{PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY worked to convert original ARRAY reference to raw C 1D array of floats};
81+
if ($has_test_deep) {
82+
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
83+
cmp_deeply $aref_new, $expected, qq{PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY worked to convert original ARRAY reference to raw C 1D array of floats};
84+
}
85+
else {
86+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 2; }
87+
}
7188
}
7289
}
7390
};

‎t/11-PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY_r.t

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -66,8 +78,13 @@ SKIP: {
6678
my $seen_threads = shift @$aref_new;
6779
is $seen_elements, scalar @$row_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
6880
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
69-
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
70-
cmp_deeply $aref_new, $expected, qq{PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY worked to convert original ARRAY reference to raw C 1D array of floats};
81+
if ($has_test_deep) {
82+
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
83+
cmp_deeply $aref_new, $expected, qq{PerlOMP_1D_Array_TO_1D_FLOAT_ARRAY worked to convert original ARRAY reference to raw C 1D array of floats};
84+
}
85+
else {
86+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 2; }
87+
}
7188
}
7289
}
7390
};

‎t/12-PerlOMP_1D_Array_TO_1D_INT_ARRAY.t

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -60,8 +72,13 @@ foreach my $thread_count (qw/1 4 8/) {
6072
my $seen_threads = shift @$aref_new;
6173
is $seen_elements, scalar @$row_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
6274
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
63-
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
64-
cmp_deeply $aref_new, $expected, qq{PerlOMP_1D_Array_TO_1D_INT_ARRAY worked to convert original ARRAY reference to raw C 1D array of floats};
75+
if ($has_test_deep) {
76+
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
77+
cmp_deeply $aref_new, $expected, qq{PerlOMP_1D_Array_TO_1D_INT_ARRAY worked to convert original ARRAY reference to raw C 1D array of floats};
78+
}
79+
else {
80+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 2; }
81+
}
6582
}
6683
}
6784

‎t/12-PerlOMP_1D_Array_TO_1D_INT_ARRAY_r.t

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -60,8 +72,13 @@ foreach my $thread_count (qw/1 4 8/) {
6072
my $seen_threads = shift @$aref_new;
6173
is $seen_elements, scalar @$row_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
6274
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
63-
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
64-
cmp_deeply $aref_new, $expected, qq{PerlOMP_1D_Array_TO_1D_INT_ARRAY worked to convert original ARRAY reference to raw C 1D array of floats};
75+
if ($has_test_deep) {
76+
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
77+
cmp_deeply $aref_new, $expected, qq{PerlOMP_1D_Array_TO_1D_INT_ARRAY worked to convert original ARRAY reference to raw C 1D array of floats};
78+
}
79+
else {
80+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 2; }
81+
}
6582
}
6683
}
6784

‎t/13-PerlOMP_1D_Array_TO_1D_STRING_ARRAY.t

+19-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -57,7 +69,12 @@ foreach my $thread_count (qw/1 4 8/) {
5769
my $seen_threads = shift @$aref_new;
5870
is $seen_elements, scalar @$row_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
5971
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
60-
cmp_deeply $aref_new, $row_orig, qq{Row passed by reference matches the row constructed and returned by reference};;
72+
if ($has_test_deep) {
73+
cmp_deeply $aref_new, $row_orig, qq{Row passed by reference matches the row constructed and returned by reference};;
74+
}
75+
else {
76+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 1; }
77+
}
6178
}
6279
}
6380

‎t/13-PerlOMP_1D_Array_TO_1D_STRING_ARRAY_r.t

+19-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -57,7 +69,12 @@ foreach my $thread_count (qw/1 4 8/) {
5769
my $seen_threads = shift @$aref_new;
5870
is $seen_elements, scalar @$row_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
5971
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
60-
cmp_deeply $aref_new, $row_orig, qq{Row passed by reference matches the row constructed and returned by reference};;
72+
if ($has_test_deep) {
73+
cmp_deeply $aref_new, $row_orig, qq{Row passed by reference matches the row constructed and returned by reference};;
74+
}
75+
else {
76+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 1; }
77+
}
6178
}
6279
}
6380

‎t/13-PerlOMP_Array_Counting.t

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
87

98
# build and load subroutines
109
use OpenMP::Simple;

‎t/15-PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY.t

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -61,8 +73,13 @@ foreach my $thread_count (qw/1 2 4 8 16/) {
6173
my $seen_threads = shift @$aref_new;
6274
is $seen_rows, scalar @$aref_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
6375
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
64-
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
65-
cmp_deeply $aref_new, $expected, qq{PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY worked to convert original ARRAY reference to raw C 2D array of floats};
76+
if ($has_test_deep) {
77+
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
78+
cmp_deeply $aref_new, $expected, qq{PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY worked to convert original ARRAY reference to raw C 2D array of floats};
79+
}
80+
else {
81+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 2; }
82+
}
6683
}
6784

6885
done_testing;

‎t/15-PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY_r.t

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -61,8 +73,13 @@
6173
my $seen_threads = shift @$aref_new;
6274
is $seen_rows, scalar @$aref_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
6375
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
64-
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
65-
cmp_deeply $aref_new, $expected, qq{PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY worked to convert original ARRAY reference to raw C 2D array of floats};
76+
if ($has_test_deep) {
77+
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
78+
cmp_deeply $aref_new, $expected, qq{PerlOMP_2D_AoA_TO_2D_FLOAT_ARRAY worked to convert original ARRAY reference to raw C 2D array of floats};
79+
}
80+
else {
81+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 2; }
82+
}
6683
}
6784

6885
done_testing;

‎t/16-PerlOMP_2D_AoA_TO_2D_INT_ARRAY.t

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -61,8 +73,13 @@
6173
my $seen_threads = shift @$aref_new;
6274
is $seen_rows, scalar @$aref_orig, q{PerlOMP_1D_Array_NUM_ELEMENTS works on original ARRAY reference};
6375
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count is respected inside of the, omp parallel section, as expected};
64-
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
65-
cmp_deeply $aref_new, $expected, qq{PerlOMP_2D_AoA_TO_2D_INT_ARRAY worked to convert original ARRAY reference to raw C 2D array of ints};
76+
if ($has_test_deep) {
77+
cmp_deeply $aref_new, $expected, qq{Row summed array ref returned as expected from $thread_count OpenMP threads};
78+
cmp_deeply $aref_new, $expected, qq{PerlOMP_2D_AoA_TO_2D_INT_ARRAY worked to convert original ARRAY reference to raw C 2D array of ints};
79+
}
80+
else {
81+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 2; }
82+
}
6683
}
6784

6885
done_testing;

‎t/17-PerlOMP_2D_AoA_TO_2D_STRING_ARRAY.t

+19-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -55,7 +67,12 @@
5567

5668
is $seen_elements, scalar(@$aref_orig) * scalar(@{$aref_orig->[0]}), q{PerlOMP_2D_AoA_NUM_ELEMENTS works correctly};
5769
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count respected inside omp parallel section};
58-
cmp_deeply $aref_new, $aref_orig, qq{2D Array passed by reference matches the array returned};
70+
if ($has_test_deep) {
71+
cmp_deeply $aref_new, $aref_orig, qq{2D Array passed by reference matches the array returned};
72+
}
73+
else {
74+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 1; }
75+
}
5976
}
6077

6178
done_testing;

‎t/17-PerlOMP_2D_AoA_TO_2D_STRING_ARRAY_r.t

+19-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ use warnings;
44
use strict;
55

66
use Test::More;
7-
use Test::Deep;
7+
8+
my $has_test_deep = 1;
9+
BEGIN {
10+
if ($] < 5.012) {
11+
$has_test_deep = 0;
12+
} else {
13+
eval { require Test::Deep; Test::Deep->import(); 1 } or $has_test_deep = 0;
14+
}
15+
# mock cmp_deeply
16+
if (not $has_test_deep) {
17+
eval { *cmp_deeply = sub { 1 } };
18+
}
19+
}
820

921
# build and load subroutines
1022
use OpenMP::Simple;
@@ -55,7 +67,12 @@ foreach my $thread_count (qw/1 4 8/) {
5567

5668
is $seen_elements, scalar(@$aref_orig) * scalar(@{$aref_orig->[0]}), q{PerlOMP_2D_AoA_NUM_ELEMENTS works correctly};
5769
is $seen_threads, $thread_count, qq{OMP_NUM_THREADS=$thread_count respected inside omp parallel section};
58-
cmp_deeply $aref_new, $aref_orig, qq{2D Array passed by reference matches the array returned};
70+
if ($has_test_deep) {
71+
cmp_deeply $aref_new, $aref_orig, qq{2D Array passed by reference matches the array returned};
72+
}
73+
else {
74+
SKIP: { skip "Skipping cmp_deeply tests because Perl is below 5.12 or Test::Deep is unavailable", 2; }
75+
}
5976
}
6077

6178
done_testing;

0 commit comments

Comments
 (0)
Please sign in to comment.