all: pdclib.a
pdclib.a: $(OBJFILES)
+ @echo " AR $@"
@ar rc pdclib.a $?
+ @echo
test: $(FILE)
$(FILE)
tests: testdrivers
- -@rc=0; count=0; for file in $(TSTFILES); do echo " TST $$file"; ./$$file; rc=`expr $$rc + $$?`; count=`expr $$count + 1`; done; echo; echo "Tests executed (linking PDCLib): $$count Tests failed: $$rc"
+ -@rc=0; count=0; echo; for file in $(TSTFILES); do echo " TST $$file"; ./$$file; rc=`expr $$rc + $$?`; count=`expr $$count + 1`; done; echo; echo "Tests executed (linking PDCLib): $$count Tests failed: $$rc"; echo
testdrivers: $(TSTFILES)
regtests: regtestdrivers
- -@rc=0; count=0; for file in $(REGFILES); do echo " RTST $$file"; ./$$file; rc=`expr $$rc + $$?`; count=`expr $$count + 1`; done; echo; echo "Tests executed (linking system libc): $$count Tests failed: $$rc"
+ -@rc=0; count=0; echo; for file in $(REGFILES); do echo " RTST $$file"; ./$$file; rc=`expr $$rc + $$?`; count=`expr $$count + 1`; done; echo; echo "Tests executed (linking system libc): $$count Tests failed: $$rc"; echo
regtestdrivers: $(REGFILES)
@echo "help - print this list"
%.o: %.c Makefile
- @echo " CC $@"
+ @echo " CC $(patsubst functions/%,%,$@)"
@$(CC) $(CFLAGS) -DNDEBUG -MMD -MP -MT "$*.d $*.t" -g -std=c99 -I./includes -I./internals -c $< -o $@
%.t: %.c Makefile pdclib.a
- @echo " CC $@"
+ @echo " CC $(patsubst functions/%,%,$@)"
@$(CC) $(CFLAGS) -DTEST -std=c99 -I./includes -I./internals $< pdclib.a -o $@
%.r: %.c Makefile
- @echo " CC $@"
+ @echo " CC $(patsubst functions/%,%,$@)"
@$(CC) $(CFLAGS) -DTEST -DREGTEST -std=c99 -I./internals $< -o $@
int main( void )
{
#ifndef REGTEST
- printf( "Start of malloc() testing...\n" );
- {
void * ptr1, * ptr2, * ptr3, * ptr4, * ptr5, * ptr6, * ptr7, * ptr8, * ptr9;
char * pages_start = _PDCLIB_allocpages( 0 );
/* allocating 10 byte; expected: 1 page allocation, node split */
TESTCASE( memset( ptr9, 0, 4072 ) == ptr9 );
TESTCASE( PAGETEST( 9 ) );
NODETRACE( 17 );
- printf( "End of malloc() testing.\n" );
- }
#else
puts( "No testing of malloc() - test driver does not know internals of system function." );
#endif
-/* $Id$ */\r
-\r
-/* PDCLib testing suite <_PDCLIB_test.h>\r
-\r
- This file is part of the Public Domain C Library (PDCLib).\r
- Permission is granted to use, modify, and / or redistribute at will.\r
-*/\r
-\r
-/* -------------------------------------------------------------------------- */\r
-/* Helper macros for test drivers */\r
-/* -------------------------------------------------------------------------- */\r
-\r
-#include <stdio.h>\r
-\r
-char const abcde[] = "abcde";\r
-char const abcdx[] = "abcdx";\r
-\r
-int NO_TESTDRIVER = 0;\r
-\r
-//#define BEGIN_TESTS unsigned int rc = 0\r
-static unsigned int rc = 0;\r
-#define TESTCASE( x ) if ( x ) {} \\r
- else { rc += 1; printf( "Testcase failed: " __FILE__ ", line %d - " #x "\n", __LINE__ ); }\r
-#define TEST_RESULTS rc\r
+/* $Id$ */
+
+/* PDCLib testing suite <_PDCLIB_test.h>
+
+ This file is part of the Public Domain C Library (PDCLib).
+ Permission is granted to use, modify, and / or redistribute at will.
+*/
+
+/* -------------------------------------------------------------------------- */
+/* Helper macros for test drivers */
+/* -------------------------------------------------------------------------- */
+
+#include <stdio.h>
+
+char const abcde[] = "abcde";
+char const abcdx[] = "abcdx";
+
+int NO_TESTDRIVER = 0;
+
+//#define BEGIN_TESTS unsigned int rc = 0
+static unsigned int rc = 0;
+#define TESTCASE( x ) if ( x ) {} \
+ else { rc += 1; printf( "FAILED: " __FILE__ ", line %d - " #x "\n", __LINE__ ); }
+#define TEST_RESULTS rc