update tests

This commit is contained in:
Xiao Wang
2021-05-18 09:48:31 -05:00
parent a050b97c77
commit 38b81e5b88
5 changed files with 37 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
name: arm
on: [push]
on: [push, pull_request]
jobs:
build_arm:
@@ -8,6 +8,7 @@ jobs:
os: [ubuntu-latest]
build_type: [Debug, Release]
runs-on: [self-hosted]
timeout-minutes: 30
env:
BUILD_TYPE: ${{matrix.build_type}}
steps:
@@ -20,10 +21,4 @@ jobs:
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE && make
- name: Test
shell: bash
run: |
./run ./bin/abit
./run ./bin/triple
./run ./bin/aes
./run ./bin/sha1
./run ./bin/sha256
./run ./bin/amortized_2pc
run: make test

View File

@@ -1,5 +1,5 @@
name: x86
on: [push]
on: [push, pull_request]
jobs:
build_x86:
@@ -8,6 +8,7 @@ jobs:
os: [ubuntu-latest, macos-latest]
build_type: [Debug, Release]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
env:
BUILD_TYPE: ${{matrix.build_type}}
steps:
@@ -20,10 +21,4 @@ jobs:
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_RANDOM_DEVICE=On && make
- name: Test
shell: bash
run: |
./run ./bin/abit
./run ./bin/triple
./run ./bin/aes
./run ./bin/sha1
./run ./bin/sha256
./run ./bin/amortized_2pc
run: make test

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
*Testing
*CTestTestfile.cmake
CMakeCache.txt
CMakeFiles/
Makefile

View File

@@ -3,7 +3,6 @@ project (emp-ag2pc)
set(NAME "emp-ag2pc")
find_path(CMAKE_FOLDER NAMES cmake/emp-tool-config.cmake)
include(${CMAKE_FOLDER}/cmake/common.cmake)
include(${CMAKE_FOLDER}/cmake/enable_rdseed.cmake)
include(${CMAKE_FOLDER}/cmake/enable_float.cmake)
@@ -11,21 +10,9 @@ include(${CMAKE_FOLDER}/cmake/enable_float.cmake)
FIND_PACKAGE(emp-ot REQUIRED)
INCLUDE_DIRECTORIES(${EMP-OT_INCLUDE_DIRS})
# Installation
install(FILES cmake/emp-ag2pc-config.cmake DESTINATION cmake/)
install(DIRECTORY emp-ag2pc DESTINATION include)
install(DIRECTORY cmake/ DESTINATION cmake)
# Test cases
macro(add_test_executable _name)
add_executable(${_name} "test/${_name}.cpp")
target_link_libraries(${_name} ${EMP-OT_LIBRARIES})
endmacro()
add_test_executable(aes)
add_test_executable(sha1)
add_test_executable(sha256)
add_test_executable (simple_circuit)
add_test_executable (abit)
add_test_executable (triple)
add_test_executable (amortized_2pc)
ENABLE_TESTING()
ADD_SUBDIRECTORY(test)

25
test/CMakeLists.txt Normal file
View File

@@ -0,0 +1,25 @@
#Testing macro
macro (add_test_executable_with_lib _name libs)
add_executable(test_${_name} "${_name}.cpp")
target_link_libraries(test_${_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}/test_${_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}/test_${_name}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/")
endmacro()
# Test cases
add_test_case_with_run(aes)
add_test_case_with_run(sha1)
add_test_case_with_run(sha256)
add_test_case_with_run(simple_circuit)
add_test_case_with_run(abit)
add_test_case_with_run(triple)
add_test_case_with_run(amortized_2pc)