Skip to content

Commit

Permalink
Some Makefile fixes for EMP
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesko Dujmovic committed Jul 5, 2021
1 parent 93433e7 commit ec094de
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
10 changes: 3 additions & 7 deletions emp/ag_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project (emp-docker-test)
set(NAME "emp-docker-test")

find_path(CMAKE_FOLDER NAMES cmake/emp-tool-config.cmake)
include(${CMAKE_FOLDER}/cmake/common.cmake)
include(${CMAKE_FOLDER}/cmake/emp-base.cmake)
include(${CMAKE_FOLDER}/cmake/enable_rdseed.cmake)
include(${CMAKE_FOLDER}/cmake/enable_float.cmake)

Expand All @@ -13,9 +13,5 @@ include_directories(${EMP-SH2PC_INCLUDE_DIRS})
find_package(emp-ag2pc REQUIRED)
include_directories(${EMP-AG2PC_INCLUDE_DIRS})

macro (add_test _name)
add_test_with_lib(${_name} ${EMP-TOOL_LIBRARIES})
endmacro()

add_test(agmult3)
add_test(mult3.ag2pc)
enable_testing()
add_subdirectory(test)
19 changes: 19 additions & 0 deletions emp/ag_test/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#Testing macro
macro (add_test_executable_with_lib _name libs)
add_executable(${_name} "${_name}.cpp")
target_link_libraries(${_name} ${EMP-OT_LIBRARIES})
endmacro()

macro (add_test_case _name)
add_test_executable_with_lib(${_name} "")
add_test(NAME ${_name} COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_name}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/")
endmacro()

macro (add_test_case_with_run _name)
add_test_executable_with_lib(${_name} "")
add_test(NAME ${_name} COMMAND "./run" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_name}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/")
endmacro()

# Test cases
add_test_case_with_run(agmult3)
add_test_case_with_run(mult3.ag2pc)
4 changes: 2 additions & 2 deletions emp/sh_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ project (emp-docker-test)
set(NAME "emp-docker-test")

find_path(CMAKE_FOLDER NAMES cmake/emp-tool-config.cmake)
include(${CMAKE_FOLDER}/cmake/common.cmake)
include(${CMAKE_FOLDER}/cmake/emp-base.cmake)
include(${CMAKE_FOLDER}/cmake/enable_rdseed.cmake)
include(${CMAKE_FOLDER}/cmake/enable_float.cmake)

find_package(emp-sh2pc REQUIRED)
include_directories(${EMP-SH2PC_INCLUDE_DIRS})

ENABLE_TESTING()
ADD_SUBDIRECTORY(test)
ADD_SUBDIRECTORY(test)

0 comments on commit ec094de

Please sign in to comment.