[llvm] r321888 - [llvm-cov] Change test to use FileCheck instead of grep.

Douglas Yung via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 12:00:18 PST 2018


Author: dyung
Date: Fri Jan  5 12:00:18 2018
New Revision: 321888

URL: http://llvm.org/viewvc/llvm-project?rev=321888&view=rev
Log:
[llvm-cov] Change test to use FileCheck instead of grep.

Reviewed by Paul Robinson


Modified:
    llvm/trunk/test/tools/llvm-cov/sources-specified.test

Modified: llvm/trunk/test/tools/llvm-cov/sources-specified.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/sources-specified.test?rev=321888&r1=321887&r2=321888&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/sources-specified.test (original)
+++ llvm/trunk/test/tools/llvm-cov/sources-specified.test Fri Jan  5 12:00:18 2018
@@ -28,11 +28,13 @@ RUN:   %S/Inputs/sources_specified/main.
 RUN:   %S/Inputs/sources_specified/main.cc %S/Inputs/sources_specified/extra \
 RUN:   > %t.export.json
 
-RUN: not grep '"filename":"/tmp/sources_specified/abs.h"' %t.export.json
-RUN: grep '"filename":"/tmp/sources_specified/main.cc"' %t.export.json
-RUN: grep '"filename":"/tmp/sources_specified/extra/dec.h"' %t.export.json
-RUN: grep '"filename":"/tmp/sources_specified/extra/inc.h"' %t.export.json
+RUN: FileCheck -check-prefix=NO-EXPORT %s < %t.export.json
+RUN: FileCheck -check-prefix=EXPORT %s < %t.export.json
 
+NO-EXPORT-NOT: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)abs.h"}}
+EXPORT-DAG: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)main.cc"}}
+EXPORT-DAG: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)extra(/|\\\\)dec.h"}}
+EXPORT-DAG: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)extra(/|\\\\)inc.h"}}
 
 Instructions for regenerating the test:
 




More information about the llvm-commits mailing list