From 090a9bc1b96aafbf70ae3dec453d19b983162b53 Mon Sep 17 00:00:00 2001 From: Arne Johannessen Date: Wed, 23 Apr 2025 13:55:01 +0200 Subject: [PATCH 1/2] fix test failure on systems without cc - #30, #32 --- t/002_icpp.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/t/002_icpp.t b/t/002_icpp.t index 2d9b0d0..dccaf50 100644 --- a/t/002_icpp.t +++ b/t/002_icpp.t @@ -101,6 +101,7 @@ our $CAPTURES; { no warnings "redefine"; *ExtUtils::CppGuess::_capture = + *ExtUtils::CppGuess::_capture_empty_stdin = sub { my @cmd = @_; if (my $result = $CAPTURES->{"@cmd"}) { @@ -140,7 +141,10 @@ my @CAPS = compiler_command => 'g++ -xc++', linker_flags => '-lstdc++', }, - { "cc --version" => "cc (Debian 12.2.0-14) 12.2.0" }, + { + "cc --version" => "cc (Debian 12.2.0-14) 12.2.0", + "cc -dM -E -" => "#define __GNUC__ 4", + }, ], ); From 8cc395119a6d681fb7fc1d1fe55279de632f9c27 Mon Sep 17 00:00:00 2001 From: Arne Johannessen Date: Wed, 23 Apr 2025 13:56:52 +0200 Subject: [PATCH 2/2] fix test failure on macOS - #31 --- t/002_icpp.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/t/002_icpp.t b/t/002_icpp.t index dccaf50..627df95 100644 --- a/t/002_icpp.t +++ b/t/002_icpp.t @@ -93,7 +93,13 @@ my @METHODS = qw( compiler_command linker_flags ); -run_test(@$_) for @DATA; +for (@DATA) { + SKIP: { + skip 'gcc: provided by Clang on macOS' if $^O eq 'darwin' + && $_->[0]{cc} eq 'gcc' && ($_->[0]{config}{gccversion} || '') ne 'Clang'; + run_test(@$_); + } +} # mock some compiler output my $old_capture = \&ExtUtils::CppGuess::_capture;