File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,6 +164,8 @@ matrix:
164164 - ./testrunner TestSymbolDatabase
165165# check .json files
166166 - find . -name '*.json' -not -path '*/\.*' | xargs jsonlint -s
167+ # build OSS-Fuzz clients
168+ - make -j2 CXXFLAGS="-fsanitize=address" -C oss-fuzz
167169
168170# check if dmake needs to be rerun (this job may fail)
169171 - name : " rerun dmake?"
Original file line number Diff line number Diff line change @@ -28,5 +28,6 @@ add_subdirectory(cli) # Client application
2828add_subdirectory (test ) # Tests
2929ADD_SUBDIRECTORY (gui ) # Graphical application
3030ADD_SUBDIRECTORY (tools/triage ) # Triage tool
31+ add_subdirectory (oss-fuzz ) # OSS-Fuzz clients
3132
3233include (cmake/printInfo.cmake REQUIRED )
Original file line number Diff line number Diff line change @@ -2,5 +2,9 @@ file(GLOB hdrs "*.h")
22file (GLOB srcs "*.cpp" )
33
44add_library (simplecpp_objs OBJECT ${srcs} ${hdrs} )
5+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
6+ add_library (simplecpp_objs_sanitized OBJECT ${srcs} ${hdrs} )
7+ target_compile_options (simplecpp_objs_sanitized PRIVATE -fsanitize=address )
8+ endif ()
59
610
Original file line number Diff line number Diff line change @@ -2,5 +2,9 @@ file(GLOB hdrs "*.h")
22file (GLOB srcs "*.cpp" )
33
44add_library (tinyxml_objs OBJECT ${srcs} ${hdrs} )
5+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
6+ add_library (tinyxml_objs_sanitized OBJECT ${srcs} ${hdrs} )
7+ target_compile_options (tinyxml_objs_sanitized PRIVATE -fsanitize=address )
8+ endif ()
59
610
Original file line number Diff line number Diff line change 3737endif ()
3838
3939add_library (lib_objs OBJECT ${srcs_lib} ${hdrs} )
40-
40+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
41+ add_library (lib_objs_sanitized OBJECT ${srcs_lib} ${hdrs} )
42+ target_compile_options (lib_objs_sanitized PRIVATE -fsanitize=address )
43+ endif ()
Original file line number Diff line number Diff line change 1+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
2+ add_executable (fuzz-client
3+ main.cpp
4+ type2.cpp )
5+ target_include_directories (fuzz-client PRIVATE ${CMAKE_SOURCE_DIR} /lib ${CMAKE_SOURCE_DIR} /externals/simplecpp ${CMAKE_SOURCE_DIR} /externals/tinyxml ${CMAKE_SOURCE_DIR} /externals )
6+ target_compile_options (fuzz-client PRIVATE -fsanitize=fuzzer )
7+ target_link_libraries (fuzz-client PRIVATE simplecpp_objs_sanitized tinyxml_objs_sanitized lib_objs_sanitized )
8+ target_link_options (fuzz-client PRIVATE -fsanitize=address -fsanitize=fuzzer )
9+
10+ add_executable (translate
11+ translate.cpp
12+ type2.cpp )
13+ endif ()
Original file line number Diff line number Diff line change @@ -19,11 +19,22 @@ class CppcheckExecutor : public ErrorLogger {
1919 cppcheck.check (" test.cpp" , code);
2020 }
2121
22- void reportOut (const std::string &outmsg) { }
23- void reportErr (const ErrorLogger::ErrorMessage &msg) {}
22+ void reportOut (const std::string &outmsg) OVERRIDE {
23+ (void )outmsg;
24+ }
25+ void reportErr (const ErrorLogger::ErrorMessage &msg) OVERRIDE {
26+ (void )msg;
27+ }
2428 void reportProgress (const std::string& filename,
2529 const char stage[],
26- const unsigned int value) {}
30+ const std::size_t value) OVERRIDE {
31+ (void )filename;
32+ (void )stage;
33+ (void )value;
34+ }
35+ void bughuntingReport (const std::string &str) OVERRIDE {
36+ (void )str;
37+ }
2738};
2839
2940
You can’t perform that action at this time.
0 commit comments