Skip to content

Commit

Permalink
porting/cpphdrcheck.t: test perl's headers with C++ compilers
Browse files Browse the repository at this point in the history
This searches for a C++ compiler based on the supplied C compiler, and
checks that compiler for any options controlling the C++ standard
requested, including simple checks that the compiler supports that
standard.

If a C++ compiler is found, test compilation of the same simple code
as above but with the perl headers included after any C++ headers.

Ideally we'd also test runtime, but would require more complex test
code, which I leave to later contributors (which may still be me).

Tested at various times with:

 - MSVC
 - gcc
 - clang
 - Oracle/Sun Development Workshop cc (CC is the C++ compiler), on
   Oracle Linux
 - Intel oneAPI compiler (llvm based apparently, and now free to use)
 - Intel classic compiler (discontinued)

Currently this probes the compiler for C++ sanity with the perl
ccflags, since icc (Intel classic) would successfully build the sample
without perl's ccflags, but then fail with both the headers and perl's
ccflags.  It turned out to fail with just the ccflags, and since the
primary intent is to test the headers, I probe *with* ccflags.

The Sun Workshop compiler failed to build the C++11 or 14 sample at
all in my testing, which may have been due to an installation problem.
  • Loading branch information
tonycoz committed Jul 17, 2024
1 parent 53a9c8d commit 2d61a8e
Show file tree
Hide file tree
Showing 2 changed files with 577 additions and 0 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -6494,6 +6494,7 @@ t/porting/checkcfgvar.t Check that all config.sh-like files are good
t/porting/cmp_version.t Test whether all changed module files have their VERSION bumped
t/porting/copyright.t Check that copyright years match
t/porting/corelist.t Check that Module-CoreList has perl versions for the current perl
t/porting/cpphdrcheck.t Test headers on the C++ variant of $Config{cc}
t/porting/customized.dat Data file for porting/customized.t
t/porting/customized.t Check all CUSTOMIZED files are as they should be
t/porting/deprecation.t Test that deprecation warnings are handled right
Expand Down
Loading

0 comments on commit 2d61a8e

Please sign in to comment.