[PATCH] D31532: Replace wc -l with count

Rafael Ávila de Espíndola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 06:16:57 PDT 2017


rafael created this revision.
Herald added a subscriber: kubamracek.

This is a far more common way in llvm of counting lines in tests


https://reviews.llvm.org/D31532

Files:
  compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc


Index: compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc
===================================================================
--- compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc
+++ compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc
@@ -8,15 +8,15 @@
 // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t
 // RUN: %sancov print *.sancov > main.txt
 // RUN: rm *.sancov
-// RUN: [ $(cat main.txt | wc -l) == 1 ]
+// RUN: cat main.txt | count 1
 // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x
 // RUN: %sancov print *.sancov > foo.txt
 // RUN: rm *.sancov
-// RUN: [ $(cat foo.txt | wc -l) == 3 ]
+// RUN: cat foo.txt | count 3
 // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x x
 // RUN: %sancov print *.sancov > bar.txt
 // RUN: rm *.sancov
-// RUN: [ $(cat bar.txt | wc -l) == 4 ]
+// RUN: cat bar.txt | count 4
 // RUN: %sancov missing %t < foo.txt > foo-missing.txt
 // RUN: sort main.txt foo-missing.txt -o foo-missing-with-main.txt
 // The "missing from foo" set may contain a few bogus PCs from the sanitizer
@@ -35,11 +35,11 @@
 // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x
 // RUN: %sancov print $LIBNAME.*.sancov > foo.txt
 // RUN: rm *.sancov
-// RUN: [ $(cat foo.txt | wc -l) == 2 ]
+// RUN: cat foo.txt | count 2
 // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x x
 // RUN: %sancov print $LIBNAME.*.sancov > bar.txt
 // RUN: rm *.sancov
-// RUN: [ $(cat bar.txt | wc -l) == 3 ]
+// RUN: cat bar.txt | count 3
 // RUN: %sancov missing %dynamiclib < foo.txt > foo-missing.txt
 // RUN: ( diff bar.txt foo-missing.txt || true ) | not grep "^<"
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31532.93629.patch
Type: text/x-patch
Size: 1718 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170331/5db18be0/attachment.bin>


More information about the llvm-commits mailing list