diff options
| author | benj <benj@rse8.com> | 2017-06-16 01:20:02 -0700 |
|---|---|---|
| committer | benj <benj@rse8.com> | 2017-06-16 01:20:02 -0700 |
| commit | 14adc6a1d769e22958496d570b7f25b68cc86969 (patch) | |
| tree | 6754de138c6d59bbfce8d5a3b732891d5a5e220b /test | |
| parent | dee453b6473354786871a9b0b123d676ef1eb5cc (diff) | |
| download | workbench-14adc6a1d769e22958496d570b7f25b68cc86969.tar workbench-14adc6a1d769e22958496d570b7f25b68cc86969.tar.gz workbench-14adc6a1d769e22958496d570b7f25b68cc86969.tar.bz2 workbench-14adc6a1d769e22958496d570b7f25b68cc86969.tar.lz workbench-14adc6a1d769e22958496d570b7f25b68cc86969.tar.xz workbench-14adc6a1d769e22958496d570b7f25b68cc86969.tar.zst workbench-14adc6a1d769e22958496d570b7f25b68cc86969.zip | |
Diffstat (limited to '')
| -rw-r--r-- | test/CMakeLists.txt | 21 | ||||
| -rw-r--r-- | test/main.c | 13 | ||||
| -rw-r--r-- | test/test_runner.h | 6 |
3 files changed, 40 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..717e065 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,21 @@ +enable_testing() + +# NOTE: This requires us to rebuild the cmake project since +# test file will not be automatically added or removed. +file(GLOB_RECURSE C_SRC_FILES "${CMAKE_SOURCE_DIR}/src/*.c") + +set(TEST_SOURCES + ${C_SRC_FILES} + ${CMAKE_SOURCE_DIR}/external/Unity/src/unity.c + ${CMAKE_SOURCE_DIR}/external/Unity/extras/fixture/src/unity_fixture.c + main.c) + +add_executable(${PROJECT_NAME}_test ${TEST_SOURCES}) +target_include_directories(${PROJECT_NAME}_test PRIVATE + ${CMAKE_SOURCE_DIR}/test + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/private + ${CMAKE_SOURCE_DIR}/external/Unity/src +) + +add_test(NAME UnitTests COMMAND ${PROJECT_NAME}_test) diff --git a/test/main.c b/test/main.c new file mode 100644 index 0000000..5df855f --- /dev/null +++ b/test/main.c @@ -0,0 +1,13 @@ +#include "./test_runner.h" +#include "unity.h" + +void setUp(void) {} +void tearDown(void) {} + +int main(void) { + UNITY_BEGIN(); + + test_runner_algo_hash(); + + return UNITY_END(); +} diff --git a/test/test_runner.h b/test/test_runner.h new file mode 100644 index 0000000..015b138 --- /dev/null +++ b/test/test_runner.h @@ -0,0 +1,6 @@ +#ifndef CRYPTOBENCH_TEST_TEST_RUNNER_H +#define CRYPTOBENCH_TEST_TEST_RUNNER_H + +void test_runner_algo_hash(void); + +#endif |
