File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 1
- // %s expands to an absolute path, so to test relative paths we need to create a
2
- // clean directory, put the source there, and cd into it.
1
+ // To make sure this test is resilient to directory changes, we create nested directories inside of the
2
+ // temporary test directory and assert those exist, or don't exist, in the emitted ir
3
+ //
3
4
// RUN: rm -rf %t
4
- // RUN: mkdir -p %t/foo/bar/baz
5
- // RUN: echo "func coverage() {}" > %t/foo/bar/baz /coverage_relative_path.swift
6
- // RUN: cd %t/foo/bar
5
+ // RUN: mkdir -p %t/root/nested
6
+ // RUN: echo "func coverage() {}" > %t/root/nested /coverage_relative_path.swift
7
+ // RUN: cd %t/root
7
8
8
- // RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -Xllvm -enable-name-compression=false -emit-ir %/t/foo/bar/baz /coverage_relative_path.swift | %FileCheck -check-prefix=ABSOLUTE %s
9
+ // RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -Xllvm -enable-name-compression=false -emit-ir nested /coverage_relative_path.swift | %FileCheck -check-prefix=ABSOLUTE %s
9
10
//
10
- // ABSOLUTE: @__llvm_coverage_mapping = {{.*"\\01.*foo.*bar.*baz .*coverage_relative_path\.swift}}
11
+ // ABSOLUTE: @__llvm_coverage_mapping = {{.*"\\01.*root.*nested .*coverage_relative_path\.swift}}
11
12
12
- // RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -Xllvm -enable-name-compression=false -coverage-prefix-map %/t/foo/bar =. -emit-ir %/t/foo/bar/baz /coverage_relative_path.swift | %FileCheck -check-prefix=RELATIVE %s
13
+ // RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -Xllvm -enable-name-compression=false -coverage-prefix-map %/t/root =. -emit-ir %/t/root/nested /coverage_relative_path.swift | %FileCheck -check-prefix=RELATIVE %s
13
14
//
14
- // RELATIVE: @__llvm_coverage_mapping = {{.*"\\01[^/]*}}.{{/|\\}}baz{{.*coverage_relative_path\.swift}}
15
-
16
- func coverage( ) { }
15
+ // RELATIVE: @__llvm_coverage_mapping = {{.*"\\01[^/]*}}.{{/|\\}}nested{{.*coverage_relative_path\.swift}}
You can’t perform that action at this time.
0 commit comments