]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/thrift/compiler/cpp/test/CMakeLists.txt
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / jaegertracing / thrift / compiler / cpp / test / CMakeLists.txt
1 #
2 # Licensed to the Apache Software Foundation (ASF) under one
3 # or more contributor license agreements. See the NOTICE file
4 # distributed with this work for additional information
5 # regarding copyright ownership. The ASF licenses this file
6 # to you under the Apache License, Version 2.0 (the
7 # "License"); you may not use this file except in compliance
8 # with the License. You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing,
13 # software distributed under the License is distributed on an
14 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 # KIND, either express or implied. See the License for the
16 # specific language governing permissions and limitations
17 # under the License.
18 #
19
20 # Unit tests for the compiler still require boost
21 include(BoostMacros)
22 REQUIRE_BOOST_HEADERS()
23 set(BOOST_COMPONENTS unit_test_framework)
24 REQUIRE_BOOST_LIBRARIES(BOOST_COMPONENTS)
25
26 file(GLOB KEYWORD_SAMPLES "${CMAKE_CURRENT_SOURCE_DIR}/keyword-samples/*.thrift")
27 foreach(LANG ${thrift_compiler_LANGS})
28 foreach(SAMPLE ${KEYWORD_SAMPLES})
29 get_filename_component(FILENAME ${SAMPLE} NAME_WE)
30 add_test(NAME "${LANG}_${FILENAME}"
31 COMMAND thrift-compiler --gen ${LANG} ${SAMPLE})
32 set_tests_properties("${LANG}_${FILENAME}" PROPERTIES
33 PASS_REGULAR_EXPRESSION "Cannot use reserved language keyword")
34 endforeach()
35 endforeach()
36
37
38 find_package(PythonInterp QUIET)
39 if(PYTHONINTERP_FOUND)
40 add_test(NAME StalenessCheckTest COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/compiler/staleness_check.py ${THRIFT_COMPILER})
41 else()
42 message(WARNING "Skipping StalenessCheckTest as there is no python interpreter available.")
43 endif()