test_stl: move main() in main_test_stl.c

This commit is contained in:
Hugues Delorme 2015-09-14 11:09:12 +02:00
parent 4c40002732
commit e559694bb5
3 changed files with 40 additions and 15 deletions

View File

@ -50,9 +50,11 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/models
add_executable( add_executable(
test_stl test_stl
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
main_test_stl.c
test_stl_io.c test_stl_io.c
stl_utils.c stl_utils.c
utils.c) utils.c
../src/gmio_stl/internal/stl_rw_common.c)
target_link_libraries(test_stl gmio) target_link_libraries(test_stl gmio)
# fake_support # fake_support

34
tests/main_test_stl.c Normal file
View File

@ -0,0 +1,34 @@
/****************************************************************************
** 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_stl_read();
const char* test_stlb_write_header();
const char* test_stlb_write();
const char* test_stla_write();
const char* all_tests()
{
UTEST_SUITE_START();
UTEST_RUN(test_stl_read);
UTEST_RUN(test_stlb_write_header);
UTEST_RUN(test_stlb_write);
UTEST_RUN(test_stla_write);
return NULL;
}
UTEST_MAIN(all_tests)

View File

@ -13,7 +13,8 @@
** "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 "stl_utils.h" #include "stl_utils.h"
#include "utils.h" #include "utils.h"
@ -23,6 +24,7 @@
#include "../src/gmio_stl/stl_io.h" #include "../src/gmio_stl/stl_io.h"
#include <stddef.h> #include <stddef.h>
#include <stdlib.h>
static const char* stl_grabcad_arm11_filepath = static const char* stl_grabcad_arm11_filepath =
"models/solid_grabcad_arm11_link0_hb.le_stlb"; "models/solid_grabcad_arm11_link0_hb.le_stlb";
@ -369,16 +371,3 @@ void generate_stlb_tests_models()
NULL); NULL);
} }
} }
const char* all_tests()
{
/*generate_stlb_tests_models();*/
UTEST_SUITE_START();
UTEST_RUN(test_stl_read);
UTEST_RUN(test_stlb_write_header);
UTEST_RUN(test_stlb_write);
UTEST_RUN(test_stla_write);
return NULL;
}
UTEST_MAIN(all_tests)