diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common/SConscript | 4 | ||||
-rw-r--r-- | tests/common/malloc_wrappers.c (renamed from tests/fuzztest/malloc_wrappers.c) | 0 | ||||
-rw-r--r-- | tests/common/malloc_wrappers.h (renamed from tests/fuzztest/malloc_wrappers.h) | 0 | ||||
-rw-r--r-- | tests/common/malloc_wrappers_syshdr.h (renamed from tests/fuzztest/fuzz_syshdr.h) | 0 | ||||
-rw-r--r-- | tests/fuzztest/SConscript | 9 | ||||
-rw-r--r-- | tests/fuzztest/fuzzstub.c | 2 | ||||
-rw-r--r-- | tests/fuzztest/fuzztest.c | 2 |
7 files changed, 10 insertions, 7 deletions
diff --git a/tests/common/SConscript b/tests/common/SConscript index f1dee0e2..4581bea1 100644 --- a/tests/common/SConscript +++ b/tests/common/SConscript @@ -15,3 +15,7 @@ strict.Append(CFLAGS = strict['CORECFLAGS']) strict.Object("pb_decode.o", "$NANOPB/pb_decode.c") strict.Object("pb_encode.o", "$NANOPB/pb_encode.c") strict.Object("pb_common.o", "$NANOPB/pb_common.c") + +mw = env.Object("malloc_wrappers.o", "malloc_wrappers.c") +Depends(mw, ["malloc_wrappers_syshdr.h"]) + diff --git a/tests/fuzztest/malloc_wrappers.c b/tests/common/malloc_wrappers.c index ad69f1ce..ad69f1ce 100644 --- a/tests/fuzztest/malloc_wrappers.c +++ b/tests/common/malloc_wrappers.c diff --git a/tests/fuzztest/malloc_wrappers.h b/tests/common/malloc_wrappers.h index 7eec7952..7eec7952 100644 --- a/tests/fuzztest/malloc_wrappers.h +++ b/tests/common/malloc_wrappers.h diff --git a/tests/fuzztest/fuzz_syshdr.h b/tests/common/malloc_wrappers_syshdr.h index d295d9ed..d295d9ed 100644 --- a/tests/fuzztest/fuzz_syshdr.h +++ b/tests/common/malloc_wrappers_syshdr.h diff --git a/tests/fuzztest/SConscript b/tests/fuzztest/SConscript index 6499714f..346ccab8 100644 --- a/tests/fuzztest/SConscript +++ b/tests/fuzztest/SConscript @@ -5,8 +5,8 @@ Import("env") # We need our own pb_decode.o for the malloc support env = env.Clone() env.Append(CPPDEFINES = {'PB_ENABLE_MALLOC': 1, - 'PB_SYSTEM_HEADER': '\\"fuzz_syshdr.h\\"'}) -env.Append(CPPPATH = ".") + 'PB_SYSTEM_HEADER': '\\"malloc_wrappers_syshdr.h\\"'}) +env.Append(CPPPATH = [".", "$COMMON"]) if 'SYSHDR' in env: env.Append(CPPDEFINES = {'PB_OLD_SYSHDR': env['SYSHDR']}) @@ -42,8 +42,7 @@ fuzz = env.Program(["fuzztest.c", "pb_encode_with_malloc.o", "pb_decode_with_malloc.o", "pb_common_with_malloc.o", - "malloc_wrappers.c"]) -Depends([p1, p2, fuzz], ["fuzz_syshdr.h", "malloc_wrappers.h"]) + "$COMMON/malloc_wrappers.o"]) env.RunTest(fuzz) @@ -53,6 +52,6 @@ fuzzstub = env.Program(["fuzzstub.c", "pb_encode_with_malloc.o", "pb_decode_with_malloc.o", "pb_common_with_malloc.o", - "malloc_wrappers.c"]) + "$COMMON/malloc_wrappers.o"]) diff --git a/tests/fuzztest/fuzzstub.c b/tests/fuzztest/fuzzstub.c index 50998416..ce14b9ba 100644 --- a/tests/fuzztest/fuzzstub.c +++ b/tests/fuzztest/fuzzstub.c @@ -10,7 +10,7 @@ #include <string.h> #include <assert.h> #include <time.h> -#include "malloc_wrappers.h" +#include <malloc_wrappers.h> #include "alltypes_static.pb.h" #include "alltypes_pointer.pb.h" diff --git a/tests/fuzztest/fuzztest.c b/tests/fuzztest/fuzztest.c index 996ed450..d3701724 100644 --- a/tests/fuzztest/fuzztest.c +++ b/tests/fuzztest/fuzztest.c @@ -9,7 +9,7 @@ #include <string.h> #include <assert.h> #include <time.h> -#include "malloc_wrappers.h" +#include <malloc_wrappers.h> #include "alltypes_static.pb.h" #include "alltypes_pointer.pb.h" |