diff options
Diffstat (limited to 'Tests/CTestTest')
-rw-r--r-- | Tests/CTestTest/SmallAndFast/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/CTestTest/SmallAndFast/intentional_compile_error.cxx | 1 | ||||
-rw-r--r-- | Tests/CTestTest/SmallAndFast/intentional_compile_warning.cxx | 11 |
3 files changed, 20 insertions, 0 deletions
diff --git a/Tests/CTestTest/SmallAndFast/CMakeLists.txt b/Tests/CTestTest/SmallAndFast/CMakeLists.txt index ee608c0..85cb30c 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 0000000..a8930cf --- /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 0000000..8ea5e40 --- /dev/null +++ b/Tests/CTestTest/SmallAndFast/intentional_compile_warning.cxx @@ -0,0 +1,11 @@ +#include <stdio.h> + +int main(int argc, const char* argv[]) +{ + unsigned int i = 0; // "i<argc" should produce a "signed/unsigned comparison" warning + for (; i<argc; ++i) + { + fprintf(stdout, "%s\n", argv[i]); + } + return 0; +} |