[clang] eb8c4b1 - [clang][deps] NFC: Convert test to split-file
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 1 11:48:33 PDT 2023
Author: Jan Svoboda
Date: 2023-08-01T11:48:25-07:00
New Revision: eb8c4b1d0f6154704af669c3feeee2f7514cb921
URL: https://github.com/llvm/llvm-project/commit/eb8c4b1d0f6154704af669c3feeee2f7514cb921
DIFF: https://github.com/llvm/llvm-project/commit/eb8c4b1d0f6154704af669c3feeee2f7514cb921.diff
LOG: [clang][deps] NFC: Convert test to split-file
Added:
Modified:
clang/test/ClangScanDeps/error.cpp
Removed:
################################################################################
diff --git a/clang/test/ClangScanDeps/error.cpp b/clang/test/ClangScanDeps/error.cpp
index d94ba4c03e5088..0095a6c900c3b3 100644
--- a/clang/test/ClangScanDeps/error.cpp
+++ b/clang/test/ClangScanDeps/error.cpp
@@ -1,26 +1,35 @@
-// RUN: rm -rf %t.dir
-// RUN: rm -rf %t.cdb
-// RUN: mkdir -p %t.dir
-// RUN: cp %s %t.dir/regular_cdb_input.cpp
-// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb.json > %t.cdb
-// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb_clangcl.json > %t_clangcl.cdb
-//
-// RUN: not clang-scan-deps -compilation-database %t.cdb -j 1 2>%t.dir/errs
-// RUN: echo EOF >> %t.dir/errs
-// RUN: FileCheck %s --input-file %t.dir/errs
-
-// RUN: not clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 2>%t.dir/errs_clangcl
-// RUN: echo EOF >> %t.dir/errs_clangcl
-// RUN: FileCheck %s --input-file %t.dir/errs_clangcl
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+//--- missing_tu.json.in
+[{
+ "directory": "DIR",
+ "command": "clang -fsyntax-only DIR/missing_tu.c",
+ "file": "DIR/missing_tu.c"
+}]
+//--- missing_header.json.in
+[{
+ "directory": "DIR",
+ "command": "clang -fsyntax-only DIR/missing_header.c",
+ "file": "DIR/missing_header.c"
+}]
+//--- missing_header.c
#include "missing.h"
-// CHECK: Error while scanning dependencies
-// CHECK-NEXT: error: no such file or directory:
-// CHECK-NEXT: error: no input files
-// CHECK-NEXT: error:
-// CHECK-NEXT: Error while scanning dependencies
-// CHECK-NEXT: fatal error: 'missing.h' file not found
-// CHECK-NEXT: Error while scanning dependencies
-// CHECK-NEXT: fatal error: 'missing.h' file not found
-// CHECK-NEXT: EOF
+// RUN: sed -e "s|DIR|%/t|g" %t/missing_tu.json.in > %t/missing_tu.json
+// RUN: not clang-scan-deps -compilation-database %t/missing_tu.json 2>%t/missing_tu.errs
+// RUN: echo EOF >> %t/missing_tu.errs
+// RUN: cat %t/missing_tu.errs | sed 's:\\\\\?:/:g' | FileCheck %s --check-prefix=CHECK-MISSING-TU -DPREFIX=%/t
+// CHECK-MISSING-TU: Error while scanning dependencies for [[PREFIX]]/missing_tu.c
+// CHECK-MISSING-TU-NEXT: error: no such file or directory: '[[PREFIX]]/missing_tu.c'
+// CHECK-MISSING-TU-NEXT: error: no input files
+// CHECK-MISSING-TU-NEXT: error:
+// CHECK-MISSING-TU-NEXT: EOF
+
+// RUN: sed -e "s|DIR|%/t|g" %t/missing_header.json.in > %t/missing_header.json
+// RUN: not clang-scan-deps -compilation-database %t/missing_header.json 2>%t/missing_header.errs
+// RUN: echo EOF >> %t/missing_header.errs
+// RUN: cat %t/missing_header.errs | sed 's:\\\\\?:/:g' | FileCheck %s --check-prefix=CHECK-MISSING-HEADER -DPREFIX=%/t
+// CHECK-MISSING-HEADER: Error while scanning dependencies for [[PREFIX]]/missing_header.c
+// CHECK-MISSING-HEADER-NEXT: fatal error: 'missing.h' file not found
+// CHECK-MISSING-HEADER-NEXT: EOF
More information about the cfe-commits
mailing list