Skip to content

Commit

Permalink
Testsuite: Account for macOS 15 cpp file path changes
Browse files Browse the repository at this point in the history
And add a procedure for getting the macOS version, which could be used
to look for specifically for the behavior of macOS 15 versus earlier
versions, but decided just to use a wildcard for the directory
  • Loading branch information
quark17 committed Nov 2, 2024
1 parent 7e80e1a commit 9b157d1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions testsuite/bsc.driver/cpp/cpp.exp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ compile_fail_error Cpreprocess1.bsv P0210
#multiple error messages, and it should not get confused about which
#file we are in and what line we are on.
compile_fail Cpreprocess_line.bsv -cpp
# macOS preprocessor prepends './' to included file names
# macOS preprocessor prepends './' to included file names for macOS 14 and earlier
# and uses absolute path for macOS 15
if { [which_os] == "Darwin" } {
sed Cpreprocess_line.bsv.bsc-out \
Cpreprocess_line.bsv.bsc-out.filtered \
{} {-e {s/".\/more.bsv"/"more.bsv"/g}}
{} {-e {s/".*\/more.bsv"/"more.bsv"/g}}
move Cpreprocess_line.bsv.bsc-out.filtered \
Cpreprocess_line.bsv.bsc-out
}
Expand Down
12 changes: 12 additions & 0 deletions testsuite/config/unix.exp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,18 @@ proc which_mach {} {
return $env(MACHTYPE)
}

proc which_macos {} {
if { [catch "exec sw_vers -productVersion | cut -d '.' -f 1" version] } {
perror "failed to execute sw_vers to get macOS version: $version"
exit 1
}
if { $version == "" } {
perror "macOS version is empty"
exit 1
}
return $version
}

# return true if the given Bluetcl packahe is available
proc bluetcl_package_available { pkg } {
global bluetcl
Expand Down

0 comments on commit 9b157d1

Please sign in to comment.