Skip to content

Commit d12e942

Browse files
authored
Merge pull request #23040 from jmittert/Use-The-Force-Luke-16
Fix Unicode Tests on Windows
2 parents fbd7949 + 16dc909 commit d12e942

File tree

6 files changed

+33
-10
lines changed

6 files changed

+33
-10
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
𝔼-file-01.swift 😂-file-02.swift Ω-file-03.swift

test/Driver/Inputs/unicode.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
你好.swift
Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
// RUN: %empty-directory(%t)
22
// RUN: echo 'print("Hello, World!")' >%t/main.swift
3-
// RUN: touch %t/𝔼-file-01.swift %t/😂-file-02.swift %t/Ω-file-03.swift
3+
// RUN: echo "" > %t/𝔼-file-01.swift
4+
// RUN: echo "" > %t/😂-file-02.swift
5+
// RUN: echo "" > %t/Ω-file-03.swift
46
//
57
// If the supplementary output file map does not escape the characters in the
68
// source files, the frontend won't recognize the desired outputs.
79
//
8-
// RUN: cd %t && %target-build-swift -c -emit-dependencies -serialize-diagnostics -driver-filelist-threshold=0 -j2 main.swift 𝔼-file-01.swift 😂-file-02.swift Ω-file-03.swift -module-name mod
9-
// RUN: cd %t && test -e 😂-file-02.d -a -e 😂-file-02.dia -a -e 😂-file-02.o -a -e 😂-file-02.swift -a -e 𝔼-file-01.d -a -e 𝔼-file-01.dia -a -e 𝔼-file-01.o -a -e 𝔼-file-01.swift -a -e main.d -a -e main.dia -a -e Ω-file-03.d -a -e Ω-file-03.dia -a -e Ω-file-03.o -a -e Ω-file-03.swift
10+
// RUN: cd %t && %target-build-swift -c -emit-dependencies -serialize-diagnostics -driver-filelist-threshold=0 -j2 main.swift @%S/Inputs/unicode-filenames.rsp -module-name mod
11+
//
12+
// All these files should exist and should successfully be deleted
13+
// RUN: rm main.d
14+
// RUN: rm main.dia
15+
// RUN: rm main.o
16+
// RUN: rm Ω-file-03.d
17+
// RUN: rm Ω-file-03.dia
18+
// RUN: rm Ω-file-03.o
19+
// RUN: rm Ω-file-03.swift
20+
// RUN: rm 𝔼-file-01.d
21+
// RUN: rm 𝔼-file-01.dia
22+
// RUN: rm 𝔼-file-01.o
23+
// RUN: rm 𝔼-file-01.swift
24+
// RUN: rm 😂-file-02.d
25+
// RUN: rm 😂-file-02.dia
26+
// RUN: rm 😂-file-02.o
27+
// RUN: rm 😂-file-02.swift

test/Driver/parseable_output_unicode.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// RUN: %swiftc_driver_plain -emit-executable "%S/Inputs/你好.swift" -o %t.out -emit-module -emit-module-path %t.swiftmodule -emit-objc-header-path %t.h -serialize-diagnostics -emit-dependencies -parseable-output -driver-skip-execution 2>&1 | %FileCheck %s
1+
// RUN: echo -n "%S/Inputs/" > %t.rsp
2+
// RUN: cat "%S/Inputs/unicode.txt" >> %t.rsp
3+
// RUN: %swiftc_driver_plain -emit-executable @%t.rsp -o %t.out -emit-module -emit-module-path %t.swiftmodule -emit-objc-header-path %t.h -serialize-diagnostics -emit-dependencies -parseable-output -driver-skip-execution 2>&1 | %FileCheck %s
24

35
// XFAIL: freebsd, linux
46

@@ -63,8 +65,8 @@
6365
// CHECK-NEXT: {
6466
// CHECK-NEXT: "kind": "began",
6567
// CHECK-NEXT: "name": "merge-module",
66-
// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?}} -frontend -merge-modules -emit-module {{.*[\\/]}}你好-[[OUTPUT]].swiftmodule {{.*}} -o {{.*[\\/]}}parseable_output_unicode.swift.tmp.swiftmodule",
67-
// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?}}",
68+
// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?(\.EXE)?(\\")?}} -frontend -merge-modules -emit-module {{.*[\\/]}}你好-[[OUTPUT]].swiftmodule{{(\\")?}} {{.*}} -o {{.*[\\/]}}parseable_output_unicode.swift.tmp.swiftmodule{{(\\")?}}",
69+
// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.EXE)?(\\")?}}",
6870
// CHECK-NEXT: "command_arguments": [
6971
// CHECK-NEXT: "-frontend",
7072
// CHECK-NEXT: "-merge-modules",
@@ -112,10 +114,10 @@
112114
// CHECK-NEXT: {
113115
// CHECK-NEXT: "kind": "began",
114116
// CHECK-NEXT: "name": "link",
115-
// CHECK-NEXT: "command": "{{.*[\\/]}}ld{{(\\")?}} {{.*[\\/]}}你好-[[OUTPUT]].o {{.*}} -o {{.*[\\/]}}parseable_output_unicode.swift.tmp.out",
116-
// CHECK-NEXT: "command_executable": "{{.*[\\/]}}ld{{(\\")?}}",
117+
// CHECK-NEXT: "command": "{{.*[\\/](ld|clang\+\+.exe)(\\")?}} {{.*[\\/]}}你好-[[OUTPUT]].o{{(\\")?}}{{.*}}-o {{.*[\\/]}}parseable_output_unicode.swift.tmp.out{{(\\")?}}",
118+
// CHECK-NEXT: "command_executable": "{{.*[\\/](ld|clang\+\+.exe)(\\")?}}",
117119
// CHECK-NEXT: "command_arguments": [
118-
// CHECK-NEXT: "{{.*[\\/]}}你好-[[OUTPUT]].o",
120+
// CHECK: "{{.*[\\/]}}你好-[[OUTPUT]].o",
119121
// CHECK: "-o",
120122
// CHECK-NEXT: "{{.*[\\/]}}parseable_output_unicode.swift.tmp.out"
121123
// CHECK-NEXT: ],

test/stdlib/Inputs/Unicode.rsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-module-name="日本語01"

test/stdlib/UnicodeMetadata.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="日本語01" %s -o %t.out
1+
// RUN: %target-build-swift "@%/S/Inputs/Unicode.rsp" %s -o %t.out
22
// RUN: %target-codesign %t.out
33
// RUN: %target-run %t.out | %FileCheck %s
44
// REQUIRES: executable_test

0 commit comments

Comments
 (0)