Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,9 @@ if (BUILD_TESTING)
find_package(GTest CONFIG REQUIRED)
set(googleapis_functions_framework_examples_unit_tests
# cmake-format: sort
cloud_event_examples_test.cc http_examples_test.cc
http_integration_test.cc http_unit_test.cc site_test.cc)
cloud_event_examples_test.cc http_examples_test.cc site_test.cc)

set(googleapis_functions_framework_examples_programs
# cmake-format: sort
http_integration_server.cc)

foreach (fname ${googleapis_functions_framework_examples_unit_tests}
${googleapis_functions_framework_examples_programs})
foreach (fname ${googleapis_functions_framework_examples_unit_tests})
string(REPLACE "/" "_" target "${fname}")
string(REPLACE ".cc" "" target "${target}")
add_executable("${target}" ${fname})
Expand All @@ -75,11 +69,8 @@ if (BUILD_TESTING)
PRIVATE functions_framework_examples googleapis_functions_framework
Boost::filesystem GTest::gmock_main GTest::gmock
GTest::gtest)
endforeach ()

foreach (fname ${googleapis_functions_framework_examples_unit_tests})
string(REPLACE "/" "_" target "${fname}")
string(REPLACE ".cc" "" target "${target}")
add_test(NAME ${target} COMMAND ${target})
endforeach ()
endif ()

add_subdirectory(site/testing_http)
44 changes: 44 additions & 0 deletions examples/site/testing_http/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# ~~~
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ~~~

if (BUILD_TESTING)
find_package(GTest CONFIG REQUIRED)
set(googleapis_functions_framework_examples_unit_tests
# cmake-format: sort
http_integration_test.cc http_unit_test.cc)

set(googleapis_functions_framework_examples_programs
# cmake-format: sort
http_integration_server.cc)

foreach (fname ${googleapis_functions_framework_examples_unit_tests}
${googleapis_functions_framework_examples_programs})
string(REPLACE "/" "_" target "${fname}")
string(REPLACE ".cc" "" target "${target}")
add_executable("${target}" ${fname})
target_link_libraries(
${target}
PRIVATE functions_framework_examples googleapis_functions_framework
Boost::filesystem GTest::gmock_main GTest::gmock
GTest::gtest)
endforeach ()

foreach (fname ${googleapis_functions_framework_examples_unit_tests})
string(REPLACE "/" "_" target "${fname}")
string(REPLACE ".cc" "" target "${target}")
add_test(NAME ${target} COMMAND ${target})
endforeach ()
endif ()