Skip to content

Commit 1aa50d9

Browse files
committed
Testsuite: Account for macOS 15 cpp file path changes
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
1 parent 371ac54 commit 1aa50d9

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

testsuite/bsc.driver/cpp/cpp.exp

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ compile_fail_error Cpreprocess1.bsv P0210
99
#multiple error messages, and it should not get confused about which
1010
#file we are in and what line we are on.
1111
compile_fail Cpreprocess_line.bsv -cpp
12-
# macOS preprocessor prepends './' to included file names
12+
# macOS preprocessor prepends './' to included file names for macOS 14 and earlier
13+
# and uses absolute path for macOS 15
1314
if { [which_os] == "Darwin" } {
1415
sed Cpreprocess_line.bsv.bsc-out \
1516
Cpreprocess_line.bsv.bsc-out.filtered \
16-
{} {-e {s/".\/more.bsv"/"more.bsv"/g}}
17+
{} {-e {s/".*\/more.bsv"/"more.bsv"/g}}
1718
move Cpreprocess_line.bsv.bsc-out.filtered \
1819
Cpreprocess_line.bsv.bsc-out
1920
}

testsuite/config/unix.exp

+12
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,18 @@ proc which_mach {} {
209209
return $env(MACHTYPE)
210210
}
211211

212+
proc which_macos {} {
213+
if { [catch "exec sw_vers -productVersion | cut -d '.' -f 1" version] } {
214+
perror "failed to execute sw_vers to get macOS version: $version"
215+
exit 1
216+
}
217+
if { $version == "" } {
218+
perror "macOS version is empty"
219+
exit 1
220+
}
221+
return $version
222+
}
223+
212224
# return true if the given Bluetcl packahe is available
213225
proc bluetcl_package_available { pkg } {
214226
global bluetcl

0 commit comments

Comments
 (0)