[PATCH] D29536: [libFuzzer] Don't add newline character when using echo in tests.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 22:58:40 PST 2017


mpividori created this revision.

I add the option "-n", so we don't add a new line character at the end of the file when using echo. (on Windows this means 2 characters).


https://reviews.llvm.org/D29536

Files:
  lib/Fuzzer/test/fuzzer-dirs.test
  lib/Fuzzer/test/minimize_crash.test


Index: lib/Fuzzer/test/minimize_crash.test
===================================================================
--- lib/Fuzzer/test/minimize_crash.test
+++ lib/Fuzzer/test/minimize_crash.test
@@ -5,7 +5,7 @@
 CHECK_EXACT: CRASH_MIN: failed to minimize beyond exact_minimized_path (3 bytes), exiting
 RUN: rm not_minimal_crash minimized-from-* exact_minimized_path
 
-RUN: echo 'abcd*xyz' > not_minimal_crash
+RUN: echo -n 'abcd*xyz' > not_minimal_crash
 RUN: LLVMFuzzer-SingleByteInputTest -minimize_crash=1 not_minimal_crash -artifact_prefix=./ZZZ- -exact_artifact_path=exact_minimized_path 2>&1 | FileCheck %s --check-prefix=MIN1
 MIN1: Test unit written to ./ZZZ-minimized-from-
 MIN1: INFO: The input is small enough, exiting
Index: lib/Fuzzer/test/fuzzer-dirs.test
===================================================================
--- lib/Fuzzer/test/fuzzer-dirs.test
+++ lib/Fuzzer/test/fuzzer-dirs.test
@@ -5,9 +5,9 @@
 RUN: echo c > %t/SUB1/SUB2/SUB3/c
 RUN: LLVMFuzzer-SimpleTest %t/SUB1 -runs=0 2>&1 | FileCheck %s --check-prefix=SUBDIRS
 SUBDIRS: READ   units: 3
-RUN: echo zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz > %t/SUB1/long
+RUN: echo -n zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz > %t/SUB1/long
 RUN: LLVMFuzzer-SimpleTest %t/SUB1 -runs=0 2>&1 | FileCheck %s --check-prefix=LONG
-LONG: INFO: -max_len is not provided, using 94
+LONG: INFO: -max_len is not provided, using 93
 RUN: rm -rf %t/SUB1
 
 RUN: not LLVMFuzzer-SimpleTest NONEXISTENT_DIR 2>&1 | FileCheck %s --check-prefix=NONEXISTENT_DIR


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29536.87081.patch
Type: text/x-patch
Size: 1620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170204/2a47d71c/attachment.bin>


More information about the llvm-commits mailing list