diff --git a/Units/parser-cmake.r/cmake-comments.d/expected.tags b/Units/parser-cmake.r/cmake-comments.d/expected.tags new file mode 100644 index 0000000000..4dd2b76388 --- /dev/null +++ b/Units/parser-cmake.r/cmake-comments.d/expected.tags @@ -0,0 +1,3 @@ +another_good_target input.cmake /^add_library(another_good_target# <-- target$/;" t +good_target input.cmake /^ good_target# this is legal comment placement I think$/;" t +tag_this input.cmake /^]]set(tag_this)$/;" v diff --git a/Units/parser-cmake.r/cmake-comments.d/input.cmake b/Units/parser-cmake.r/cmake-comments.d/input.cmake new file mode 100644 index 0000000000..3cbd2c99b7 --- /dev/null +++ b/Units/parser-cmake.r/cmake-comments.d/input.cmake @@ -0,0 +1,17 @@ +# this is a test of comments set(DO_NOT_TAG "foo") + +#[[ +multi-linecomments +option(DO_NOT_TAG "foo" OFF) +] not the end +]]set(tag_this) + +add_custom_target(# comment set(NO_TAG "foo") + # anothe rline comment + good_target# this is legal comment placement I think + ALL) + +add_library(another_good_target# <-- target + SHARED # <-- lib type + gmock-all.cc + ) diff --git a/Units/parser-cmake.r/cmake-function.d/expected.tags b/Units/parser-cmake.r/cmake-function.d/expected.tags new file mode 100644 index 0000000000..2fc7474cab --- /dev/null +++ b/Units/parser-cmake.r/cmake-function.d/expected.tags @@ -0,0 +1,5 @@ +Bfunctiontag_this_2 input.cmake /^ function( Bfunctiontag_this_2 ${BAR})$/;" f +cxx_shared_library input.cmake /^function(cxx_shared_library name cxx_flags)$/;" f +d_ALSO_Tag_this input.cmake /^ d_ALSO_Tag_this$/;" f +eLastlyTagThis_ input.cmake /^eLastlyTagThis_ "hello")$/;" f +tag_this1 input.cmake /^function(tag_this1)$/;" f diff --git a/Units/parser-cmake.r/cmake-function.d/input.cmake b/Units/parser-cmake.r/cmake-function.d/input.cmake new file mode 100644 index 0000000000..902d0602b5 --- /dev/null +++ b/Units/parser-cmake.r/cmake-function.d/input.cmake @@ -0,0 +1,19 @@ +function(tag_this1) +endfunction(tag_this1) + function( Bfunctiontag_this_2 ${BAR}) + +function(cxx_shared_library name cxx_flags) + cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN}) +endfunction() + + FUNCTION ( + d_ALSO_Tag_this + true) + +Function( +eLastlyTagThis_ "hello") + +function(${not_this} foo) +function(not-this foo) +function(not.this foo) +function(1notthis foo) diff --git a/Units/parser-cmake.r/cmake-macro.d/expected.tags b/Units/parser-cmake.r/cmake-macro.d/expected.tags new file mode 100644 index 0000000000..36f38b98d8 --- /dev/null +++ b/Units/parser-cmake.r/cmake-macro.d/expected.tags @@ -0,0 +1,5 @@ +Bmacrotag_this_2 input.cmake /^ macro( Bmacrotag_this_2 ${BAR})$/;" m +cxx_shared_library input.cmake /^macro(cxx_shared_library name cxx_flags)$/;" m +d_ALSO_Tag_this input.cmake /^ d_ALSO_Tag_this$/;" m +eLastlyTagThis_ input.cmake /^eLastlyTagThis_ "hello")$/;" m +tag_this1 input.cmake /^macro(tag_this1)$/;" m diff --git a/Units/parser-cmake.r/cmake-macro.d/input.cmake b/Units/parser-cmake.r/cmake-macro.d/input.cmake new file mode 100644 index 0000000000..692b985d19 --- /dev/null +++ b/Units/parser-cmake.r/cmake-macro.d/input.cmake @@ -0,0 +1,19 @@ +macro(tag_this1) +endmacro(tag_this1) + macro( Bmacrotag_this_2 ${BAR}) + +macro(cxx_shared_library name cxx_flags) + cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN}) +endmacro() + + MACRO ( + d_ALSO_Tag_this + true) + +Macro( +eLastlyTagThis_ "hello") + +macro(${not_this} foo) +macro(not-this foo) +macro(not.this foo) +macro(1not_this foo) diff --git a/Units/parser-cmake.r/cmake-option.d/expected.tags b/Units/parser-cmake.r/cmake-option.d/expected.tags new file mode 100644 index 0000000000..12c8d643b9 --- /dev/null +++ b/Units/parser-cmake.r/cmake-option.d/expected.tags @@ -0,0 +1,5 @@ +1_tag_this input.cmake /^option(1_tag_this foo)$/;" D +B-option-tag_this_2 input.cmake /^option(B-option-tag_this_2 ${BAR})$/;" D +c_TAG_THIS input.cmake /^ option ( c_TAG_THIS but_not_this)$/;" D +d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this$/;" D +e.LastlyTagThis input.cmake /^e.LastlyTagThis "hello")$/;" D diff --git a/Units/parser-cmake.r/cmake-option.d/input.cmake b/Units/parser-cmake.r/cmake-option.d/input.cmake new file mode 100644 index 0000000000..c7f2fa9b8b --- /dev/null +++ b/Units/parser-cmake.r/cmake-option.d/input.cmake @@ -0,0 +1,15 @@ +option(1_tag_this foo) +option(B-option-tag_this_2 ${BAR}) + + option ( c_TAG_THIS but_not_this) + + OPTION ( + d-ALSO-Tag.this + true) + +Option( +e.LastlyTagThis "hello") + +option(${not_this} foo) +option(${ not_this } foo) +option(not~this foo) diff --git a/Units/parser-cmake.r/cmake-project.d/expected.tags b/Units/parser-cmake.r/cmake-project.d/expected.tags new file mode 100644 index 0000000000..2f696efce4 --- /dev/null +++ b/Units/parser-cmake.r/cmake-project.d/expected.tags @@ -0,0 +1,5 @@ +1_tag_this input.cmake /^project(1_tag_this)$/;" p +B-project-tag_this_2 input.cmake /^project(B-project-tag_this_2 ${BAR})$/;" p +c_TAG_THIS input.cmake /^ project ( c_TAG_THIS but_not_this)$/;" p +d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this$/;" p +e.LastlyTagThis input.cmake /^e.LastlyTagThis "hello")$/;" p diff --git a/Units/parser-cmake.r/cmake-project.d/input.cmake b/Units/parser-cmake.r/cmake-project.d/input.cmake new file mode 100644 index 0000000000..88407ff688 --- /dev/null +++ b/Units/parser-cmake.r/cmake-project.d/input.cmake @@ -0,0 +1,15 @@ +project(1_tag_this) +project(B-project-tag_this_2 ${BAR}) + + project ( c_TAG_THIS but_not_this) + + PROJECT ( + d-ALSO-Tag.this + ) + +Project( +e.LastlyTagThis "hello") + +project(${not_this}) +project(${ not_this }) +project(not/this) diff --git a/Units/parser-cmake.r/cmake-simple.d/expected.tags b/Units/parser-cmake.r/cmake-simple.d/expected.tags new file mode 100644 index 0000000000..a463ac6f14 --- /dev/null +++ b/Units/parser-cmake.r/cmake-simple.d/expected.tags @@ -0,0 +1,6 @@ +BUILD_GMOCK input.cmake /^option(BUILD_GMOCK "Builds the googlemock subproject" ON)$/;" D +BUILD_GTEST input.cmake /^option(BUILD_GTEST "Builds the googletest subproject" OFF)$/;" D +CMAKE_INSTALL_BINDIR input.cmake /^ set(CMAKE_INSTALL_BINDIR "bin" CACHE STRING "User executables (bin)")$/;" v +CMAKE_INSTALL_INCLUDEDIR input.cmake /^ set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "C header files (include)")$/;" v +CMAKE_INSTALL_LIBDIR input.cmake /^ set(CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE STRING "Object code libraries (lib)")$/;" v +googletest-distribution input.cmake /^project( googletest-distribution )$/;" p diff --git a/Units/parser-cmake.r/cmake-simple.d/input.cmake b/Units/parser-cmake.r/cmake-simple.d/input.cmake new file mode 100644 index 0000000000..5e231141dd --- /dev/null +++ b/Units/parser-cmake.r/cmake-simple.d/input.cmake @@ -0,0 +1,34 @@ +# taken from https://github.com/google/googletest/blob/master/CMakeLists.txt +cmake_minimum_required(VERSION 2.6.4) + +if (POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif (POLICY CMP0048) + +project( googletest-distribution ) + +enable_testing() + +include(CMakeDependentOption) +if (CMAKE_VERSION VERSION_LESS 2.8.5) + set(CMAKE_INSTALL_BINDIR "bin" CACHE STRING "User executables (bin)") + set(CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE STRING "Object code libraries (lib)") + set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "C header files (include)") + mark_as_advanced(CMAKE_INSTALL_BINDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR) +else() + include(GNUInstallDirs) +endif() + +option(BUILD_GTEST "Builds the googletest subproject" OFF) + +#Note that googlemock target already builds googletest +option(BUILD_GMOCK "Builds the googlemock subproject" ON) + +cmake_dependent_option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON "BUILD_GTEST OR BUILD_GMOCK" OFF) +cmake_dependent_option(INSTALL_GMOCK "Enable installation of googlemock. (Projects embedding googlemock may want to turn this OFF.)" ON "BUILD_GMOCK" OFF) + +if(BUILD_GMOCK) + add_subdirectory( googlemock ) +elseif(BUILD_GTEST) + add_subdirectory( googletest ) +endif() diff --git a/Units/parser-cmake.r/cmake-target.d/expected.tags b/Units/parser-cmake.r/cmake-target.d/expected.tags new file mode 100644 index 0000000000..5e58d31811 --- /dev/null +++ b/Units/parser-cmake.r/cmake-target.d/expected.tags @@ -0,0 +1,15 @@ +1_tag_this input.cmake /^add_custom_target(1_tag_this)$/;" t +1_tag_this input.cmake /^add_executable(1_tag_this)$/;" t +1_tag_this input.cmake /^add_library(1_tag_this)$/;" t +B-add_custom_target-tag_this_2 input.cmake /^add_custom_target(B-add_custom_target-tag_this_2 ${BAR})$/;" t +B-add_executable-tag_this_2 input.cmake /^add_executable(B-add_executable-tag_this_2 ${BAR})$/;" t +B-add_library-tag_this_2 input.cmake /^add_library(B-add_library-tag_this_2 ${BAR})$/;" t +c_TAG_THIS input.cmake /^ add_custom_target ( c_TAG_THIS but_not_this)$/;" t +c_TAG_THIS input.cmake /^ add_executable ( c_TAG_THIS but_not_this)$/;" t +c_TAG_THIS input.cmake /^ add_library ( c_TAG_THIS but_not_this)$/;" t +d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this$/;" t +d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this $/;" t +d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this$/;" t +e.LastlyTagThis input.cmake /^e.LastlyTagThis "CustomTarget")$/;" t +e.LastlyTagThis input.cmake /^e.LastlyTagThis "Executable")$/;" t +e.LastlyTagThis input.cmake /^e.LastlyTagThis "Library")$/;" t diff --git a/Units/parser-cmake.r/cmake-target.d/input.cmake b/Units/parser-cmake.r/cmake-target.d/input.cmake new file mode 100644 index 0000000000..32e27e326d --- /dev/null +++ b/Units/parser-cmake.r/cmake-target.d/input.cmake @@ -0,0 +1,49 @@ +add_custom_target(1_tag_this) +add_custom_target(B-add_custom_target-tag_this_2 ${BAR}) + + add_custom_target ( c_TAG_THIS but_not_this) + + ADD_CUSTOM_TARGET ( + d-ALSO-Tag.this + ) + +Add_Custom_target( +e.LastlyTagThis "CustomTarget") + +add_custom_target(${not_this}) +add_custom_target(${ not_this }) +add_custom_target(not/this) + + +add_executable(1_tag_this) +add_executable(B-add_executable-tag_this_2 ${BAR}) + + add_executable ( c_TAG_THIS but_not_this) + + ADD_EXECUTABLE ( + d-ALSO-Tag.this + ) + +Add_Executable( +e.LastlyTagThis "Executable") + +add_executable(${not_this}) +add_executable(${ not_this }) +add_executable(not/this) + + +add_library(1_tag_this) +add_library(B-add_library-tag_this_2 ${BAR}) + + add_library ( c_TAG_THIS but_not_this) + + ADD_LIBRARY ( + d-ALSO-Tag.this + ) + +Add_Library( +e.LastlyTagThis "Library") + +add_library(${not_this}) +add_library(${ not_this }) +add_library(not/this) diff --git a/Units/parser-cmake.r/cmake-variable.d/expected.tags b/Units/parser-cmake.r/cmake-variable.d/expected.tags new file mode 100644 index 0000000000..ed82fa930c --- /dev/null +++ b/Units/parser-cmake.r/cmake-variable.d/expected.tags @@ -0,0 +1,5 @@ +1_tag_this input.cmake /^set(1_tag_this foo)$/;" v +B-set-tag_this_2 input.cmake /^set(B-set-tag_this_2 ${BAR})$/;" v +c_TAG_THIS input.cmake /^ set ( c_TAG_THIS but_not_this)$/;" v +d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this$/;" v +e.LastlyTagThis input.cmake /^e.LastlyTagThis "hello")$/;" v diff --git a/Units/parser-cmake.r/cmake-variable.d/input.cmake b/Units/parser-cmake.r/cmake-variable.d/input.cmake new file mode 100644 index 0000000000..950566187a --- /dev/null +++ b/Units/parser-cmake.r/cmake-variable.d/input.cmake @@ -0,0 +1,13 @@ +set(1_tag_this foo) +set(B-set-tag_this_2 ${BAR}) + + set ( c_TAG_THIS but_not_this) + + SET ( + d-ALSO-Tag.this + true) + +Set( +e.LastlyTagThis "hello") + +set(${not_this} foo)