From: martinahansen Date: Fri, 10 Jul 2009 12:53:03 +0000 (+0000) Subject: mucking with c and makefiles X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8c738b397772eb396695d9595e9d1cd2512aa280;p=biopieces.git mucking with c and makefiles git-svn-id: http://biopieces.googlecode.com/svn/trunk@560 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_c/Maasha/src/test/Makefile b/code_c/Maasha/src/test/Makefile index 6f40600..35fd052 100644 --- a/code_c/Maasha/src/test/Makefile +++ b/code_c/Maasha/src/test/Makefile @@ -1,60 +1,17 @@ # Martin Asser Hansen (mail@maasha.dk) Copyright (C) 2008 - All right reserved CC = gcc -Cflags = -Wall -Werror -g -pg # for gprof +CFLAGS = -Wall -Werror -INC_DIR = ../inc/ -LIB_DIR = ../lib/ - -INC = -I $(INC_DIR) -LIB = -lm $(LIB_DIR)*.o +INC = -I ../inc/ +LIB = -lm ../lib/*.o all: test -test: test_barray test_bits test_common test_fasta test_filesys test_hash test_list test_mem test_ucsc test_seq test_strings - -test_barray: test_barray.c $(LIB_DIR)barray.c - $(CC) $(Cflags) $(INC) $(LIB) test_barray.c -o test_barray - -test_bits: test_bits.c $(LIB_DIR)bits.c - $(CC) $(Cflags) $(INC) $(LIB) test_bits.c -o test_bits - -test_common: test_common.c $(LIB_DIR)common.c - $(CC) $(Cflags) $(INC) $(LIB) test_common.c -o test_common - -test_fasta: test_fasta.c $(LIB_DIR)fasta.c - $(CC) $(Cflags) $(INC) $(LIB) test_fasta.c -o test_fasta - -test_filesys: test_filesys.c $(LIB_DIR)filesys.c - $(CC) $(Cflags) $(INC) $(LIB) test_filesys.c -o test_filesys - -test_hash: test_hash.c $(LIB_DIR)hash.c - $(CC) $(Cflags) $(INC) $(LIB) test_hash.c -o test_hash - -test_list: test_list.c $(LIB_DIR)list.c - $(CC) $(Cflags) $(INC) $(LIB) test_list.c -o test_list - -test_mem: test_mem.c $(LIB_DIR)mem.c - $(CC) $(Cflags) $(INC) $(LIB) test_mem.c -o test_mem - -test_ucsc: test_ucsc.c $(LIB_DIR)ucsc.c - $(CC) $(Cflags) $(INC) $(LIB) test_ucsc.c -o test_ucsc - -test_seq: test_seq.c $(LIB_DIR)seq.c - $(CC) $(Cflags) $(INC) $(LIB) test_seq.c -o test_seq +test: test_common -test_strings: test_strings.c $(LIB_DIR)strings.c - $(CC) $(Cflags) $(INC) $(LIB) test_strings.c -o test_strings +test_common: test_common2.c $(LIB_DIR)common.c + $(CC) $(CFLAGS) $(INC) $(LIB) test_common2.c -o test_common2 clean: - rm test_barray - rm test_bits - rm test_common - rm test_fasta - rm test_filesys - rm test_hash - rm test_list - rm test_mem - rm test_ucsc - rm test_seq - rm test_strings + rm test_common2 diff --git a/code_c/Maasha/src/test/test_bits.c b/code_c/Maasha/src/test/test_bits.c index 6a5e356..ee80bda 100644 --- a/code_c/Maasha/src/test/test_bits.c +++ b/code_c/Maasha/src/test/test_bits.c @@ -4,12 +4,12 @@ #include "bits.h" static void test_bitarray_new(); -static void test_bitarray_fill(); -static void test_bitarray_zero(); -static void test_bitarray_bit_on(); -static void test_bitarray_bit_set(); -static void test_bitarray_print(); -static void test_bitarray_destroy(); +// static void test_bitarray_fill(); +// static void test_bitarray_zero(); +// static void test_bitarray_bit_on(); +// static void test_bitarray_bit_set(); +// static void test_bitarray_print(); +// static void test_bitarray_destroy(); int main() @@ -17,12 +17,12 @@ int main() fprintf( stderr, "Running all tests for bits.c\n" ); test_bitarray_new(); - test_bitarray_fill(); - test_bitarray_zero(); - test_bitarray_bit_on(); - test_bitarray_bit_set(); - test_bitarray_print(); - test_bitarray_destroy(); +// test_bitarray_fill(); +// test_bitarray_zero(); +// test_bitarray_bit_on(); +// test_bitarray_bit_set(); +// test_bitarray_print(); +// test_bitarray_destroy(); fprintf( stderr, "Done\n\n" ); @@ -39,12 +39,14 @@ void test_bitarray_new() bitarray_new( &ba, size ); + bitarray_print( ba ); + bitarray_destroy( &ba ); fprintf( stderr, "OK\n" ); } - +/* void test_bitarray_fill() { fprintf( stderr, " Testing bitarray_fill ... " ); @@ -167,4 +169,4 @@ void test_bitarray_destroy() fprintf( stderr, "OK\n" ); } - +*/ diff --git a/code_c/Maasha/src/test/test_common.c b/code_c/Maasha/src/test/test_common.c deleted file mode 100644 index e132baa..0000000 --- a/code_c/Maasha/src/test/test_common.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Martin Asser Hansen (mail@maasha.dk) Copyright (C) 2008 - All right reserved */ - -#include "common.h" - -static void test_true(); -static void test_bool(); - -int main() -{ - fprintf( stderr, "Running all tests for common.c\n" ); - - test_true(); - test_bool(); - - fprintf( stderr, "Done\n\n" ); - - return EXIT_SUCCESS; -} - - -void test_true() -{ - fprintf( stderr, " Testing true ... " ); - - assert( TRUE == 1 ); - assert( FALSE == 0 ); - - fprintf( stderr, "OK\n" ); -} - - -void test_bool() -{ - fprintf( stderr, " Testing bool ... " ); - - bool answer; - - answer = TRUE; - - assert( answer == TRUE ); - assert( answer == 1 ); - - answer = FALSE; - - assert( answer == FALSE ); - assert( answer == 0 ); - - fprintf( stderr, "OK\n" ); -} - - diff --git a/code_c/Maasha/src/test/test_common.c_old b/code_c/Maasha/src/test/test_common.c_old new file mode 100644 index 0000000..e132baa --- /dev/null +++ b/code_c/Maasha/src/test/test_common.c_old @@ -0,0 +1,51 @@ +/* Martin Asser Hansen (mail@maasha.dk) Copyright (C) 2008 - All right reserved */ + +#include "common.h" + +static void test_true(); +static void test_bool(); + +int main() +{ + fprintf( stderr, "Running all tests for common.c\n" ); + + test_true(); + test_bool(); + + fprintf( stderr, "Done\n\n" ); + + return EXIT_SUCCESS; +} + + +void test_true() +{ + fprintf( stderr, " Testing true ... " ); + + assert( TRUE == 1 ); + assert( FALSE == 0 ); + + fprintf( stderr, "OK\n" ); +} + + +void test_bool() +{ + fprintf( stderr, " Testing bool ... " ); + + bool answer; + + answer = TRUE; + + assert( answer == TRUE ); + assert( answer == 1 ); + + answer = FALSE; + + assert( answer == FALSE ); + assert( answer == 0 ); + + fprintf( stderr, "OK\n" ); +} + +