test_core: move main() in main_test_core.c
This commit is contained in:
parent
a6ef1bc94e
commit
047ef555f3
@ -25,23 +25,17 @@ include_directories(${CMAKE_BINARY_DIR}/src/gmio_core) # For generated cmake hea
|
|||||||
|
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp)
|
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
|
# test_core
|
||||||
add_executable(
|
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)
|
target_link_libraries(test_core gmio)
|
||||||
|
|
||||||
# test_stl
|
# test_stl
|
||||||
@ -66,19 +60,12 @@ endif()
|
|||||||
|
|
||||||
# For some targets, GCC and Clang requires -lm
|
# For some targets, GCC and Clang requires -lm
|
||||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
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)
|
target_link_libraries(test_stl m)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Declare tests
|
# Declare tests
|
||||||
add_test(test_internal test_internal)
|
|
||||||
add_test(test_platform test_platform)
|
|
||||||
add_test(test_core test_core)
|
add_test(test_core test_core)
|
||||||
add_test(test_stl test_stl)
|
add_test(test_stl test_stl)
|
||||||
|
|
||||||
add_dependencies(
|
add_dependencies(check test_core test_stl)
|
||||||
check
|
|
||||||
test_internal
|
|
||||||
test_platform
|
|
||||||
test_core
|
|
||||||
test_stl)
|
|
||||||
|
56
tests/main_test_core.c
Normal file
56
tests/main_test_core.c
Normal file
@ -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)
|
@ -13,7 +13,7 @@
|
|||||||
** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
|
** "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/buffer.h"
|
||||||
#include "../src/gmio_core/endian.h"
|
#include "../src/gmio_core/endian.h"
|
||||||
@ -106,15 +106,3 @@ const char* test_core__stream()
|
|||||||
|
|
||||||
return NULL;
|
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)
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
|
** "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_codec.h"
|
||||||
#include "../src/gmio_core/internal/byte_swap.h"
|
#include "../src/gmio_core/internal/byte_swap.h"
|
||||||
@ -300,17 +300,3 @@ const char* test_internal__string_utils()
|
|||||||
|
|
||||||
return NULL;
|
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)
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
|
** "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/global.h"
|
||||||
#include "../src/gmio_core/transfer.h"
|
#include "../src/gmio_core/transfer.h"
|
||||||
@ -101,14 +101,3 @@ const char* test_platform__compiler()
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# pragma warning(pop)
|
# pragma warning(pop)
|
||||||
#endif
|
#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)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user