Skip to content

Commit

Permalink
test cleanup to link to darma_frontend interface library
Browse files Browse the repository at this point in the history
  • Loading branch information
jjwilke committed Apr 30, 2018
1 parent e8b27c9 commit 53169f8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ else()
message("DARMA frontend tests will be skipped.")
endif()

# indicate that CMAKE was used, so config-generated.h can be used
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDARMA_CONFIG_GENERATED_H_AVAILABLE" )


if (DARMA_ENABLE_COVERALLS)
Expand Down Expand Up @@ -79,6 +77,10 @@ target_include_directories(darma_frontend INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>
)

# indicate that CMAKE was used, so config-generated.h can be used
target_compile_options(darma_frontend INTERFACE -DDARMA_CONFIG_GENERATED_H_AVAILABLE)

install(TARGETS darma_frontend EXPORT darma_frontend)
install(EXPORT darma_frontend DESTINATION cmake)

Expand Down
12 changes: 10 additions & 2 deletions src/include/darma.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ namespace darma = darma_runtime;
using darma_runtime::keyword_arguments_for_collectives::output

#define darma_import_publish \
namespace kw { \
using keyword_arguments_for_publish::n_readers; \
using darma_runtime::keyword_arguments_for_publish::version
using darma_runtime::keyword_arguments_for_publish::version; \
}

#define darma_import_ahc darma_import_access_handle_collection
#define darma_import_ah darma_import_access_handle
Expand All @@ -90,13 +92,19 @@ namespace darma = darma_runtime;

#if DARMA_CREATE_WORK_RECORD_LINE_NUMBERS
#define darma_import_create_work \
namespace kw { \
using darma_runtime::keyword_arguments_for_create_work::name; \
} \
using darma_runtime::_create_work_creation_context; \
using darma_runtime::_create_work_if_creation_context; \
using darma_runtime::_create_work_while_creation_context; \
using darma_runtime::create_concurrent_work
#else
#define darma_import_create_work \
using darma_runtime::create_work\
namespace kw { \
using darma_runtime::keyword_arguments_for_create_work::name; \
} \
using darma_runtime::create_work; \
using darma_runtime::create_work_if; \
using darma_runtime::create_work_while; \
using darma_runtime::create_concurrent_work
Expand Down
10 changes: 7 additions & 3 deletions src/tests/frontend_validation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ endif()

find_package ( Threads REQUIRED )

include_directories( ${DARMA_FE_REPO_ROOT}/src/tests/frontend_validation )
function(add_unit_test test_name)
set(frontendtestfiles "${frontendtestfiles};${test_name}.cc" PARENT_SCOPE)
add_executable(${test_name} ${test_name}.cc gtest_main.cc)
target_include_directories(${test_name} PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/tests/frontend_validation>)
# GMock links to GTest, so all we need is GMock
target_link_libraries(${test_name} ${DARMA_BACKEND_LIBNAME} ${GMOCK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${test_name} darma_frontend ${DARMA_BACKEND_LIBNAME})
target_link_libraries(${test_name} ${GMOCK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
add_test(${test_name} ${CMAKE_CURRENT_BINARY_DIR}/${test_name} "")
set_tests_properties(${test_name} PROPERTIES TIMEOUT 30
FAIL_REGULAR_EXPRESSION "FAILED;should be deleted but never is"
Expand Down Expand Up @@ -43,8 +45,10 @@ add_unit_test(test_darma_region)
add_unit_test(test_lambda_migrate)

add_executable(run_all_frontend_tests ${frontendtestfiles} gtest_main.cc)
target_include_directories(run_all_frontend_tests PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/tests/frontend_validation>)

target_link_libraries(run_all_frontend_tests ${DARMA_BACKEND_LIBNAME} ${GMOCK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(run_all_frontend_tests darma_frontend ${DARMA_BACKEND_LIBNAME} ${GMOCK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
if (DARMA_COVERAGE)
setup_target_for_coverage(frontend_coverage run_all_frontend_tests coverage)
endif()

0 comments on commit 53169f8

Please sign in to comment.