Skip to content

Commit 6983694

Browse files
Follow new guideline: Avoid cd DIR && FOO in RUN lines.
Instead, put `FOO` on a separate run line. `cd` affects later RUN lines, and `cd DIR && FOO` could mislead the reader that it doesn't and that's why we needed to put both parts on one line. I added the proposed guideline to #346. I'm changing the existing tests before changing more tests to use `cd` as part of this PR.
1 parent 157e2cd commit 6983694

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

clang/test/3C/base_subdir/canwrite_constraints.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
// not allow canwrite_constraints.h to change, and the internal types of q and
1111
// the return should remain wild.
1212
//
13-
// RUN: cd %S && 3c -alltypes -addcr -output-dir=%t.checked/base_subdir -warn-all-root-cause %s -- -Xclang -verify
13+
// RUN: cd %S
14+
// RUN: 3c -alltypes -addcr -output-dir=%t.checked/base_subdir -warn-all-root-cause %s -- -Xclang -verify
1415
// RUN: FileCheck -match-full-lines -check-prefixes=CHECK_LOWER --input-file %t.checked/base_subdir/canwrite_constraints.c %s
1516
// RUN: test ! -f %t.checked/canwrite_constraints.checked.h
1617

1718
// "Higher" case: When -base-dir is set to the parent directory, we can change
1819
// canwrite_constraints.h, so both q and the return should become checked.
1920
//
20-
// RUN: cd %S && 3c -alltypes -addcr -base-dir=.. -output-dir=%t.checked2 %s --
21+
// RUN: 3c -alltypes -addcr -base-dir=.. -output-dir=%t.checked2 %s --
2122
// RUN: FileCheck -match-full-lines -check-prefixes=CHECK_HIGHER --input-file %t.checked2/base_subdir/canwrite_constraints.c %s
2223
// RUN: FileCheck -match-full-lines -check-prefixes=CHECK_HIGHER --input-file %t.checked2/canwrite_constraints.h %S/../canwrite_constraints.h
2324

clang/test/3C/base_subdir/canwrite_constraints_symlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
// Now 3C should know that it can't write to base_subdir_partial_defn.h because
2121
// the symlink goes out of the base dir.
2222
//
23-
// RUN: cd %t.base && 3c -addcr canwrite_constraints_symlink.c -- -Xclang -verify
23+
// RUN: cd %t.base
24+
// RUN: 3c -addcr canwrite_constraints_symlink.c -- -Xclang -verify
2425

2526
// expected-error@base_subdir_partial_defn.h:1 {{3C internal error: 3C generated changes to this file even though it is not allowed to write to the file}}
2627
// expected-note@*:* {{-dump-unwritable-changes}}

clang/test/3C/base_subdir/canwrite_constraints_unimplemented.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// an error diagnostic.
44
// (https://github.com/correctcomputation/checkedc-clang/issues/387)
55

6-
// RUN: cd %S && 3c -addcr %s -- -Xclang -verify
6+
// RUN: cd %S
7+
// RUN: 3c -addcr %s -- -Xclang -verify
78

89
// expected-error@../base_subdir_partial_defn.h:1 {{3C internal error: 3C generated changes to this file even though it is not allowed to write to the file}}
910
// expected-note@*:* {{-dump-unwritable-changes}}

0 commit comments

Comments
 (0)