Skip to content

Commit a0c0146

Browse files
committed
Re-organize multi-file tests a bit
- Put input files in directories named Inputs/ to eliminate bogus 'RUN: true' lines - Remove executable_test requirement since they're not executable
1 parent d53f25c commit a0c0146

File tree

31 files changed

+28
-79
lines changed

31 files changed

+28
-79
lines changed

test/multifile/class-layout/final-stored-property/library.swift renamed to test/multifile/class-layout/final-stored-property/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
final class Burger {
42
let onions: Bool = true
53
let cheeseSlices: Int = 0

test/multifile/class-layout/final-stored-property/main.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
// RUN: %target-build-swift %S/library.swift %S/main.swift
2-
// RUN: %target-build-swift -whole-module-optimization %S/library.swift %S/main.swift
3-
4-
// REQUIRES: executable_test
1+
// RUN: %target-build-swift %S/Inputs/library.swift %S/main.swift
2+
// RUN: %target-build-swift -whole-module-optimization %S/Inputs/library.swift %S/main.swift
53

64
func meltCheese(_ burger: Burger) -> Int {
75
return burger.cheeseSlices

test/multifile/constant-struct-with-padding/Other.swift renamed to test/multifile/constant-struct-with-padding/Inputs/other.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
struct t {
42
var a = false // (or e.g. var a: Int32 = 0)
53
var b = 0.0 // (or e.g. var b: Int64 = 0)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
22

3-
// RUN: %target-build-swift -O -whole-module-optimization %S/main.swift %S/Other.swift
3+
// RUN: %target-build-swift -O -whole-module-optimization %S/main.swift %S/Inputs/other.swift
44

55
print( g.a )
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
// RUN: true
2-
31
var g = (false, 0.0)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
22

3-
// RUN: %target-build-swift -O -whole-module-optimization %S/main.swift %S/Other.swift
3+
// RUN: %target-build-swift -O -whole-module-optimization %S/main.swift %S/Inputs/other.swift
44

55
print( g.0 )
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
public func go() throws {
42
throw AXError(0)
53
}

test/multifile/error-type/imported/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-build-swift -module-name objc_enum_errortype -emit-library %S/main.swift %S/library.swift -import-objc-header %S/objc_enum_errortype.h
1+
// RUN: %target-build-swift -module-name objc_enum_errortype -emit-library %S/main.swift %S/Inputs/library.swift -import-objc-header %S/Inputs/objc_enum_errortype.h
22

33
// REQUIRES: objc_interop
44

test/multifile/error-type/one-module/library.swift renamed to test/multifile/error-type/one-module/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
enum NuclearMeltdown {
42
case Critical
53
case Mild
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Try with and without whole module optimization
22

3-
// RUN: %target-build-swift %S/library.swift %S/main.swift
4-
// RUN: %target-build-swift -whole-module-optimization %S/library.swift %S/main.swift
5-
6-
// REQUIRES: executable_test
3+
// RUN: %target-build-swift %S/Inputs/library.swift %S/main.swift
4+
// RUN: %target-build-swift -whole-module-optimization %S/Inputs/library.swift %S/main.swift
75

86
extension NuclearMeltdown : Error {}

test/multifile/error-type/two-modules/library.swift renamed to test/multifile/error-type/two-modules/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
public enum NuclearMeltdown {
42
case Critical
53
case Mild

test/multifile/error-type/two-modules/main.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// RUN: %empty-directory(%t)
22

33
// RUN: %empty-directory(%t/linker)
4-
// RUN: %target-build-swift -emit-module -c %S/library.swift -o %t/linker/library.o
5-
// RUN: %target-build-swift -emit-library -c %S/library.swift -o %t/linker/library.o
4+
// RUN: %target-build-swift -emit-module -c %S/Inputs/library.swift -o %t/linker/library.o
5+
// RUN: %target-build-swift -emit-library -c %S/Inputs/library.swift -o %t/linker/library.o
66
// RUN: %target-build-swift %S/main.swift %t/linker/library.o -I %t/linker/ -L %t/linker/ -o %t/linker/main
77

8-
// REQUIRES: executable_test
9-
108
import library
119

1210
extension NuclearMeltdown : Error {}

test/multifile/extensions/two-modules/library.swift renamed to test/multifile/extensions/two-modules/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
public struct Point {
42
public let x: Int
53
public let y: Int

test/multifile/extensions/two-modules/main.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
// RUN: %empty-directory(%t)
22

33
// RUN: mkdir -p %t/onone %t/wmo
4-
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -module-name=library -emit-library %S/library.swift -o %t/onone/library.%target-dylib-extension
4+
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -module-name=library -emit-library %S/Inputs/library.swift -o %t/onone/library.%target-dylib-extension
55
// RUN: %target-build-swift %S/main.swift %t/onone/library.%target-dylib-extension -I %t/onone/ -o %t/onone/main
66

7-
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -module-name=library -emit-library -O -wmo %S/library.swift -o %t/wmo/library.%target-dylib-extension
7+
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -module-name=library -emit-library -O -wmo %S/Inputs/library.swift -o %t/wmo/library.%target-dylib-extension
88
// RUN: %target-build-swift %S/main.swift %t/wmo/library.%target-dylib-extension -I %t/wmo/ -o %t/wmo/main
99

10-
// REQUIRES: executable_test
11-
1210
import library
1311

1412
extension Point {

test/multifile/imported-conformance/option-set/library.swift renamed to test/multifile/imported-conformance/option-set/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
import Foundation
42

53
@inline(__always)

test/multifile/imported-conformance/option-set/main.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// RUN: %empty-directory(%t)
22

33
// RUN: %empty-directory(%t/linker)
4-
// RUN: %target-build-swift -emit-module -emit-library %S/library.swift -o %t/linker/liblibrary.%target-dylib-extension -emit-module-path %t/linker/library.swiftmodule -module-name library
4+
// RUN: %target-build-swift -emit-module -emit-library %S/Inputs/library.swift -o %t/linker/liblibrary.%target-dylib-extension -emit-module-path %t/linker/library.swiftmodule -module-name library
55
// RUN: %target-build-swift %S/main.swift -I %t/linker/ -L %t/linker/ -llibrary -o %t/linker/main
66

7-
// REQUIRES: executable_test
87
// REQUIRES: objc_interop
98

109
import Foundation

test/multifile/synthesized-accessors/one-module-imported/library.swift renamed to test/multifile/synthesized-accessors/one-module-imported/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
import CoreGraphics
42

53
// Case 1 - witness is imported accessor

test/multifile/synthesized-accessors/one-module-imported/main.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Try with and without whole module optimization
22

3-
// RUN: %target-build-swift %S/library.swift %S/main.swift
4-
// RUN: %target-build-swift -whole-module-optimization %S/library.swift %S/main.swift
3+
// RUN: %target-build-swift %S/Inputs/library.swift %S/main.swift
4+
// RUN: %target-build-swift -whole-module-optimization %S/Inputs/library.swift %S/main.swift
55

6-
// REQUIRES: executable_test
76
// REQUIRES: objc_interop
87

98
import CoreGraphics

test/multifile/synthesized-accessors/one-module-internal/library.swift renamed to test/multifile/synthesized-accessors/one-module-internal/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
struct FishAndChips {
42
var costPounds: Float
53
var costEuros: Float {

test/multifile/synthesized-accessors/one-module-internal/main.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Try with and without whole module optimization
22

3-
// RUN: %target-build-swift %S/library.swift %S/main.swift
4-
// RUN: %target-build-swift -whole-module-optimization %S/library.swift %S/main.swift
5-
6-
// REQUIRES: executable_test
3+
// RUN: %target-build-swift %S/Inputs/library.swift %S/main.swift
4+
// RUN: %target-build-swift -whole-module-optimization %S/Inputs/library.swift %S/main.swift
75

86
protocol Takeaway {
97
var costPounds: Float { get set }

test/multifile/synthesized-accessors/one-module-public/library.swift renamed to test/multifile/synthesized-accessors/one-module-public/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
public struct FishAndChips {
42
public var costPounds: Float
53
public var costEuros: Float {

test/multifile/synthesized-accessors/one-module-public/main.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Try with and without whole module optimization
22

3-
// RUN: %target-build-swift %S/library.swift %S/main.swift
4-
// RUN: %target-build-swift -whole-module-optimization %S/library.swift %S/main.swift
5-
6-
// REQUIRES: executable_test
3+
// RUN: %target-build-swift %S/Inputs/library.swift %S/main.swift
4+
// RUN: %target-build-swift -whole-module-optimization %S/Inputs/library.swift %S/main.swift
75

86
protocol Takeaway {
97
var costPounds: Float { get set }

test/multifile/synthesized-accessors/two-modules-imported/library.swift renamed to test/multifile/synthesized-accessors/two-modules-imported/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
import CoreGraphics
42

53
public protocol OtherPoint {

test/multifile/synthesized-accessors/two-modules-imported/main.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Try with and without whole module optimization
22

3-
// RUN: %target-build-swift %S/library.swift %S/main.swift
4-
// RUN: %target-build-swift -whole-module-optimization %S/library.swift %S/main.swift
3+
// RUN: %target-build-swift %S/Inputs/library.swift %S/main.swift
4+
// RUN: %target-build-swift -whole-module-optimization %S/Inputs/library.swift %S/main.swift
55

6-
// REQUIRES: executable_test
76
// REQUIRES: objc_interop
87

98
import CoreGraphics

test/multifile/synthesized-accessors/two-modules/library.swift renamed to test/multifile/synthesized-accessors/two-modules/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
#if _runtime(_ObjC)
42
import Foundation
53
#endif

test/multifile/synthesized-accessors/two-modules/main.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
// RUN: %empty-directory(%t)
22

33
// RUN: mkdir -p %t/onone %t/wmo
4-
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -module-name=library -emit-library %S/library.swift -o %t/onone/library.%target-dylib-extension
4+
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -module-name=library -emit-library %S/Inputs/library.swift -o %t/onone/library.%target-dylib-extension
55
// RUN: %target-build-swift %S/main.swift %t/onone/library.%target-dylib-extension -I %t/onone/ -o %t/onone/main
66

7-
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -module-name=library -emit-library -O -wmo %S/library.swift -o %t/wmo/library.%target-dylib-extension
7+
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -module-name=library -emit-library -O -wmo %S/Inputs/library.swift -o %t/wmo/library.%target-dylib-extension
88
// RUN: %target-build-swift %S/main.swift %t/wmo/library.%target-dylib-extension -I %t/wmo/ -o %t/wmo/main
99

10-
// REQUIRES: executable_test
11-
1210
import library
1311

1412
protocol Takeaway {

test/multifile/typealias/one-module/library.swift renamed to test/multifile/typealias/one-module/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
public enum Result<T, U>
42
{
53
case success(T)
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// RUN: %empty-directory(%t)
22

3-
// RUN: %target-build-swift %S/main.swift %S/library.swift
4-
// RUN: %target-build-swift -g %S/main.swift %S/library.swift
5-
6-
// REQUIRES: executable_test
3+
// RUN: %target-build-swift %S/main.swift %S/Inputs/library.swift
4+
// RUN: %target-build-swift -g %S/main.swift %S/Inputs/library.swift
75

86
func testFunction<T>(withCompletion completion: (Result<T, Error>) -> Void) { }
97
testFunction { (result: GenericResult<Int>) in }

test/multifile/typealias/two-modules/library.swift renamed to test/multifile/typealias/two-modules/Inputs/library.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// RUN: true
2-
31
public enum Result<T, U>
42
{
53
case success(T)

test/multifile/typealias/two-modules/main.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
// RUN: %empty-directory(%t)
22

33
// RUN: %empty-directory(%t/linker)
4-
// RUN: %target-build-swift -emit-module -c %S/library.swift -o %t/linker/library.o
5-
// RUN: %target-build-swift -emit-library -c %S/library.swift -o %t/linker/library.o
4+
// RUN: %target-build-swift -emit-module -c %S/Inputs/library.swift -o %t/linker/library.o
5+
// RUN: %target-build-swift -emit-library -c %S/Inputs/library.swift -o %t/linker/library.o
66
// RUN: %target-build-swift %S/main.swift %t/linker/library.o -I %t/linker/ -L %t/linker/ -o %t/linker/main
77

8-
// RUN: %target-build-swift -g -emit-module -c %S/library.swift -o %t/linker/library.o
9-
// RUN: %target-build-swift -g -emit-library -c %S/library.swift -o %t/linker/library.o
8+
// RUN: %target-build-swift -g -emit-module -c %S/Inputs/library.swift -o %t/linker/library.o
9+
// RUN: %target-build-swift -g -emit-library -c %S/Inputs/library.swift -o %t/linker/library.o
1010
// RUN: %target-build-swift -g %S/main.swift %t/linker/library.o -I %t/linker/ -L %t/linker/ -o %t/linker/main
1111

12-
// REQUIRES: executable_test
13-
1412
import library
1513

1614
func testFunction<T>(withCompletion completion: (Result<T, Error>) -> Void) { }

0 commit comments

Comments
 (0)