Skip to content

Commit da09a92

Browse files
authored
test/cfg: enabled information and --inconclusive in all cases / some cleanups (#4784)
1 parent 8583fcf commit da09a92

25 files changed

Lines changed: 79 additions & 76 deletions

lib/library.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ Library::Error Library::loadFunction(const tinyxml2::XMLElement * const node, co
671671
if (name.empty())
672672
return Error(ErrorCode::OK);
673673

674+
// TODO: write debug warning if we modify an existing entry
674675
Function& func = functions[name];
675676

676677
for (const tinyxml2::XMLElement *functionnode = node->FirstChildElement(); functionnode; functionnode = functionnode->NextSiblingElement()) {

test/CMakeLists.txt

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ if (BUILD_TESTS)
8888
endforeach()
8989

9090
function(add_cfg CFG_TEST)
91-
set(options INCONCLUSIVE)
9291
set(oneValueArgs PLATFORM NAME)
93-
set(multiValueArgs LIBRARY)
92+
set(multiValueArgs ADD_LIBRARY)
9493

9594
cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
96-
if(PARSE_LIBRARY)
97-
string(REPLACE ";" "," LIBRARY "${PARSE_LIBRARY}")
98-
else()
99-
get_filename_component(LIBRARY ${CFG_TEST} NAME_WE)
95+
get_filename_component(LIBRARY ${CFG_TEST} NAME_WE)
96+
# TODO: get rid of this
97+
if(PARSE_ADD_LIBRARY)
98+
string(REPLACE ";" "," ADD_LIBRARY "${PARSE_ADD_LIBRARY}")
99+
set(LIBRARY "${ADD_LIBRARY},${LIBRARY}")
100100
endif()
101101
set(PLATFORM unix64)
102102
if(PARSE_PLATFORM)
@@ -107,10 +107,6 @@ if (BUILD_TESTS)
107107
else()
108108
string(MAKE_C_IDENTIFIER ${CFG_TEST} TEST_NAME)
109109
endif()
110-
set(INCONCLUSIVE)
111-
if(PARSE_INCONCLUSIVE)
112-
set(INCONCLUSIVE "--inconclusive")
113-
endif()
114110
if ("cfg-${TEST_NAME}" IN_LIST SKIP_TESTS)
115111
else()
116112
# TODO: add syntax check
@@ -119,24 +115,27 @@ if (BUILD_TESTS)
119115
--check-library
120116
--platform=${PLATFORM}
121117
--library=${LIBRARY}
122-
--enable=information
123-
--enable=style
118+
--enable=style,information
119+
--inconclusive
120+
--force
124121
--error-exitcode=1
125122
--suppress=missingIncludeSystem
126123
--inline-suppr
127-
${INCONCLUSIVE}
128124
${CMAKE_CURRENT_SOURCE_DIR}/cfg/${CFG_TEST}
129125
)
130126
endif()
131127
endfunction()
132-
add_cfg(boost.cpp INCONCLUSIVE)
128+
# TODO: glob this
129+
add_cfg(boost.cpp)
133130
add_cfg(bsd.c)
134131
add_cfg(cairo.c)
135-
add_cfg(cppunit.cpp INCONCLUSIVE)
136-
add_cfg(gnu.c LIBRARY posix;gnu)
137-
add_cfg(googletest.cpp INCONCLUSIVE)
138-
add_cfg(gtk.c INCONCLUSIVE)
139-
add_cfg(kde.cpp INCONCLUSIVE)
132+
add_cfg(cppunit.cpp)
133+
# TODO: posix needs to specified first or it has a different mmap() config
134+
# TODO: get rid of posix dependency
135+
add_cfg(gnu.c ADD_LIBRARY posix)
136+
add_cfg(googletest.cpp)
137+
add_cfg(gtk.c)
138+
add_cfg(kde.cpp)
140139
add_cfg(libcurl.c)
141140
add_cfg(libsigc++.cpp)
142141
add_cfg(lua.c)
@@ -145,14 +144,14 @@ if (BUILD_TESTS)
145144
add_cfg(openssl.c)
146145
add_cfg(posix.c)
147146
add_cfg(python.c)
148-
add_cfg(qt.cpp INCONCLUSIVE)
149-
add_cfg(sqlite3.c INCONCLUSIVE)
150-
add_cfg(std.c INCONCLUSIVE)
151-
add_cfg(std.cpp INCONCLUSIVE)
152-
add_cfg(windows.cpp INCONCLUSIVE NAME windows32A PLATFORM win32A)
153-
add_cfg(windows.cpp INCONCLUSIVE NAME windows32W PLATFORM win32W)
154-
add_cfg(windows.cpp INCONCLUSIVE NAME windows64 PLATFORM win64)
155-
add_cfg(wxwidgets.cpp INCONCLUSIVE)
147+
add_cfg(qt.cpp)
148+
add_cfg(sqlite3.c)
149+
add_cfg(std.c)
150+
add_cfg(std.cpp)
151+
add_cfg(windows.cpp NAME windows32A PLATFORM win32A)
152+
add_cfg(windows.cpp NAME windows32W PLATFORM win32W)
153+
add_cfg(windows.cpp NAME windows64 PLATFORM win64)
154+
add_cfg(wxwidgets.cpp)
156155

157156
function(fixture_cost NAME COST)
158157
if(TEST ${NAME})

test/cfg/boost.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Test library configuration for boost.cfg
33
//
44
// Usage:
5-
// $ cppcheck --check-library --library=boost --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/boost.cpp
5+
// $ cppcheck --check-library --library=boost --enable=style,information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/boost.cpp
66
// =>
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//

test/cfg/bsd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Test library configuration for bsd.cfg
22
//
33
// Usage:
4-
// $ cppcheck --check-library --library=bsd --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/bsd.c
4+
// $ cppcheck --check-library --library=bsd --enable=style,information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/bsd.c
55
// =>
66
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
77
//

test/cfg/cairo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Test library configuration for cairo.cfg
33
//
44
// Usage:
5-
// $ cppcheck --check-library --library=cairo --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/cairo.c
5+
// $ cppcheck --check-library --library=cairo --enable=style,information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/cairo.c
66
// =>
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//

test/cfg/cppunit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Test library configuration for cppunit.cfg
22
//
33
// Usage:
4-
// $ cppcheck --check-library --library=cppunit --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/cppunit.cpp
4+
// $ cppcheck --check-library --library=cppunit --enable=style,information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/cppunit.cpp
55
// =>
66
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
77
//

test/cfg/gnu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Test library configuration for gnu.cfg
33
//
44
// Usage:
5-
// $ cppcheck --check-library --library=gnu --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/gnu.c
5+
// $ cppcheck --check-library --library=gnu --enable=style,information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/gnu.c
66
// =>
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//

test/cfg/googletest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Test library configuration for googletest.cfg
33
//
44
// Usage:
5-
// $ cppcheck --check-library --library=googletest --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/googletest.cpp
5+
// $ cppcheck --check-library --library=googletest --enable=style,information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/googletest.cpp
66
// =>
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//

test/cfg/gtk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Test library configuration for gtk.cfg
33
//
44
// Usage:
5-
// $ cppcheck --check-library --library=gtk --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr --library=gtk test/cfg/gtk.cpp
5+
// $ cppcheck --check-library --library=gtk --enable=style,information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr --library=gtk test/cfg/gtk.cpp
66
// =>
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//

test/cfg/kde.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Test library configuration for kde.cfg
33
//
44
// Usage:
5-
// $ cppcheck --check-library --library=kde --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/kde.cpp
5+
// $ cppcheck --check-library --library=kde --enable=style,information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/kde.cpp
66
// =>
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//

0 commit comments

Comments
 (0)