Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
f7438ca7
Commit
f7438ca7
authored
Sep 16, 2010
by
Ben Boeckel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for unused detection via setting it
parent
995cfb0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
Tests/CMakeLists.txt
Tests/CMakeLists.txt
+15
-0
Tests/VariableUnusedViaSet/CMakeLists.txt
Tests/VariableUnusedViaSet/CMakeLists.txt
+4
-0
No files found.
Tests/CMakeLists.txt
View file @
f7438ca7
...
...
@@ -1074,6 +1074,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
LIST
(
APPEND TEST_BUILD_DIRS
"
${
CMake_BINARY_DIR
}
/Tests/BundleGeneratorTest"
)
ENDIF
(
APPLE AND CTEST_TEST_CPACK
)
ADD_TEST
(
WarnUnusedUnusedViaSet
${
CMAKE_CTEST_COMMAND
}
--build-and-test
"
${
CMake_SOURCE_DIR
}
/Tests/VariableUnusedViaSet"
"
${
CMake_BINARY_DIR
}
/Tests/WarnUnusedUnusedViaSet"
--build-generator
${
CMAKE_TEST_GENERATOR
}
--build-makeprogram
${
CMAKE_TEST_MAKEPROGRAM
}
--build-noclean
--build-project WarnUnusedUnusedViaSet
--build-options
"--warn-unused-vars"
)
SET_TESTS_PROPERTIES
(
WarnUnusedUnusedViaSet PROPERTIES
PASS_REGULAR_EXPRESSION
"warning:
\\
(changing definition
\\
) unused variable 'UNUSED_VARIABLE'"
)
SET_TESTS_PROPERTIES
(
WarnUnusedUnusedViaSet PROPERTIES
FAIL_REGULAR_EXPRESSION
"warning:
\\
(unsetting
\\
) unused variable 'UNUSED_VARIABLE'"
)
LIST
(
APPEND TEST_BUILD_DIRS
"
${
CMake_BINARY_DIR
}
/Tests/WarnUnusedUnusedViaSet"
)
ADD_TEST
(
WarnUnusedUnusedViaUnset
${
CMAKE_CTEST_COMMAND
}
--build-and-test
"
${
CMake_SOURCE_DIR
}
/Tests/VariableUnusedViaUnset"
...
...
Tests/VariableUnusedViaSet/CMakeLists.txt
0 → 100644
View file @
f7438ca7
set
(
UNUSED_VARIABLE
)
# Warning should occur here
set
(
UNUSED_VARIABLE
"Usage"
)
message
(
STATUS
"
${
UNUSED_VARIABLE
}
"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment