From 680fae9c978ea02b86601171512974a9ade57fbc Mon Sep 17 00:00:00 2001 From: David Cole Date: Thu, 15 Oct 2009 12:35:54 -0400 Subject: [PATCH] Increase ctest coverage. Introduce optionally on intentional compile errors and warnings to the SmallAndFast project. Turn them on for the FailedSubmit tests to cover analyzing LABELS-related errors and warnings. --- Tests/CTestTest/SmallAndFast/CMakeLists.txt | 8 ++++++++ .../SmallAndFast/intentional_compile_error.cxx | 1 + .../SmallAndFast/intentional_compile_warning.cxx | 11 +++++++++++ Tests/CTestTestFailedSubmits/test.cmake.in | 5 ++++- 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Tests/CTestTest/SmallAndFast/intentional_compile_error.cxx create mode 100644 Tests/CTestTest/SmallAndFast/intentional_compile_warning.cxx diff --git a/Tests/CTestTest/SmallAndFast/CMakeLists.txt b/Tests/CTestTest/SmallAndFast/CMakeLists.txt index ee608c0a3..85cb30cef 100644 --- a/Tests/CTestTest/SmallAndFast/CMakeLists.txt +++ b/Tests/CTestTest/SmallAndFast/CMakeLists.txt @@ -15,3 +15,11 @@ set_property(TEST test1 APPEND PROPERTY LABELS TestLabel 1ArgTest Everything) add_test(test2 echoargs 1 2) set_property(TEST test2 APPEND PROPERTY LABELS TestLabel 2ArgTest Everything) + +if(SAF_INTENTIONAL_COMPILE_ERROR) + add_executable(ice intentional_compile_error.cxx) +endif() + +if(SAF_INTENTIONAL_COMPILE_WARNING) + add_executable(icw intentional_compile_warning.cxx) +endif() diff --git a/Tests/CTestTest/SmallAndFast/intentional_compile_error.cxx b/Tests/CTestTest/SmallAndFast/intentional_compile_error.cxx new file mode 100644 index 000000000..a8930cf72 --- /dev/null +++ b/Tests/CTestTest/SmallAndFast/intentional_compile_error.cxx @@ -0,0 +1 @@ +garbage - obviously this should not compile as is diff --git a/Tests/CTestTest/SmallAndFast/intentional_compile_warning.cxx b/Tests/CTestTest/SmallAndFast/intentional_compile_warning.cxx new file mode 100644 index 000000000..8ea5e404f --- /dev/null +++ b/Tests/CTestTest/SmallAndFast/intentional_compile_warning.cxx @@ -0,0 +1,11 @@ +#include + +int main(int argc, const char* argv[]) +{ + unsigned int i = 0; // "i