[libFuzzer] test cleanup
authorKostya Serebryany <kcc@google.com>
Sat, 10 Dec 2016 02:45:56 +0000 (02:45 +0000)
committerKostya Serebryany <kcc@google.com>
Sat, 10 Dec 2016 02:45:56 +0000 (02:45 +0000)
llvm-svn: 289312

llvm/lib/Fuzzer/test/CMakeLists.txt
llvm/lib/Fuzzer/test/coverage.test
llvm/lib/Fuzzer/test/fuzzer-printcovpcs.test
llvm/lib/Fuzzer/test/fuzzer.test
llvm/lib/Fuzzer/test/merge.test
llvm/lib/Fuzzer/test/shrink.test
llvm/lib/Fuzzer/test/trace-pc/CMakeLists.txt [deleted file]
llvm/lib/Fuzzer/test/value-profile-switch.test

index fddb151..2514258 100644 (file)
@@ -105,6 +105,7 @@ set(Tests
   StrstrTest
   SwapCmpTest
   SwitchTest
+  Switch2Test
   ThreadedLeakTest
   ThreadedTest
   TimeoutTest
@@ -172,7 +173,28 @@ add_subdirectory(uninstrumented)
 add_subdirectory(no-coverage)
 add_subdirectory(ubsan)
 add_subdirectory(trace-bb)
-add_subdirectory(trace-pc)
+
+add_library(LLVMFuzzer-DSO1 SHARED DSO1.cpp)
+add_library(LLVMFuzzer-DSO2 SHARED DSO2.cpp)
+
+add_executable(LLVMFuzzer-DSOTest
+  DSOTestMain.cpp
+  DSOTestExtra.cpp)
+
+target_link_libraries(LLVMFuzzer-DSOTest
+  LLVMFuzzer-DSO1
+  LLVMFuzzer-DSO2
+  LLVMFuzzer
+  )
+
+set_target_properties(LLVMFuzzer-DSOTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY
+  "${CMAKE_BINARY_DIR}/lib/Fuzzer/test")
+set_target_properties(LLVMFuzzer-DSO1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY
+  "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")
+set_target_properties(LLVMFuzzer-DSO2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY
+  "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")
+
+set(TestBinaries ${TestBinaries} LLVMFuzzer-DSOTest)
 
 ###############################################################################
 # Configure lit to run the tests
index a5420bb..fa11be5 100644 (file)
@@ -4,7 +4,7 @@ CHECK-DAG: COVERED: {{.*}}in LLVMFuzzerTestOneInput {{.*}}NullDerefTest.cpp:14
 CHECK-DAG: COVERED: {{.*}}in LLVMFuzzerTestOneInput {{.*}}NullDerefTest.cpp:16
 CHECK-DAG: COVERED: {{.*}}in LLVMFuzzerTestOneInput {{.*}}NullDerefTest.cpp:19
 CHECK: COVERED_DIRS: {{.*}}lib/Fuzzer/test
-RUN: not LLVMFuzzer-NullDerefTest-TracePC -print_coverage=1 2>&1 | FileCheck %s
+RUN: not LLVMFuzzer-NullDerefTest -print_coverage=1 2>&1 | FileCheck %s
 
 RUN: LLVMFuzzer-DSOTest -print_coverage=1 -runs=0 2>&1 | FileCheck %s --check-prefix=DSO
 DSO: COVERAGE:
index e3ef0a5..e4c6f0e 100644 (file)
@@ -1,4 +1,4 @@
-RUN: LLVMFuzzer-SimpleTest-TracePC -print_pcs=1 -seed=1 2>&1 | FileCheck %s --check-prefix=PCS
+RUN: LLVMFuzzer-SimpleTest -print_pcs=1 -seed=1 2>&1 | FileCheck %s --check-prefix=PCS
 PCS-NOT: NEW_PC
 PCS:INITED
 PCS:NEW_PC: {{0x[a-f0-9]+}}
index 0fc9ff9..be3e59c 100644 (file)
@@ -2,7 +2,6 @@ CHECK: BINGO
 Done1000000: Done 1000000 runs in
 
 RUN: LLVMFuzzer-SimpleTest 2>&1 | FileCheck %s
-RUN: LLVMFuzzer-SimpleTest-TracePC 2>&1 | FileCheck %s
 
 # only_ascii mode. Will perform some minimal self-validation.
 RUN: LLVMFuzzer-SimpleTest -only_ascii=1 2>&1
@@ -24,8 +23,7 @@ NULL_DEREF_ON_EMPTY: stat::number_of_executed_units:
 
 #not LLVMFuzzer-FullCoverageSetTest -timeout=15 -seed=1 -mutate_depth=2 -use_full_coverage_set=1 2>&1 | FileCheck %s
 
-RUN: not LLVMFuzzer-CounterTest         -use_counters=1 -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s --check-prefix=COUNTERS
-RUN: not LLVMFuzzer-CounterTest-TracePC -use_counters=1 -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s --check-prefix=COUNTERS
+RUN: not LLVMFuzzer-CounterTest  -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s --check-prefix=COUNTERS
 
 COUNTERS: INITED {{.*}} {{bits:|ft:}}
 COUNTERS: NEW {{.*}} {{bits:|ft:}} {{[1-9]*}}
@@ -48,8 +46,8 @@ RUN: not LLVMFuzzer-DSOTest 2>&1 | FileCheck %s --check-prefix=DSO
 DSO: INFO: Loaded 3 modules
 DSO: BINGO
 
-RUN: LLVMFuzzer-SimpleTest-TracePC  -exit_on_src_pos=SimpleTest.cpp:17                 2>&1 | FileCheck %s --check-prefix=EXIT_ON_SRC_POS
-RUN: LLVMFuzzer-ShrinkControlFlowTest-TracePC  -exit_on_src_pos=ShrinkControlFlowTest.cpp:23 2>&1 | FileCheck %s --check-prefix=EXIT_ON_SRC_POS
+RUN: LLVMFuzzer-SimpleTest  -exit_on_src_pos=SimpleTest.cpp:17                 2>&1 | FileCheck %s --check-prefix=EXIT_ON_SRC_POS
+RUN: LLVMFuzzer-ShrinkControlFlowTest  -exit_on_src_pos=ShrinkControlFlowTest.cpp:23 2>&1 | FileCheck %s --check-prefix=EXIT_ON_SRC_POS
 EXIT_ON_SRC_POS: INFO: found line matching '{{.*}}', exiting.
 
 RUN: ASAN_OPTIONS=strict_string_checks=1 not LLVMFuzzer-StrncmpOOBTest -seed=1 -runs=1000000 2>&1 | FileCheck %s --check-prefix=STRNCMP
index 0ef1b6f..4e000f2 100644 (file)
@@ -8,7 +8,6 @@ RUN: echo ..Z... > %tmp/T1/3
 
 # T1 has 3 elements, T2 is empty.
 RUN: LLVMFuzzer-FullCoverageSetTest         -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK1
-RUN: LLVMFuzzer-FullCoverageSetTest-TracePC -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK1
 CHECK1: === Minimizing the initial corpus of 3 units
 CHECK1: === Merge: written 0 units
 
@@ -27,7 +26,6 @@ CHECK2: === Merge: written 3 units
 
 # Now, T1 has 6 units and T2 has no new interesting units.
 RUN: LLVMFuzzer-FullCoverageSetTest         -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK3
-RUN: LLVMFuzzer-FullCoverageSetTest-TracePC -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK3
 CHECK3: === Minimizing the initial corpus of 6 units
 CHECK3: === Merge: written 0 units
 
index 68206f0..edb86cb 100644 (file)
@@ -1,6 +1,6 @@
-RUN: LLVMFuzzer-ShrinkControlFlowTest-TracePC -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000  -shrink=1 2>&1 | FileCheck %s --check-prefix=SHRINK1
-RUN: LLVMFuzzer-ShrinkControlFlowTest-TracePC -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 -shrink=0 2>&1 | FileCheck %s --check-prefix=SHRINK0
-RUN: LLVMFuzzer-ShrinkValueProfileTest-TracePC -seed=1 -exit_on_item=aea2e3923af219a8956f626558ef32f30a914ebc -runs=100000 -shrink=1 -use_value_profile=1 2>&1 | FileCheck %s --check-prefix=SHRINK1_VP
+RUN: LLVMFuzzer-ShrinkControlFlowTest -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000  -shrink=1 2>&1 | FileCheck %s --check-prefix=SHRINK1
+RUN: LLVMFuzzer-ShrinkControlFlowTest -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 -shrink=0 2>&1 | FileCheck %s --check-prefix=SHRINK0
+RUN: LLVMFuzzer-ShrinkValueProfileTest -seed=1 -exit_on_item=aea2e3923af219a8956f626558ef32f30a914ebc -runs=100000 -shrink=1 -use_value_profile=1 2>&1 | FileCheck %s --check-prefix=SHRINK1_VP
 
 SHRINK0: Done 1000000 runs in
 SHRINK1: INFO: found item with checksum '0eb8e4ed029b774d80f2b66408203801cb982a60', exiting.
diff --git a/llvm/lib/Fuzzer/test/trace-pc/CMakeLists.txt b/llvm/lib/Fuzzer/test/trace-pc/CMakeLists.txt
deleted file mode 100644 (file)
index 91becae..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# These tests are not instrumented with coverage.
-
-set(CMAKE_CXX_FLAGS
-  "${LIBFUZZER_FLAGS_BASE} ")
-
-set(TracePCTests
-  SimpleTest
-  CounterTest
-  CallerCalleeTest
-  NullDerefTest
-  ShrinkControlFlowTest
-  ShrinkValueProfileTest
-  SwitchTest
-  Switch2Test
-  FullCoverageSetTest
-  )
-
-foreach(Test ${TracePCTests})
-  add_libfuzzer_test(${Test}-TracePC SOURCES ../${Test}.cpp)
-endforeach()
-
-# Propagate value into parent directory
-set(TestBinaries ${TestBinaries} PARENT_SCOPE)
-
-add_library(LLVMFuzzer-DSO1 SHARED ../DSO1.cpp)
-add_library(LLVMFuzzer-DSO2 SHARED ../DSO2.cpp)
-
-add_executable(LLVMFuzzer-DSOTest
-  ../DSOTestMain.cpp
-  ../DSOTestExtra.cpp)
-
-target_link_libraries(LLVMFuzzer-DSOTest
-  LLVMFuzzer-DSO1
-  LLVMFuzzer-DSO2
-  LLVMFuzzer
-  )
-
-set_target_properties(LLVMFuzzer-DSOTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY
-  "${CMAKE_BINARY_DIR}/lib/Fuzzer/test")
-set_target_properties(LLVMFuzzer-DSO1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY
-  "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")
-set_target_properties(LLVMFuzzer-DSO2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY
-  "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")
-
-set(TestBinaries ${TestBinaries} LLVMFuzzer-DSOTest PARENT_SCOPE)
index 312fec6..1947f56 100644 (file)
@@ -1,3 +1,3 @@
 CHECK: BINGO
-RUN: not LLVMFuzzer-SwitchTest-TracePC  -use_cmp=0 -use_value_profile=1 -runs=100000000 -seed=1 2>&1 | FileCheck %s
-RUN: not LLVMFuzzer-Switch2Test-TracePC -use_cmp=0 -use_value_profile=1 -runs=100000000 -seed=1 2>&1 | FileCheck %s
+RUN: not LLVMFuzzer-SwitchTest  -use_cmp=0 -use_value_profile=1 -runs=100000000 -seed=1 2>&1 | FileCheck %s
+RUN: not LLVMFuzzer-Switch2Test -use_cmp=0 -use_value_profile=1 -runs=100000000 -seed=1 2>&1 | FileCheck %s