Skip to content

Commit 9956668

Browse files
committed
cfl: change base path to a seed corpus
1 parent 72fac0e commit 9956668

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.clusterfuzzlite/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ git config --global --add safe.directory '*'
5454
cmake "${cmake_args[@]}" -S . -B build -G Ninja
5555
cmake --build build --parallel
5656

57-
cp corpus/*.dict corpus/*.options $OUT/
57+
cp corpus/corpus/*.dict corpus/corpus/*.options $OUT/
5858

5959
# Copy the fuzzer executables, zip-ed corpora, option and
6060
# dictionary files to $OUT.
@@ -70,7 +70,7 @@ for f in $(find build/tests/ -name '*_test' -type f);
7070
do
7171
name=$(basename $f);
7272
module=$(echo $name | sed 's/_test//')
73-
corpus_dir="corpus/$module"
73+
corpus_dir="corpus/corpus/$module"
7474
echo "Copying for $module";
7575
cp $f $OUT/
7676
if [ -e "$corpus_dir" ]; then

tests/capi/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ string(JOIN " " LIBFUZZER_OPTS
6666
-use_value_profile=1
6767
)
6868

69+
set(CORPUS_BASE_PATH ${PROJECT_SOURCE_DIR}/corpus)
70+
if(USE_LUAJIT)
71+
set(CORPUS_BASE_PATH ${CORPUS_BASE_PATH}/corpus)
72+
endif()
73+
6974
function(create_test)
7075
cmake_parse_arguments(
7176
FUZZ
@@ -89,8 +94,8 @@ function(create_test)
8994
if (IS_LUAJIT AND (${test_name} STREQUAL "lua_load_test"))
9095
set(LIBFUZZER_OPTS "${LIBFUZZER_OPTS} -only_ascii=1")
9196
endif ()
92-
set(dict_path ${PROJECT_SOURCE_DIR}/corpus/${test_name}.dict)
93-
set(corpus_path ${PROJECT_SOURCE_DIR}/corpus/${test_prefix})
97+
set(dict_path ${CORPUS_BASE_PATH}/${test_name}.dict)
98+
set(corpus_path ${CORPUS_BASE_PATH}/${test_prefix})
9499
if (EXISTS ${dict_path})
95100
set(LIBFUZZER_OPTS "${LIBFUZZER_OPTS} -dict=${dict_path}")
96101
endif ()

0 commit comments

Comments
 (0)