Skip to content

Fix Unicode Tests on Windows #23040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/Driver/Inputs/unicode-filenames.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
𝔼-file-01.swift 😂-file-02.swift Ω-file-03.swift
1 change: 1 addition & 0 deletions test/Driver/Inputs/unicode.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
你好.swift
24 changes: 21 additions & 3 deletions test/Driver/batch_mode_with_supplementary_filelist_unicode.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
// RUN: %empty-directory(%t)
// RUN: echo 'print("Hello, World!")' >%t/main.swift
// RUN: touch %t/𝔼-file-01.swift %t/😂-file-02.swift %t/Ω-file-03.swift
// RUN: echo "" > %t/𝔼-file-01.swift
// RUN: echo "" > %t/😂-file-02.swift
// RUN: echo "" > %t/Ω-file-03.swift
//
// If the supplementary output file map does not escape the characters in the
// source files, the frontend won't recognize the desired outputs.
//
// 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
// 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
// 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
//
// All these files should exist and should successfully be deleted
// RUN: rm main.d
// RUN: rm main.dia
// RUN: rm main.o
// RUN: rm Ω-file-03.d
// RUN: rm Ω-file-03.dia
// RUN: rm Ω-file-03.o
// RUN: rm Ω-file-03.swift
// RUN: rm 𝔼-file-01.d
// RUN: rm 𝔼-file-01.dia
// RUN: rm 𝔼-file-01.o
// RUN: rm 𝔼-file-01.swift
// RUN: rm 😂-file-02.d
// RUN: rm 😂-file-02.dia
// RUN: rm 😂-file-02.o
// RUN: rm 😂-file-02.swift
14 changes: 8 additions & 6 deletions test/Driver/parseable_output_unicode.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// 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
// RUN: echo -n "%S/Inputs/" > %t.rsp
// RUN: cat "%S/Inputs/unicode.txt" >> %t.rsp
// 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

// XFAIL: freebsd, linux

Expand Down Expand Up @@ -63,8 +65,8 @@
// CHECK-NEXT: {
// CHECK-NEXT: "kind": "began",
// CHECK-NEXT: "name": "merge-module",
// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?}} -frontend -merge-modules -emit-module {{.*[\\/]}}你好-[[OUTPUT]].swiftmodule {{.*}} -o {{.*[\\/]}}parseable_output_unicode.swift.tmp.swiftmodule",
// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?}}",
// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?(\.EXE)?(\\")?}} -frontend -merge-modules -emit-module {{.*[\\/]}}你好-[[OUTPUT]].swiftmodule{{(\\")?}} {{.*}} -o {{.*[\\/]}}parseable_output_unicode.swift.tmp.swiftmodule{{(\\")?}}",
// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.EXE)?(\\")?}}",
// CHECK-NEXT: "command_arguments": [
// CHECK-NEXT: "-frontend",
// CHECK-NEXT: "-merge-modules",
Expand Down Expand Up @@ -112,10 +114,10 @@
// CHECK-NEXT: {
// CHECK-NEXT: "kind": "began",
// CHECK-NEXT: "name": "link",
// CHECK-NEXT: "command": "{{.*[\\/]}}ld{{(\\")?}} {{.*[\\/]}}你好-[[OUTPUT]].o {{.*}} -o {{.*[\\/]}}parseable_output_unicode.swift.tmp.out",
// CHECK-NEXT: "command_executable": "{{.*[\\/]}}ld{{(\\")?}}",
// CHECK-NEXT: "command": "{{.*[\\/](ld|clang\+\+.exe)(\\")?}} {{.*[\\/]}}你好-[[OUTPUT]].o{{(\\")?}}{{.*}}-o {{.*[\\/]}}parseable_output_unicode.swift.tmp.out{{(\\")?}}",
// CHECK-NEXT: "command_executable": "{{.*[\\/](ld|clang\+\+.exe)(\\")?}}",
// CHECK-NEXT: "command_arguments": [
// CHECK-NEXT: "{{.*[\\/]}}你好-[[OUTPUT]].o",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed here such that this is no longer the next line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It passes -target which comes first.

// CHECK: "{{.*[\\/]}}你好-[[OUTPUT]].o",
// CHECK: "-o",
// CHECK-NEXT: "{{.*[\\/]}}parseable_output_unicode.swift.tmp.out"
// CHECK-NEXT: ],
Expand Down
1 change: 1 addition & 0 deletions test/stdlib/Inputs/Unicode.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-module-name="日本語01"
2 changes: 1 addition & 1 deletion test/stdlib/UnicodeMetadata.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-build-swift -module-name="日本語01" %s -o %t.out
// RUN: %target-build-swift "@%/S/Inputs/Unicode.rsp" %s -o %t.out
// RUN: %target-codesign %t.out
// RUN: %target-run %t.out | %FileCheck %s
// REQUIRES: executable_test
Expand Down