Browse Source

Add default skel for unit tests. Move test programs to demo.

release-1.5.4.branch
Vreixo Formoso 14 years ago
parent
commit
3c7f1285d6
  1. 3
      .bzrignore
  2. 3
      .cdtproject
  3. 34
      Makefile.am
  4. 0
      demo/cat.c
  5. 0
      demo/lsl.c
  6. 23
      test/test.c
  7. 9
      test/test.h
  8. 13
      test/test_node.c

3
.bzrignore

@ -23,3 +23,6 @@ test/iso
*.la
./test/lsl
./test/cat
test/test
demo/lsl
demo/cat

3
.cdtproject

@ -49,9 +49,10 @@
</item>
<item id="org.eclipse.cdt.core.pathentry">
<pathentry kind="src" path="src"/>
<pathentry kind="src" path="test"/>
<pathentry kind="src" path="demo"/>
<pathentry kind="out" path=""/>
<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
<pathentry kind="src" path="test"/>
</item>
</data>
</cdtproject>

34
Makefile.am

@ -22,31 +22,33 @@ libinclude_HEADERS = \
## ========================================================================= ##
## Build test applications
## Build demo applications
noinst_PROGRAMS = \
test/lsl \
test/cat
demo/lsl \
demo/cat
test_lsl_CPPFLAGS = -Isrc
test_lsl_LDADD = $(src_libisofs_la_OBJECTS) $(THREAD_LIBS)
test_lsl_SOURCES = test/lsl.c
demo_lsl_CPPFLAGS = -Isrc
demo_lsl_LDADD = $(src_libisofs_la_OBJECTS) $(THREAD_LIBS)
demo_lsl_SOURCES = demo/lsl.c
test_cat_CPPFLAGS = -Isrc
test_cat_LDADD = $(src_libisofs_la_OBJECTS) $(THREAD_LIBS)
test_cat_SOURCES = test/cat.c
demo_cat_CPPFLAGS = -Isrc
demo_cat_LDADD = $(src_libisofs_la_OBJECTS) $(THREAD_LIBS)
demo_cat_SOURCES = demo/cat.c
## Build unit test
#check_PROGRAMS = \
# test/test
check_PROGRAMS = \
test/test
#test_test_CPPFLAGS = -Ilibisofs
#test_test_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS) -lcunit
#test_test_LDFLAGS = -L.. -lm
test_test_CPPFLAGS = -Isrc
test_test_LDADD = $(src_libisofs_la_OBJECTS) $(THREAD_LIBS) -lcunit
test_test_LDFLAGS = -L.. -lm
#test_test_SOURCES = \
# test/test_exclude.c
test_test_SOURCES = \
test/test.h \
test/test.c \
test/test_node.c
## ========================================================================= ##

0
test/cat.c → demo/cat.c

0
test/lsl.c → demo/lsl.c

23
test/test.c

@ -0,0 +1,23 @@
#include "test.h"
static void create_test_suite()
{
add_node_suite();
}
int main(int argc, char **argv)
{
CU_pSuite pSuite = NULL;
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
create_test_suite();
/* Run all tests using the console interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
return CU_get_error();
}

9
test/test.h

@ -0,0 +1,9 @@
#ifndef TEST_H_
#define TEST_H_
#include <CUnit/Basic.h>
#include "libisofs.h"
void add_node_suite();
#endif /*TEST_H_*/

13
test/test_node.c

@ -0,0 +1,13 @@
/*
* Unit test for node.h
*/
#include "libisofs.h"
#include "node.h"
#include "test.h"
void add_node_suite()
{
CU_pSuite pSuite = CU_add_suite("Node Test Suite", NULL, NULL);
}
Loading…
Cancel
Save