From 2946364ce6ad760f732d1042e3206a0fe0a456d6 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 4 Feb 2015 15:19:30 +0100 Subject: Add unit tests. These test the complete workflow as the user experiences it when clicking "Start". Intended usage: (1) Run sdktool to set up a kit with the toolchain you want to test against (using a temporary directory). The tests assume exactly one Kit to be present. (2) Start Creator with a matching settings path and "-load ClangStaticAnalyzer -test ClangStaticAnalyzer". (3) Repeat until all toolchains have been tested. The initial implementation tests one trivial source file with both qbs and qmake. Change-Id: I810f23e2990a789a4dd9f1dd16335fbcf5c5f39f Reviewed-by: Nikolai Kosjar --- plugins/clangstaticanalyzer/unit-tests/simple/main.cpp | 5 +++++ plugins/clangstaticanalyzer/unit-tests/simple/simple.pro | 3 +++ plugins/clangstaticanalyzer/unit-tests/simple/simple.qbs | 5 +++++ 3 files changed, 13 insertions(+) create mode 100644 plugins/clangstaticanalyzer/unit-tests/simple/main.cpp create mode 100644 plugins/clangstaticanalyzer/unit-tests/simple/simple.pro create mode 100644 plugins/clangstaticanalyzer/unit-tests/simple/simple.qbs (limited to 'plugins/clangstaticanalyzer/unit-tests') diff --git a/plugins/clangstaticanalyzer/unit-tests/simple/main.cpp b/plugins/clangstaticanalyzer/unit-tests/simple/main.cpp new file mode 100644 index 0000000000..af917a3a33 --- /dev/null +++ b/plugins/clangstaticanalyzer/unit-tests/simple/main.cpp @@ -0,0 +1,5 @@ +int main() +{ + int *i = 0; + *i = 42; +} diff --git a/plugins/clangstaticanalyzer/unit-tests/simple/simple.pro b/plugins/clangstaticanalyzer/unit-tests/simple/simple.pro new file mode 100644 index 0000000000..fb560c2af6 --- /dev/null +++ b/plugins/clangstaticanalyzer/unit-tests/simple/simple.pro @@ -0,0 +1,3 @@ +CONFIG -= QT + +SOURCES = main.cpp diff --git a/plugins/clangstaticanalyzer/unit-tests/simple/simple.qbs b/plugins/clangstaticanalyzer/unit-tests/simple/simple.qbs new file mode 100644 index 0000000000..f6ae698a0c --- /dev/null +++ b/plugins/clangstaticanalyzer/unit-tests/simple/simple.qbs @@ -0,0 +1,5 @@ +import qbs + +CppApplication { + files: ["main.cpp"] +} -- cgit v1.2.1