summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Cpplint
diff options
context:
space:
mode:
authorJamie Snape <jamie.snape@kitware.com>2017-01-23 19:47:13 (GMT)
committerJamie Snape <jamie.snape@kitware.com>2017-01-23 19:47:13 (GMT)
commit0618ddf6b1da3a886f12b6ad2b19da49b2f87e28 (patch)
treeadb7c502f13bd571ff192e644de923f195b8fc81 /Tests/RunCMake/Cpplint
parent7b4514fb33cf256ef165b2b28ba4affd1930a957 (diff)
downloadCMake-0618ddf6b1da3a886f12b6ad2b19da49b2f87e28.zip
CMake-0618ddf6b1da3a886f12b6ad2b19da49b2f87e28.tar.gz
CMake-0618ddf6b1da3a886f12b6ad2b19da49b2f87e28.tar.bz2
Add properties to run the cpplint style checker with the compiler
Create a `<LANG>_CPPLINT` target property (initialized by a `CMAKE_<LANG>_CPPLINT` variable) to specify a `cpplint` style checker command line to be run along with the compiler.
Diffstat (limited to 'Tests/RunCMake/Cpplint')
-rw-r--r--Tests/RunCMake/Cpplint/C-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/Cpplint/C-error-Build-result.txt1
-rw-r--r--Tests/RunCMake/Cpplint/C-error-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/Cpplint/C-error-launch-Build-result.txt1
-rw-r--r--Tests/RunCMake/Cpplint/C-error-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/Cpplint/C-error-launch.cmake3
-rw-r--r--Tests/RunCMake/Cpplint/C-error.cmake3
-rw-r--r--Tests/RunCMake/Cpplint/C-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/Cpplint/C-launch.cmake3
-rw-r--r--Tests/RunCMake/Cpplint/C.cmake3
-rw-r--r--Tests/RunCMake/Cpplint/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/Cpplint/CXX-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/Cpplint/CXX-error-Build-result.txt1
-rw-r--r--Tests/RunCMake/Cpplint/CXX-error-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/Cpplint/CXX-error-launch-Build-result.txt1
-rw-r--r--Tests/RunCMake/Cpplint/CXX-error-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/Cpplint/CXX-error-launch.cmake3
-rw-r--r--Tests/RunCMake/Cpplint/CXX-error.cmake3
-rw-r--r--Tests/RunCMake/Cpplint/CXX-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/Cpplint/CXX-launch.cmake3
-rw-r--r--Tests/RunCMake/Cpplint/CXX.cmake3
-rw-r--r--Tests/RunCMake/Cpplint/RunCMakeTest.cmake26
-rw-r--r--Tests/RunCMake/Cpplint/main.c4
-rw-r--r--Tests/RunCMake/Cpplint/main.cxx4
24 files changed, 73 insertions, 0 deletions
diff --git a/Tests/RunCMake/Cpplint/C-Build-stdout.txt b/Tests/RunCMake/Cpplint/C-Build-stdout.txt
new file mode 100644
index 0000000..6a22b79
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/C-Build-stdout.txt
@@ -0,0 +1 @@
+Total errors found: 0
diff --git a/Tests/RunCMake/Cpplint/C-error-Build-result.txt b/Tests/RunCMake/Cpplint/C-error-Build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/C-error-Build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/Cpplint/C-error-Build-stdout.txt b/Tests/RunCMake/Cpplint/C-error-Build-stdout.txt
new file mode 100644
index 0000000..3e7a1e9
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/C-error-Build-stdout.txt
@@ -0,0 +1 @@
+Tests[/\]RunCMake[/\]Cpplint[/\]main\.c:0: message \[category/category\] \[0\]
diff --git a/Tests/RunCMake/Cpplint/C-error-launch-Build-result.txt b/Tests/RunCMake/Cpplint/C-error-launch-Build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/C-error-launch-Build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/Cpplint/C-error-launch-Build-stdout.txt b/Tests/RunCMake/Cpplint/C-error-launch-Build-stdout.txt
new file mode 100644
index 0000000..3e7a1e9
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/C-error-launch-Build-stdout.txt
@@ -0,0 +1 @@
+Tests[/\]RunCMake[/\]Cpplint[/\]main\.c:0: message \[category/category\] \[0\]
diff --git a/Tests/RunCMake/Cpplint/C-error-launch.cmake b/Tests/RunCMake/Cpplint/C-error-launch.cmake
new file mode 100644
index 0000000..c76e2e2
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/C-error-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(C-error.cmake)
diff --git a/Tests/RunCMake/Cpplint/C-error.cmake b/Tests/RunCMake/Cpplint/C-error.cmake
new file mode 100644
index 0000000..29cf7ba
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/C-error.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+set(CMAKE_C_CPPLINT "${PSEUDO_CPPLINT}" --error)
+add_executable(main main.c)
diff --git a/Tests/RunCMake/Cpplint/C-launch-Build-stdout.txt b/Tests/RunCMake/Cpplint/C-launch-Build-stdout.txt
new file mode 100644
index 0000000..6a22b79
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/C-launch-Build-stdout.txt
@@ -0,0 +1 @@
+Total errors found: 0
diff --git a/Tests/RunCMake/Cpplint/C-launch.cmake b/Tests/RunCMake/Cpplint/C-launch.cmake
new file mode 100644
index 0000000..e66ca20
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/C-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(C.cmake)
diff --git a/Tests/RunCMake/Cpplint/C.cmake b/Tests/RunCMake/Cpplint/C.cmake
new file mode 100644
index 0000000..68e6ff4
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/C.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+set(CMAKE_C_CPPLINT "${PSEUDO_CPPLINT}" --verbose=0 --linelength=80)
+add_executable(main main.c)
diff --git a/Tests/RunCMake/Cpplint/CMakeLists.txt b/Tests/RunCMake/Cpplint/CMakeLists.txt
new file mode 100644
index 0000000..a640c56
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.7)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Cpplint/CXX-Build-stdout.txt b/Tests/RunCMake/Cpplint/CXX-Build-stdout.txt
new file mode 100644
index 0000000..6a22b79
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CXX-Build-stdout.txt
@@ -0,0 +1 @@
+Total errors found: 0
diff --git a/Tests/RunCMake/Cpplint/CXX-error-Build-result.txt b/Tests/RunCMake/Cpplint/CXX-error-Build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CXX-error-Build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/Cpplint/CXX-error-Build-stdout.txt b/Tests/RunCMake/Cpplint/CXX-error-Build-stdout.txt
new file mode 100644
index 0000000..028cd37
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CXX-error-Build-stdout.txt
@@ -0,0 +1 @@
+Tests[/\]RunCMake[/\]Cpplint[/\]main\.cxx:0: message \[category\/category\] \[0\]
diff --git a/Tests/RunCMake/Cpplint/CXX-error-launch-Build-result.txt b/Tests/RunCMake/Cpplint/CXX-error-launch-Build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CXX-error-launch-Build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/Cpplint/CXX-error-launch-Build-stdout.txt b/Tests/RunCMake/Cpplint/CXX-error-launch-Build-stdout.txt
new file mode 100644
index 0000000..028cd37
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CXX-error-launch-Build-stdout.txt
@@ -0,0 +1 @@
+Tests[/\]RunCMake[/\]Cpplint[/\]main\.cxx:0: message \[category\/category\] \[0\]
diff --git a/Tests/RunCMake/Cpplint/CXX-error-launch.cmake b/Tests/RunCMake/Cpplint/CXX-error-launch.cmake
new file mode 100644
index 0000000..72dcbe9
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CXX-error-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(CXX-error.cmake)
diff --git a/Tests/RunCMake/Cpplint/CXX-error.cmake b/Tests/RunCMake/Cpplint/CXX-error.cmake
new file mode 100644
index 0000000..ad66ff5
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CXX-error.cmake
@@ -0,0 +1,3 @@
+enable_language(CXX)
+set(CMAKE_CXX_CPPLINT "${PSEUDO_CPPLINT}" --error)
+add_executable(main main.cxx)
diff --git a/Tests/RunCMake/Cpplint/CXX-launch-Build-stdout.txt b/Tests/RunCMake/Cpplint/CXX-launch-Build-stdout.txt
new file mode 100644
index 0000000..6a22b79
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CXX-launch-Build-stdout.txt
@@ -0,0 +1 @@
+Total errors found: 0
diff --git a/Tests/RunCMake/Cpplint/CXX-launch.cmake b/Tests/RunCMake/Cpplint/CXX-launch.cmake
new file mode 100644
index 0000000..3002c9d
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CXX-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(CXX.cmake)
diff --git a/Tests/RunCMake/Cpplint/CXX.cmake b/Tests/RunCMake/Cpplint/CXX.cmake
new file mode 100644
index 0000000..35f05ee
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/CXX.cmake
@@ -0,0 +1,3 @@
+enable_language(CXX)
+set(CMAKE_CXX_CPPLINT "${PSEUDO_CPPLINT}" --verbose=0 --linelength=80)
+add_executable(main main.cxx)
diff --git a/Tests/RunCMake/Cpplint/RunCMakeTest.cmake b/Tests/RunCMake/Cpplint/RunCMakeTest.cmake
new file mode 100644
index 0000000..5a8471e
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/RunCMakeTest.cmake
@@ -0,0 +1,26 @@
+include(RunCMake)
+
+set(RunCMake_TEST_OPTIONS "-DPSEUDO_CPPLINT=${PSEUDO_CPPLINT}")
+
+function(run_cpplint lang)
+ # Use a single build tree for tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${lang}-build")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(${lang})
+ set(RunCMake_TEST_OUTPUT_MERGE 1)
+ run_cmake_command(${lang}-Build ${CMAKE_COMMAND} --build .)
+endfunction()
+
+run_cpplint(C)
+run_cpplint(CXX)
+run_cpplint(C-error)
+run_cpplint(CXX-error)
+
+if(NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
+ run_cpplint(C-launch)
+ run_cpplint(CXX-launch)
+ run_cpplint(C-error-launch)
+ run_cpplint(CXX-error-launch)
+endif()
diff --git a/Tests/RunCMake/Cpplint/main.c b/Tests/RunCMake/Cpplint/main.c
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/main.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/Cpplint/main.cxx b/Tests/RunCMake/Cpplint/main.cxx
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/RunCMake/Cpplint/main.cxx
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}