blob: 2bc7e9e691048dc5306a477878673bcf36470356 [file] [log] [blame]
Nobuaki Sukegawa11da87e2016-09-10 14:02:19 +09001#
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
James E. King IIIc9ac8d22019-01-07 16:46:45 -050020# Unit tests for the compiler still require boost
21include(BoostMacros)
22REQUIRE_BOOST_HEADERS()
23set(BOOST_COMPONENTS unit_test_framework)
24REQUIRE_BOOST_LIBRARIES(BOOST_COMPONENTS)
Nobuaki Sukegawa11da87e2016-09-10 14:02:19 +090025
nsrtvwls014f53f2018-09-28 08:11:21 -070026file(GLOB KEYWORD_SAMPLES "${CMAKE_CURRENT_SOURCE_DIR}/keyword-samples/*.thrift")
27foreach(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()
35endforeach()
36
37
James E. King III278528c2019-01-11 12:17:44 -050038find_package(PythonInterp QUIET)
39if(PYTHONINTERP_FOUND)
40 add_test(NAME StalenessCheckTest COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/compiler/staleness_check.py ${THRIFT_COMPILER})
41else()
42 message(WARNING "Skipping StalenessCheckTest as there is no python interpreter available.")
James E. King III29f7f8f2019-01-26 09:15:19 -050043endif()