[PATCH] Add lit-style tests for the Fuzzer library

Kostya Serebryany kcc at google.com
Wed Jan 28 14:50:26 PST 2015


================
Comment at: lib/Fuzzer/CMakeLists.txt:11
@@ +10,2 @@
+
+add_subdirectory(test)
----------------
samsonov wrote:
> Put this under
>   if (LLVM_INCLUDE_TESTS)
> 
done

================
Comment at: lib/Fuzzer/test/fuzzer.test:1
@@ +1,2 @@
+
+RUN: ./LLVMFuzzer-SimpleTest 2>&1 | FileCheck %s --check-prefix=SimpleTest
----------------
samsonov wrote:
> delete empty line
done

================
Comment at: lib/Fuzzer/test/fuzzer.test:12
@@ +11,3 @@
+TimeoutTest: CRASHED; file written to timeout
+
+RUN: not ./LLVMFuzzer-NullDerefTest 2>&1 | FileCheck %s --check-prefix=NullDerefTest
----------------
samsonov wrote:
> What about ExactTest?
Hah, good catch. 
In the current state the Fuzzer is not capable of solving ExactTest (nor is AFL, for example). 
I have a plan of attack though.
http://reviews.llvm.org/rL227387 is part of that. 

================
Comment at: lib/Fuzzer/test/fuzzer.test:14
@@ +13,2 @@
+RUN: not ./LLVMFuzzer-NullDerefTest 2>&1 | FileCheck %s --check-prefix=NullDerefTest
+NullDerefTest: CRASHED; file written to crash-
----------------
samsonov wrote:
> Do you need "-" at the end of this line?
It's a part of output, so yes. 

================
Comment at: lib/Fuzzer/test/lit.cfg:1
@@ +1,2 @@
+# import lit.util
+import lit.formats
----------------
samsonov wrote:
> Delete this line.
done

================
Comment at: lib/Fuzzer/test/lit.cfg:8
@@ +7,2 @@
+config.test_source_root = os.path.dirname(__file__)
+
----------------
samsonov wrote:
> empty line?
done

http://reviews.llvm.org/D7217

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list