Skip to content

Commit 04915c4

Browse files
committed
[test] Adjust tests for OS X's "System Integrity Protection".
test/Driver/environment.swift is trying to test that the driver can set environment variables that the frontend will use, but the only environment variables we set are ones that are blocked by OS X's "System Integrity Protection" feature when invoking a restricted binary---such as /bin/sh. We could compile a tiny app that calls getenv, but that's a bit heavy for this test. Instead, just limit it to non-OS-X hosts. test/Driver/options-interpreter.swift is testing the effect of the /user/ setting the same sensitive environment variables. In this case, we want to make sure we're calling the Swift driver directly so that we don't run afoul of the same limitations environment.swift was seeing. Fixes rdar://problem/23771412 (which is just about re-enabling these tests).
1 parent e6d1d97 commit 04915c4

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

test/Driver/environment.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// FIXME: This is failing on some of Apple's internal CI.
2-
// FIXME: <rdar://problem/23771412> Fix test/Driver/{environment.swift,options-interpreter.swift}
3-
// REQUIRES: disabled
1+
// UNSUPPORTED: objc_interop
2+
// Apple's "System Integrity Protection" makes this test fail on OS X.
43

5-
// RUN: %swift_driver -target x86_64-apple-macosx10.9 -L/foo/ -driver-use-frontend-path %S/Inputs/print-var.sh %s DYLD_LIBRARY_PATH | FileCheck %s
6-
// CHECK: {{^/foo/:[^:]+/lib/swift/macosx$}}
4+
// RUN: %swift_driver -target x86_64-unknown-gnu-linux -L/foo/ -driver-use-frontend-path %S/Inputs/print-var.sh %s LD_LIBRARY_PATH | FileCheck %s
5+
// CHECK: {{^/foo/:[^:]+/lib/swift/linux$}}

test/Driver/options-interpreter.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// FIXME: This is failing on some of Apple's internal CI.
2-
// FIXME: <rdar://problem/23771412> Fix test/Driver/{environment.swift,options-interpreter.swift}
3-
// REQUIRES: disabled
4-
51
// RUN: not %swift_driver -deprecated-integrated-repl -emit-module 2>&1 | FileCheck -check-prefix=IMMEDIATE_NO_MODULE %s
62
// RUN: not %swift_driver -emit-module 2>&1 | FileCheck -check-prefix=IMMEDIATE_NO_MODULE %s
73
// REQUIRES: swift_interpreter
@@ -30,11 +26,11 @@
3026
// RUN: %swift_driver -### -target x86_64-apple-macosx10.9 -L/foo/ -L/bar/ %s | FileCheck -check-prefix=CHECK-L2 %s
3127
// CHECK-L2: # DYLD_LIBRARY_PATH={{/foo/:/bar/:[^:]+/lib/swift/macosx$}}
3228

33-
// RUN: env DYLD_LIBRARY_PATH=/abc/ %swift_driver -### -target x86_64-apple-macosx10.9 -L/foo/ -L/bar/ %s | FileCheck -check-prefix=CHECK-L2-ENV %s
29+
// RUN: env DYLD_LIBRARY_PATH=/abc/ %swift_driver_plain -### -target x86_64-apple-macosx10.9 -L/foo/ -L/bar/ %s | FileCheck -check-prefix=CHECK-L2-ENV %s
3430
// CHECK-L2-ENV: # DYLD_LIBRARY_PATH={{/foo/:/bar/:[^:]+/lib/swift/macosx:/abc/$}}
3531

3632
// RUN: %swift_driver -### -target x86_64-apple-macosx10.9 %s | FileCheck -check-prefix=CHECK-NO-FRAMEWORKS %s
37-
// RUN: env DYLD_FRAMEWORK_PATH=/abc/ %swift_driver -### -target x86_64-apple-macosx10.9 %s | FileCheck -check-prefix=CHECK-NO-FRAMEWORKS %s
33+
// RUN: env DYLD_FRAMEWORK_PATH=/abc/ %swift_driver_plain -### -target x86_64-apple-macosx10.9 %s | FileCheck -check-prefix=CHECK-NO-FRAMEWORKS %s
3834
// CHECK-NO-FRAMEWORKS-NOT: DYLD_FRAMEWORK_PATH
3935

4036
// RUN: %swift_driver -### -target x86_64-apple-macosx10.9 -F/foo/ %s | FileCheck -check-prefix=CHECK-F %s
@@ -48,13 +44,13 @@
4844
// CHECK-F2: #
4945
// CHECK-F2: DYLD_FRAMEWORK_PATH=/foo/:/bar/{{$}}
5046

51-
// RUN: env DYLD_FRAMEWORK_PATH=/abc/ %swift_driver -### -target x86_64-apple-macosx10.9 -F/foo/ -F/bar/ %s | FileCheck -check-prefix=CHECK-F2-ENV %s
47+
// RUN: env DYLD_FRAMEWORK_PATH=/abc/ %swift_driver_plain -### -target x86_64-apple-macosx10.9 -F/foo/ -F/bar/ %s | FileCheck -check-prefix=CHECK-F2-ENV %s
5248
// CHECK-F2-ENV: -F /foo/
5349
// CHECK-F2-ENV: -F /bar/
5450
// CHECK-F2-ENV: #
5551
// CHECK-F2-ENV: DYLD_FRAMEWORK_PATH=/foo/:/bar/:/abc/{{$}}
5652

57-
// RUN: env DYLD_FRAMEWORK_PATH=/abc/ %swift_driver -### -target x86_64-apple-macosx10.9 -F/foo/ -F/bar/ -L/foo2/ -L/bar2/ %s | FileCheck -check-prefix=CHECK-COMPLEX %s
53+
// RUN: env DYLD_FRAMEWORK_PATH=/abc/ %swift_driver_plain -### -target x86_64-apple-macosx10.9 -F/foo/ -F/bar/ -L/foo2/ -L/bar2/ %s | FileCheck -check-prefix=CHECK-COMPLEX %s
5854
// CHECK-COMPLEX: -F /foo/
5955
// CHECK-COMPLEX: -F /bar/
6056
// CHECK-COMPLEX: #
@@ -64,5 +60,5 @@
6460
// RUN: %swift_driver -### -target x86_64-unknown-linux-gnu -L/foo/ %s | FileCheck -check-prefix=CHECK-L-LINUX %s
6561
// CHECK-L-LINUX: # LD_LIBRARY_PATH={{/foo/:[^:]+/lib/swift/linux$}}
6662

67-
// RUN: env LD_LIBRARY_PATH=/abc/ %swift_driver -### -target x86_64-unknown-linux-gnu -L/foo/ -L/bar/ %s | FileCheck -check-prefix=CHECK-LINUX-COMPLEX %s
63+
// RUN: env LD_LIBRARY_PATH=/abc/ %swift_driver_plain -### -target x86_64-unknown-linux-gnu -L/foo/ -L/bar/ %s | FileCheck -check-prefix=CHECK-LINUX-COMPLEX %s
6864
// CHECK-LINUX-COMPLEX: # LD_LIBRARY_PATH={{/foo/:/bar/:[^:]+/lib/swift/linux:/abc/$}}

0 commit comments

Comments
 (0)