diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1bb02c0..0bbc353 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,23 +25,17 @@ include_directories(${CMAKE_BINARY_DIR}/src/gmio_core) # For generated cmake hea file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp) -# test_internal -add_executable( - test_internal - EXCLUDE_FROM_ALL - stream_buffer.c - utils.c - test_internal.c - ../src/gmio_core/internal/string_parse.c) -#target_link_libraries(test_internal gmio) - -# test_platform -add_executable( - test_platform EXCLUDE_FROM_ALL test_platform.c) - # test_core add_executable( - test_core EXCLUDE_FROM_ALL test_core.c) + test_core + EXCLUDE_FROM_ALL + main_test_core.c + test_core.c + test_internal.c + test_platform.c + stream_buffer.c + utils.c + ../src/gmio_core/internal/string_parse.c) target_link_libraries(test_core gmio) # test_stl @@ -66,19 +60,12 @@ endif() # For some targets, GCC and Clang requires -lm if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) - target_link_libraries(test_internal m) + target_link_libraries(test_core m) target_link_libraries(test_stl m) endif() # Declare tests -add_test(test_internal test_internal) -add_test(test_platform test_platform) add_test(test_core test_core) add_test(test_stl test_stl) -add_dependencies( - check - test_internal - test_platform - test_core - test_stl) +add_dependencies(check test_core test_stl) diff --git a/tests/main_test_core.c b/tests/main_test_core.c new file mode 100644 index 0000000..4a62f96 --- /dev/null +++ b/tests/main_test_core.c @@ -0,0 +1,56 @@ +/**************************************************************************** +** gmio +** Copyright Fougue (2 Mar. 2015) +** contact@fougue.pro +** +** This software is a reusable library whose purpose is to provide complete +** I/O support for various CAD file formats (eg. STL) +** +** This software is governed by the CeCILL-B license under French law and +** abiding by the rules of distribution of free software. You can use, +** modify and/ or redistribute the software under the terms of the CeCILL-B +** license as circulated by CEA, CNRS and INRIA at the following URL +** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html". +****************************************************************************/ + +#include "utest_lib.h" + +const char* test_core__buffer(); +const char* test_core__endian(); +const char* test_core__error(); +const char* test_core__stream(); + +const char* test_internal__byte_swap(); +const char* test_internal__byte_codec(); +const char* test_internal__fast_atof(); +const char* test_internal__safe_cast(); +const char* test_internal__string_parse(); +const char* test_internal__string_utils(); + +const char* test_platform__alignment(); +const char* test_platform__global_h(); +const char* test_platform__compiler(); + +const char* all_tests() +{ + UTEST_SUITE_START(); + + UTEST_RUN(test_core__buffer); + UTEST_RUN(test_core__endian); + UTEST_RUN(test_core__error); + UTEST_RUN(test_core__stream); + + UTEST_RUN(test_internal__byte_swap); + UTEST_RUN(test_internal__byte_codec); + UTEST_RUN(test_internal__fast_atof); + UTEST_RUN(test_internal__safe_cast); + UTEST_RUN(test_internal__string_parse); + UTEST_RUN(test_internal__string_utils); + + UTEST_RUN(test_platform__alignment); + UTEST_RUN(test_platform__global_h); + UTEST_RUN(test_platform__compiler); + + return NULL; +} +UTEST_MAIN(all_tests) diff --git a/tests/test_core.c b/tests/test_core.c index a1eb3aa..05c719c 100644 --- a/tests/test_core.c +++ b/tests/test_core.c @@ -13,7 +13,7 @@ ** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html". ****************************************************************************/ -#include "utest_lib.h" +#include "utest_assert.h" #include "../src/gmio_core/buffer.h" #include "../src/gmio_core/endian.h" @@ -106,15 +106,3 @@ const char* test_core__stream() return NULL; } - -const char* all_tests() -{ - UTEST_SUITE_START(); - UTEST_RUN(test_core__buffer); - UTEST_RUN(test_core__endian); - UTEST_RUN(test_core__error); - UTEST_RUN(test_core__stream); - return NULL; -} - -UTEST_MAIN(all_tests) diff --git a/tests/test_internal.c b/tests/test_internal.c index e067c3e..3111514 100644 --- a/tests/test_internal.c +++ b/tests/test_internal.c @@ -13,7 +13,7 @@ ** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html". ****************************************************************************/ -#include "utest_lib.h" +#include "utest_assert.h" #include "../src/gmio_core/internal/byte_codec.h" #include "../src/gmio_core/internal/byte_swap.h" @@ -300,17 +300,3 @@ const char* test_internal__string_utils() return NULL; } - -const char* all_tests() -{ - UTEST_SUITE_START(); - UTEST_RUN(test_internal__byte_swap); - UTEST_RUN(test_internal__byte_codec); - UTEST_RUN(test_internal__fast_atof); - UTEST_RUN(test_internal__safe_cast); - UTEST_RUN(test_internal__string_parse); - UTEST_RUN(test_internal__string_utils); - return NULL; -} - -UTEST_MAIN(all_tests) diff --git a/tests/test_platform.c b/tests/test_platform.c index aa4221a..66d572b 100644 --- a/tests/test_platform.c +++ b/tests/test_platform.c @@ -13,7 +13,7 @@ ** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html". ****************************************************************************/ -#include "utest_lib.h" +#include "utest_assert.h" #include "../src/gmio_core/global.h" #include "../src/gmio_core/transfer.h" @@ -101,14 +101,3 @@ const char* test_platform__compiler() #ifdef _MSC_VER # pragma warning(pop) #endif - -const char* all_tests() -{ - UTEST_SUITE_START(); - UTEST_RUN(test_platform__alignment); - UTEST_RUN(test_platform__global_h); - UTEST_RUN(test_platform__compiler); - return NULL; -} - -UTEST_MAIN(all_tests)