summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/clang-tidy-run-with-database.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/clang-tidy-run-with-database.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/clang-tidy-run-with-database.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang-tools-extra/test/clang-tidy/clang-tidy-run-with-database.cpp b/clang-tools-extra/test/clang-tidy/clang-tidy-run-with-database.cpp
index 05bc14c4fa0..f9b2955c6fd 100644
--- a/clang-tools-extra/test/clang-tidy/clang-tidy-run-with-database.cpp
+++ b/clang-tools-extra/test/clang-tidy/clang-tidy-run-with-database.cpp
@@ -8,7 +8,13 @@
// RUN: echo 'int *HP = 0;' > %T/compilation-database-test/include/header.h
// RUN: echo '#include "header.h"' > %T/compilation-database-test/b/d.cpp
// RUN: sed 's|test_dir|%/T/compilation-database-test|g' %S/Inputs/compilation-database/template.json > %T/compile_commands.json
-// RUN: clang-tidy --checks=-*,modernize-use-nullptr -p %T %T/compilation-database-test/b/not-exist -header-filter=.*
+
+// Regression test: shouldn't crash.
+// RUN: not clang-tidy --checks=-*,modernize-use-nullptr -p %T %T/compilation-database-test/b/not-exist -header-filter=.* 2>&1 | FileCheck %s -check-prefix=CHECK-NOT-EXIST
+// CHECK-NOT-EXIST: Error while processing {{.*}}/not-exist.
+// CHECK-NOT-EXIST: unable to handle compilation
+// CHECK-NOT-EXIST: Found compiler error
+
// RUN: clang-tidy --checks=-*,modernize-use-nullptr -p %T %T/compilation-database-test/a/a.cpp %T/compilation-database-test/a/b.cpp %T/compilation-database-test/b/b.cpp %T/compilation-database-test/b/c.cpp %T/compilation-database-test/b/d.cpp -header-filter=.* -fix
// RUN: FileCheck -input-file=%T/compilation-database-test/a/a.cpp %s -check-prefix=CHECK-FIX1
// RUN: FileCheck -input-file=%T/compilation-database-test/a/b.cpp %s -check-prefix=CHECK-FIX2
OpenPOWER on IntegriCloud