Skip to content

Commit 65f36ba

Browse files
committed
Make the fakecc test more distinct
1 parent 02915d0 commit 65f36ba

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

dist/ExtUtils-CBuilder/t/03-cplusplus.t

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@ use File::Spec;
1616
my $quiet = $ENV{PERL_CORE} && !$ENV{HARNESS_ACTIVE};
1717
my ($source_file, $object_file, $lib_file);
1818

19-
my $b = ExtUtils::CBuilder->new(quiet => $quiet);
20-
21-
# test plan
22-
if ( ! $b->have_cplusplus ) {
23-
plan skip_all => "no compiler available for testing";
24-
}
25-
else {
26-
plan tests => 7;
27-
}
28-
2919
{
3020
# GH #23146
3121
my $fake_cc = File::Spec->rel2abs(File::Spec->catfile(qw(some directory what doesnt exist), 'cc'));
32-
my $b = ExtUtils::CBuilder->new(
22+
my $cb = ExtUtils::CBuilder->new(
3323
quiet => $quiet,
3424
config => {
3525
cc => $fake_cc,
3626
},
3727
);
3828

39-
is $b->{config}{cxx}, $fake_cc, "did not search PATH for C++ compiler when given absolute path to C compiler";
29+
is $cb->{config}{cxx}, $fake_cc, "did not search PATH for C++ compiler when given absolute path to C compiler";
30+
}
31+
32+
my $b = ExtUtils::CBuilder->new(quiet => $quiet);
33+
34+
# test plan
35+
if ( ! $b->have_cplusplus ) {
36+
plan skip_all => "no compiler available for testing";
37+
}
38+
else {
39+
plan tests => 7;
4040
}
4141

4242
ok $b->have_cplusplus, "have_cplusplus";

0 commit comments

Comments
 (0)