diff --git a/.travis.yml b/.travis.yml index 589dc3c3..279d5f67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,8 +76,8 @@ script: - if [ "$BOND_LANG" == "cs" ]; then make --jobs 2 DESTDIR=$HOME install; fi - if [ "$BOND_LANG" == "cs" ]; then export BOND_COMPILER_PATH=$HOME/usr/local/bin; fi - if [[ $BOND_LANG == cpp* ]]; then make --jobs 2 check; fi - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export BOND_PYTHON_TARGETS="bond_python_unit_test python_extension" BOND_PYTHON_TESTS=bond_python_unit_test; fi - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export BOND_PYTHON_TARGETS="bond_python_compatibility_test bond_python_unit_test python_extension bond_compatibility_test" BOND_PYTHON_TESTS=".*python.*"; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export BOND_PYTHON_TARGETS="python_unit_test python_extension" BOND_PYTHON_TESTS=python_unit_test; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export BOND_PYTHON_TARGETS="python_compatibility_test python_unit_test python_extension compatibility_test" BOND_PYTHON_TESTS=".*python.*"; fi - if [[ $BOND_LANG == py* ]]; then make $BOND_PYTHON_TARGETS; fi - if [[ $BOND_LANG == py* ]]; then ctest --tests-regex $BOND_PYTHON_TESTS --output-on-failure; fi - if [ "$BOND_GHC_VERSION" != "" ]; then make gbc-tests; fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 62e49668..d474b38a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,9 +22,9 @@ include (PythonTest) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -C ${CMAKE_CFG_INTDIR} --output-on-failure) -add_subdirectory (compiler) +add_subfolder (compiler "compiler") add_subdirectory (cpp) -add_subdirectory (doc) +add_subfolder (doc "doc") add_python_subdirectory (python) add_subdirectory (examples) diff --git a/appveyor.yml b/appveyor.yml index e307d4aa..9f548a71 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -177,7 +177,7 @@ if ($env:BOND_BUILD -eq "Python") { - cmake --build . --target bond_python_unit_test -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + cmake --build . --target python_unit_test -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" } @@ -201,7 +201,7 @@ if ($env:BOND_BUILD -eq "Python") { - ctest -C Debug --tests-regex bond_python_unit_test --output-on-failure + ctest -C Debug --tests-regex python_unit_test --output-on-failure } diff --git a/cmake/Bond.cmake b/cmake/Bond.cmake index d4217681..5bb1d7dd 100644 --- a/cmake/Bond.cmake +++ b/cmake/Bond.cmake @@ -1,9 +1,10 @@ include (CMakeParseArguments) +include (Folders) # -# add_bond_codegen (file.bond [file2.bond ...] +# add_bond_codegen (file.bond [file2.bond ...] # [ENUM_HEADER] -# [OUTPUT_DIR dir] +# [OUTPUT_DIR dir] # [IMPORT_DIR dir [dir2, ...]] # [OPTIONS opt [opt2 ...]]) # [TARGET name] @@ -12,7 +13,7 @@ function (add_bond_codegen) set (flagArgs ENUM_HEADER) set (oneValueArgs OUTPUT_DIR TARGET) set (multiValueArgs IMPORT_DIR OPTIONS) - cmake_parse_arguments (arg "${flagArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments (arg "${flagArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) set (options) set (outputDir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}) if (arg_OUTPUT_DIR) @@ -23,7 +24,7 @@ function (add_bond_codegen) list (APPEND options --import-dir="${BOND_INCLUDE}") foreach (dir ${arg_IMPORT_DIR}) list(APPEND options --import-dir="${dir}") - endforeach() + endforeach() foreach (opt ${arg_OPTIONS}) list (APPEND options "${opt}") endforeach() @@ -34,7 +35,7 @@ function (add_bond_codegen) set (outputs) foreach (file ${inputs}) get_filename_component (name ${file} NAME_WE) - list (APPEND outputs + list (APPEND outputs "${outputDir}/${name}_reflection.h" "${outputDir}/${name}_types.h" "${outputDir}/${name}_types.cpp" @@ -54,6 +55,7 @@ function (add_bond_codegen) add_custom_target (${arg_TARGET} DEPENDS ${outputs} SOURCES ${inputs}) + add_target_to_folder(${arg_TARGET}) endif() endfunction() @@ -77,11 +79,12 @@ function (add_bond_executable target) add_bond_codegen (${schemas}) endif() add_executable (${ARGV} ${sources}) + add_target_to_folder(${target}) target_link_libraries (${target} PRIVATE - bond + bond bond_apply) - target_include_directories (${target} PRIVATE - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} + target_include_directories (${target} PRIVATE + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} ${CMAKE_CURRENT_SOURCE_DIR}) endfunction() @@ -95,7 +98,7 @@ function (add_bond_test test) add_bond_executable (${ARGV}) add_dependencies (check ${test}) add_test ( - NAME ${test} + NAME ${test} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${test}) endfunction() @@ -122,19 +125,19 @@ function (add_bond_python_module target) list (INSERT ARGV 1 EXCLUDE_FROM_ALL) python_add_module (${ARGV} ${sources}) add_dependencies (check ${target}) - target_link_libraries (${target} PRIVATE + add_target_to_folder(${target}) + target_link_libraries (${target} PRIVATE bond - bond_apply + bond_apply ${PYTHON_LIBRARIES} ${Boost_PYTHON_LIBRARY}) target_include_directories (${target} PRIVATE ${BOND_PYTHON_INCLUDE} ${WINDOWSSDK_PREFERRED_DIR}/Include ${WINDOWSSDK_PREFERRED_DIR}/Include/shared - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} ${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_INCLUDE_DIR}) target_compile_definitions (${target} PRIVATE -DBOOST_PYTHON_STATIC_LIB) endfunction() - diff --git a/cmake/Folders.cmake b/cmake/Folders.cmake new file mode 100644 index 00000000..badc50f4 --- /dev/null +++ b/cmake/Folders.cmake @@ -0,0 +1,20 @@ +set_property (GLOBAL PROPERTY USE_FOLDERS On) + +# +# Add the target to "current" folder +# +function (add_target_to_folder target) + set_property (GLOBAL APPEND PROPERTY bond_targets ${target}) +endfunction() + +# +# add_subfolder (subdirectory folder) +# similar to built-in add_subdirectory but groups targets in specified folder +# +macro (add_subfolder dir folder) + set_property (GLOBAL PROPERTY bond_targets) + add_subdirectory (${dir}) + get_property (targets GLOBAL PROPERTY bond_targets) + set_target_properties (${targets} PROPERTIES FOLDER ${folder}) +endmacro() + diff --git a/compiler/CMakeLists.txt b/compiler/CMakeLists.txt index ae2c7baa..ee961811 100644 --- a/compiler/CMakeLists.txt +++ b/compiler/CMakeLists.txt @@ -4,6 +4,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) include (CMakeParseArguments) +include (Folders) # required Haskell components find_package (Cabal 1.18.0.0 REQUIRED) @@ -18,10 +19,10 @@ function (add_cabal_build target) endif() add_custom_command ( DEPENDS ${arg_SOURCES} - COMMAND ${CMAKE_COMMAND} + COMMAND ${CMAKE_COMMAND} ${CMAKE_BINARY_DIR} -N - -Dbuild_dir=${CMAKE_CURRENT_BINARY_DIR} + -Dbuild_dir=${CMAKE_CURRENT_BINARY_DIR} -Dtarget=${target} -Dcabal_options=${options} -P cabal_build.cmake @@ -29,16 +30,17 @@ function (add_cabal_build target) OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/build/${target}/${target}${CMAKE_EXECUTABLE_SUFFIX}) add_custom_target (${target} SOURCES ${arg_SOURCES} - DEPENDS ${arg_DEPENDS} + DEPENDS ${arg_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/build/${target}/${target}${CMAKE_EXECUTABLE_SUFFIX}) - add_dependencies (${target} sandbox) -endfunction() + add_target_to_folder(${target}) + add_dependencies (${target} sandbox) +endfunction() function (add_cabal_test target) - list (INSERT ${target} 0 EXCLUDE_FROM_ALL) + list (INSERT ${target} 0 EXCLUDE_FROM_ALL) add_cabal_build (${ARGV} ENABLE_TESTS) add_test ( - NAME ${target} + NAME ${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/build/${target}/${target}) endfunction() @@ -82,8 +84,8 @@ set (output ${CMAKE_CURRENT_BINARY_DIR}/build/gbc/gbc${CMAKE_EXECUTABLE_SUFFIX}) set (GBC_EXECUTABLE ${output} PARENT_SCOPE) add_custom_command ( - COMMAND ${CMAKE_COMMAND} - ${CMAKE_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} + ${CMAKE_BINARY_DIR} -N -P sandbox_init.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} @@ -91,6 +93,7 @@ add_custom_command ( add_custom_target (sandbox DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/cabal.sandbox.config) +add_target_to_folder(sandbox) add_custom_command ( DEPENDS ${output} @@ -111,6 +114,6 @@ install (FILES ${output} if(EXISTS "${completion_dir}" AND IS_DIRECTORY "${completion_dir}") install (FILES ${completion} - RENAME gbc + RENAME gbc DESTINATION ${completion_dir}) endif() diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index ff24dd35..763ff87d 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -1,7 +1,8 @@ # warning C4310: cast truncates constant value cxx_add_compile_options(MSVC /wd4310) -add_subdirectory (compat) +add_subfolder (compat "tests/compat") + if (Boost_UNIT_TEST_FRAMEWORK_FOUND) - add_subdirectory (core) + add_subfolder (core "tests/unit_test/core") endif() diff --git a/cpp/test/compat/CMakeLists.txt b/cpp/test/compat/CMakeLists.txt index b98f14ea..af8d2136 100644 --- a/cpp/test/compat/CMakeLists.txt +++ b/cpp/test/compat/CMakeLists.txt @@ -1,6 +1,6 @@ cxx_add_compile_options(Clang -Wno-unused-value) -add_bond_executable (bond_compatibility_test EXCLUDE_FROM_ALL +add_bond_executable (compatibility_test EXCLUDE_FROM_ALL ${BOND_COMPAT_TEST_DIR}/schemas/compat.bond ${BOND_COMPAT_TEST_DIR}/schemas/compat2.bond ${BOND_COMPAT_TEST_DIR}/schemas/compat_no_generics.bond @@ -9,15 +9,15 @@ add_bond_executable (bond_compatibility_test EXCLUDE_FROM_ALL compat.cpp serialization.cpp) -add_dependencies (check bond_compatibility_test) +add_dependencies (check compatibility_test) -target_compile_definitions (bond_compatibility_test PRIVATE +target_compile_definitions (compatibility_test PRIVATE -DBOND_COMPACT_BINARY_PROTOCOL -DBOND_SIMPLE_BINARY_PROTOCOL -DBOND_FAST_BINARY_PROTOCOL -DBOND_SIMPLE_JSON_PROTOCOL) -target_use_cxx11 (bond_compatibility_test) +target_use_cxx11 (compatibility_test) # disable generation of debug symbols to speed up build no_pdb() @@ -26,7 +26,7 @@ function (add_compat_test test) add_test ( NAME compatibility_${test} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMAND bond_compatibility_test ${test} -d ${BOND_COMPAT_TEST_DIR}/data/compat.${test}.dat expected.cpp.${test} deserialized.cpp.${test}) + COMMAND compatibility_test ${test} -d ${BOND_COMPAT_TEST_DIR}/data/compat.${test}.dat expected.cpp.${test} deserialized.cpp.${test}) if (BOND_CSHARP_COMPAT_TEST) add_test ( @@ -34,7 +34,7 @@ function (add_compat_test test) COMMAND ${CMAKE_COMMAND} -DCSHARP_COMPAT=${BOND_CSHARP_COMPAT_TEST} - -DBOND_COMPAT=$ + -DBOND_COMPAT=$ -DCOMPAT_DATA=${BOND_COMPAT_TEST_DIR}/data -DTEST=${test} -P ${CMAKE_CURRENT_SOURCE_DIR}/compat.cmake diff --git a/cpp/test/core/CMakeLists.txt b/cpp/test/core/CMakeLists.txt index cab3994e..4877c3bc 100644 --- a/cpp/test/core/CMakeLists.txt +++ b/cpp/test/core/CMakeLists.txt @@ -1,13 +1,14 @@ function (add_unit_test_library name) list (INSERT ARGV 1 EXCLUDE_FROM_ALL) add_library (${ARGV}) - add_dependencies (${name} + add_target_to_folder (${name}) + add_dependencies (${name} bond - bond_unit_test_codegen1 - bond_unit_test_codegen2 - bond_unit_test_codegen3) - target_include_directories (${name} PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} + unit_test_codegen1 + unit_test_codegen2 + unit_test_codegen3) + target_include_directories (${name} PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}) target_compile_definitions (${name} PUBLIC # -DENABLE_TEST_CASE=0x20010000 @@ -17,11 +18,11 @@ function (add_unit_test_library name) -DBOND_SIMPLE_JSON_PROTOCOL -DBOOST_ENABLE_ASSERT_HANDLER) target_use_cxx11 (${name}) - target_link_libraries (${name} INTERFACE bond_unit_test_idl bond) - target_link_libraries (bond_unit_test PRIVATE ${name}) -endfunction() + target_link_libraries (${name} INTERFACE unit_test_idl bond) + target_link_libraries (unit_test PRIVATE ${name}) +endfunction() -add_bond_codegen (TARGET bond_unit_test_codegen2 +add_bond_codegen (TARGET unit_test_codegen2 unit_test_core.bond apply_test.bond import_test1.bond @@ -33,7 +34,7 @@ add_bond_codegen (TARGET bond_unit_test_codegen2 OPTIONS --header=\\\"custom_protocols.h\\\") -add_bond_codegen (TARGET bond_unit_test_codegen1 +add_bond_codegen (TARGET unit_test_codegen1 unit_test.bond OPTIONS --using=\"static_string=std::array\" @@ -42,7 +43,7 @@ add_bond_codegen (TARGET bond_unit_test_codegen1 --header=\\\"custom_protocols.h\\\" --header=\\\"container_extensibility.h\\\") -add_bond_codegen (TARGET bond_unit_test_codegen3 +add_bond_codegen (TARGET unit_test_codegen3 allocator_test.bond OPTIONS --using=\"Vector=std::vector<{0}, detail::TestAllocator<{0}> >\" @@ -50,15 +51,16 @@ add_bond_codegen (TARGET bond_unit_test_codegen3 --header=\\\"allocators.h\\\" --allocator=TestAllocator) -add_bond_test (bond_unit_test init.cpp) +add_bond_test (unit_test init.cpp) -target_use_cxx11 (bond_unit_test) +target_use_cxx11 (unit_test) -add_library (bond_unit_test_main EXCLUDE_FROM_ALL main.cpp) +add_library (unit_test_main EXCLUDE_FROM_ALL main.cpp) +add_target_to_folder (unit_test_main) -target_link_libraries (bond_unit_test PRIVATE +target_link_libraries (unit_test PRIVATE ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} - bond_unit_test_main) + unit_test_main) # Full unit test is too big, .pdb files exceed compiler limit; # Since debugging such large executable is not practical anyways, @@ -67,10 +69,10 @@ target_link_libraries (bond_unit_test PRIVATE no_pdb() # split across multiple libraries to parallelize build -add_unit_test_library (bond_unit_test_idl +add_unit_test_library (unit_test_idl idl.cpp) -add_unit_test_library (bond_unit_test_lib1 +add_unit_test_library (unit_test_lib1 skip_id_tests.cpp skip_type_tests.cpp inheritance.cpp @@ -82,9 +84,9 @@ add_unit_test_library (bond_unit_test_lib1 required_fields_tests.cpp custom_protocols.cpp cmdargs.cpp - metadata_tests.cpp) + metadata_tests.cpp) -add_unit_test_library (bond_unit_test_lib2 +add_unit_test_library (unit_test_lib2 json_tests.cpp pass_through.cpp associative_container_extensibility.cpp @@ -92,14 +94,14 @@ add_unit_test_library (bond_unit_test_lib2 apply_init.cpp may_omit_fields.cpp) -add_unit_test_library (bond_unit_test_lib3 +add_unit_test_library (unit_test_lib3 numeric_convertions.cpp) -add_unit_test_library (bond_unit_test_lib4 +add_unit_test_library (unit_test_lib4 generics_test.cpp merge_test.cpp) -add_unit_test_library (bond_unit_test_lib5 +add_unit_test_library (unit_test_lib5 list_tests.cpp serialization_test.cpp allocator_test.cpp @@ -107,7 +109,7 @@ add_unit_test_library (bond_unit_test_lib5 basic_type_lists.cpp nullable.cpp) -add_unit_test_library (bond_unit_test_lib6 +add_unit_test_library (unit_test_lib6 marshal.cpp container_extensibility.cpp basic_type_map.cpp diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 8bb0d2e3..8543c73c 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -5,6 +5,7 @@ set (CMAKE_MODULE_PATH include (CMakeParseArguments) include (HaskellUtil) +include (Folders) # build the compiler when doc directory is build by itself if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) @@ -55,10 +56,11 @@ function (add_pandoc_markdown) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${file} ${PANDOC_EXECUTABLE}) endforeach() - add_custom_target ("documentation_${name}" + add_custom_target (${name} DEPENDS ${outputs} SOURCES ${sources}) - add_dependencies (documentation "documentation_${name}") + add_target_to_folder (${name}) + add_dependencies (documentation ${name}) endfunction() add_custom_command( @@ -71,6 +73,8 @@ add_custom_command( add_custom_target (documentation DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/manual/gbc.html") +add_target_to_folder (documentation) + find_haskell_program (pandoc) if (Haskell_PANDOC_EXECUTABLE) @@ -126,9 +130,11 @@ if (Doxygen_EXECUTABLE) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${doxygen_sources}) - add_custom_target (documentation_cpp_reference + add_custom_target (cpp_reference DEPENDS "${doxygen_output_dir}/cpp/index.html" SOURCES ${doxygen_sources}) - add_dependencies (documentation documentation_cpp_reference) + add_target_to_folder (cpp_reference) + + add_dependencies (documentation cpp_reference) endif() diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt index 154b393f..47707a08 100644 --- a/examples/cpp/CMakeLists.txt +++ b/examples/cpp/CMakeLists.txt @@ -1 +1 @@ -add_subdirectory (core) +add_subfolder (core "examples/core") diff --git a/examples/cpp/core/bf/CMakeLists.txt b/examples/cpp/core/bf/CMakeLists.txt index 92d72dc7..7aa2f4cc 100644 --- a/examples/cpp/core/bf/CMakeLists.txt +++ b/examples/cpp/core/bf/CMakeLists.txt @@ -4,16 +4,16 @@ add_dependencies (check bf) install (TARGETS bf DESTINATION bin) -target_use_cxx11 (bf) +target_use_cxx11 (bf) add_test ( NAME bf - COMMAND + COMMAND ${CMAKE_COMMAND} - -DBF=$ - -DBOND_COMPAT=$ - -DCOMPAT_DATA=${BOND_COMPAT_TEST_DIR}/data - -P ${CMAKE_CURRENT_SOURCE_DIR}/bf_test.cmake + -DBF=$ + -DBOND_COMPAT=$ + -DCOMPAT_DATA=${BOND_COMPAT_TEST_DIR}/data + -P ${CMAKE_CURRENT_SOURCE_DIR}/bf_test.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_test ( diff --git a/examples/cpp/core/static_library/CMakeLists.txt b/examples/cpp/core/static_library/CMakeLists.txt index b3f4ad93..9775e9f2 100644 --- a/examples/cpp/core/static_library/CMakeLists.txt +++ b/examples/cpp/core/static_library/CMakeLists.txt @@ -6,10 +6,12 @@ add_library (static_library_lib EXCLUDE_FROM_ALL ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/static_library_types.cpp ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/static_library_apply.cpp) -target_link_libraries (static_library_lib PUBLIC +add_target_to_folder (static_library_lib) + +target_link_libraries (static_library_lib PUBLIC bond) -add_bond_test (static_library +add_bond_test (static_library exe/static_library.cpp) target_link_libraries (static_library PRIVATE diff --git a/examples/python/CMakeLists.txt b/examples/python/CMakeLists.txt index c28ca5f6..31b4b3d2 100644 --- a/examples/python/CMakeLists.txt +++ b/examples/python/CMakeLists.txt @@ -1,2 +1,2 @@ use_cxx11 () -add_subdirectory (core) +add_subfolder (core "examples/python/core") diff --git a/python/test/CMakeLists.txt b/python/test/CMakeLists.txt index 3b79c66a..1055a922 100644 --- a/python/test/CMakeLists.txt +++ b/python/test/CMakeLists.txt @@ -1,2 +1,2 @@ -add_subdirectory (core) -add_subdirectory (compat) +add_subfolder (core "tests/python/unit_test/core") +add_subfolder (compat "tests/python/compat") diff --git a/python/test/compat/CMakeLists.txt b/python/test/compat/CMakeLists.txt index bc07db48..b5bc388e 100644 --- a/python/test/compat/CMakeLists.txt +++ b/python/test/compat/CMakeLists.txt @@ -1,11 +1,11 @@ -add_bond_python_module (bond_python_compatibility_test +add_bond_python_module (python_compatibility_test ${BOND_COMPAT_TEST_DIR}/schemas/compat.bond ${BOND_COMPAT_TEST_DIR}/schemas/compat2.bond ${BOND_COMPAT_TEST_DIR}/schemas/compat_common.bond compat.cpp compat.py) -target_compile_definitions (bond_python_compatibility_test PRIVATE +target_compile_definitions (python_compatibility_test PRIVATE -DBOND_COMPACT_BINARY_PROTOCOL) # disable generation of debug symbols to speed up build @@ -14,12 +14,12 @@ no_pdb() function (add_python_compat_test test) add_test ( NAME python_compatibility_${test} - COMMAND + COMMAND ${CMAKE_COMMAND} - -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} - -DPYTHON_COMPAT=$ - -DBOND_COMPAT=$ - -DCOMPAT_DATA=${BOND_COMPAT_TEST_DIR}/data + -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + -DPYTHON_COMPAT=$ + -DBOND_COMPAT=$ + -DCOMPAT_DATA=${BOND_COMPAT_TEST_DIR}/data -DTEST=${test} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/compat.cmake diff --git a/python/test/compat/compat.cpp b/python/test/compat/compat.cpp index 11f20bda..9a1b798e 100644 --- a/python/test/compat/compat.cpp +++ b/python/test/compat/compat.cpp @@ -1,7 +1,7 @@ #include "compat_reflection.h" #include -BOOST_PYTHON_MODULE(bond_python_compatibility_test) +BOOST_PYTHON_MODULE(python_compatibility_test) { using namespace unittest::compat; diff --git a/python/test/compat/compat.py b/python/test/compat/compat.py index 4ef941de..e64bd331 100644 --- a/python/test/compat/compat.py +++ b/python/test/compat/compat.py @@ -1,5 +1,5 @@ from __future__ import print_function -import bond_python_compatibility_test as test +import python_compatibility_test as test import sys, getopt def schema(input_, output): diff --git a/python/test/core/CMakeLists.txt b/python/test/core/CMakeLists.txt index 8207dc0e..b4ba93f7 100644 --- a/python/test/core/CMakeLists.txt +++ b/python/test/core/CMakeLists.txt @@ -1,15 +1,15 @@ -add_bond_python_module (bond_python_unit_test +add_bond_python_module (python_unit_test unit_test.cpp unit_test.bond unit_test.py) -target_compile_definitions (bond_python_unit_test PRIVATE +target_compile_definitions (python_unit_test PRIVATE -DBOND_COMPACT_BINARY_PROTOCOL) # disable generation of debug symbols to speed up build no_pdb() add_python_test ( - NAME bond_python_unit_test - MODULE bond_python_unit_test + NAME python_unit_test + MODULE python_unit_test SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/unit_test.py) diff --git a/python/test/core/unit_test.cpp b/python/test/core/unit_test.cpp index 59a0f56e..b99fc49d 100644 --- a/python/test/core/unit_test.cpp +++ b/python/test/core/unit_test.cpp @@ -1,7 +1,7 @@ #include "unit_test_reflection.h" #include -BOOST_PYTHON_MODULE(bond_python_unit_test) +BOOST_PYTHON_MODULE(python_unit_test) { using namespace unittest; using namespace bond::python; diff --git a/python/test/core/unit_test.py b/python/test/core/unit_test.py index a5feee39..5c9fe1c8 100644 --- a/python/test/core/unit_test.py +++ b/python/test/core/unit_test.py @@ -3,8 +3,8 @@ import random import string import functools import sys -from bond_python_unit_test import Serialize, Deserialize, Marshal, Unmarshal, GetRuntimeSchema -import bond_python_unit_test as test +from python_unit_test import Serialize, Deserialize, Marshal, Unmarshal, GetRuntimeSchema +import python_unit_test as test def atleast_python3(): return sys.version_info[0] >= 3