@@ -20,13 +20,15 @@ final class LLBuildManifestTests: XCTestCase {
20
20
func testBasics( ) throws {
21
21
var manifest = BuildManifest ( )
22
22
23
+ let root : AbsolutePath = AbsolutePath ( " /some " )
24
+
23
25
manifest. defaultTarget = " main "
24
26
manifest. addPhonyCmd (
25
27
name: " C.Foo " ,
26
28
inputs: [
27
- . file( AbsolutePath ( " /some/ file.c" ) ) ,
28
- . directory( AbsolutePath ( " /some/ dir" ) ) ,
29
- . directoryStructure( AbsolutePath ( " /some/ dir/ structure" ) ) ,
29
+ . file( root . appending ( components : " file.c " ) ) ,
30
+ . directory( root . appending ( components : " dir " ) ) ,
31
+ . directoryStructure( root . appending ( components : " dir " , " structure " ) ) ,
30
32
] ,
31
33
outputs: [ . virtual( " Foo " ) ]
32
34
)
@@ -38,20 +40,22 @@ final class LLBuildManifestTests: XCTestCase {
38
40
39
41
let contents : String = try fs. readFileContents ( AbsolutePath ( " /manifest.yaml " ) )
40
42
41
- XCTAssertEqual ( contents, """
43
+ // FIXME(#5475) - use the platform's preferred separator for directory
44
+ // indicators
45
+ XCTAssertEqual ( contents. replacingOccurrences ( of: " \\ \\ " , with: " \\ " ) , """
42
46
client:
43
47
name: basic
44
48
tools: {}
45
49
targets:
46
50
" main " : [ " <Foo> " ]
47
51
default: " main "
48
52
nodes:
49
- " /some/ dir/ structure/" :
53
+ " \( root . appending ( components : " dir " , " structure " ) ) / " :
50
54
is-directory-structure: true
51
55
commands:
52
56
" C.Foo " :
53
57
tool: phony
54
- inputs: [ " /some/ file.c" , " /some/ dir/" , " /some/ dir/ structure/" ]
58
+ inputs: [ " \( root . appending ( components : " file.c " ) ) " , " \( root . appending ( components : " dir " ) ) / " , " \( root . appending ( components : " dir " , " structure " ) ) / " ]
55
59
outputs: [ " <Foo> " ]
56
60
57
61
@@ -61,15 +65,17 @@ final class LLBuildManifestTests: XCTestCase {
61
65
func testShellCommands( ) throws {
62
66
var manifest = BuildManifest ( )
63
67
68
+ let root : AbsolutePath = AbsolutePath . root
69
+
64
70
manifest. defaultTarget = " main "
65
71
manifest. addShellCmd (
66
72
name: " shelley " ,
67
73
description: " Shelley, Keats, and Byron " ,
68
74
inputs: [
69
- . file( AbsolutePath ( " / file.in] " ) )
75
+ . file( root . appending ( components : " file.in " ) )
70
76
] ,
71
77
outputs: [
72
- . file( AbsolutePath ( " / file.out" ) )
78
+ . file( root . appending ( components : " file.out " ) )
73
79
] ,
74
80
arguments: [
75
81
" foo " , " bar " , " baz "
@@ -89,18 +95,18 @@ final class LLBuildManifestTests: XCTestCase {
89
95
90
96
let contents : String = try fs. readFileContents ( AbsolutePath ( " /manifest.yaml " ) )
91
97
92
- XCTAssertEqual ( contents, """
98
+ XCTAssertEqual ( contents. replacingOccurrences ( of : " \\ \\ " , with : " \\ " ) , """
93
99
client:
94
100
name: basic
95
101
tools: {}
96
102
targets:
97
- " main " : [ " / file.out" ]
103
+ " main " : [ " \( root . appending ( components : " file.out " ) ) " ]
98
104
default: " main "
99
105
commands:
100
106
" shelley " :
101
107
tool: shell
102
- inputs: [ " / file.in] " ]
103
- outputs: [ " / file.out" ]
108
+ inputs: [ " \( root . appending ( components : " file.in " ) ) " ]
109
+ outputs: [ " \( root . appending ( components : " file.out " ) ) " ]
104
110
description: " Shelley, Keats, and Byron "
105
111
args: [ " foo " , " bar " , " baz " ]
106
112
env:
0 commit comments