[uClibc-cvs] svn commit: trunk/uClibc/test/args

vapier at uclibc.org vapier at uclibc.org
Fri Jul 1 00:09:25 UTC 2005


Author: vapier
Date: 2005-06-30 18:09:25 -0600 (Thu, 30 Jun 2005)
New Revision: 10666

Log:
make the test silent/non-interactive and only abort if it actually fails

Added:
   trunk/uClibc/test/args/arg_test.out.good

Modified:
   trunk/uClibc/test/args/Makefile
   trunk/uClibc/test/args/arg_test.c


Changeset:
Modified: trunk/uClibc/test/args/Makefile
===================================================================
--- trunk/uClibc/test/args/Makefile	2005-07-01 00:08:24 UTC (rev 10665)
+++ trunk/uClibc/test/args/Makefile	2005-07-01 00:09:25 UTC (rev 10666)
@@ -29,8 +29,14 @@
 	$(CC) $(CFLAGS) -c $< -o $@.o
 	$(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
 	$(STRIPTOOL) -x -R .note -R .comment $@
-	./$@ a b c d e f g h
+	env -i \
+	ENVVAR=123 \
+	SOMETHING=sldajfasdf \
+	BLAHBLAH=" hi hi " \
+	./$@ a b c d e f g h \
+	> arg_test.out
+	diff -u arg_test.out.good arg_test.out
 	-@ echo " "
 
 clean:
-	$(RM) *.[oa] *~ core $(TARGETS)
+	$(RM) *.[oa] *~ core $(TARGETS) *.out

Modified: trunk/uClibc/test/args/arg_test.c
===================================================================
--- trunk/uClibc/test/args/arg_test.c	2005-07-01 00:08:24 UTC (rev 10665)
+++ trunk/uClibc/test/args/arg_test.c	2005-07-01 00:09:25 UTC (rev 10666)
@@ -36,20 +36,20 @@
 		unsigned long sp;
 		sp = (unsigned long) __builtin_frame_address(0);
 		if(sp&0xf){
-			fprintf(stderr, "stack pointer is unaligned! (%08lx)\n", sp);
+			printf("stack pointer is unaligned! (%08lx)\n", sp);
 		}
 	}
 #endif
 	
-	fprintf(stderr, "argc=%d\n", argc);
+	printf("argc=%d\n", argc);
 
 	for(i=0;i<argc;i++) {
-		fprintf(stderr, "argv[%d]='%s'\n", i, argv[i]);
+		printf("argv[%d]='%s'\n", i, argv[i]);
 	}
 
 	i=0;
 	while(*index) {
-		fprintf(stderr, "environ[%d]='%s'\n", i++, *index++);
+		printf("environ[%d]='%s'\n", i++, *index++);
 	}
 
 	exit(0);

Added: trunk/uClibc/test/args/arg_test.out.good
===================================================================
--- trunk/uClibc/test/args/arg_test.out.good	2005-07-01 00:08:24 UTC (rev 10665)
+++ trunk/uClibc/test/args/arg_test.out.good	2005-07-01 00:09:25 UTC (rev 10666)
@@ -0,0 +1,13 @@
+argc=9
+argv[0]='./arg_test'
+argv[1]='a'
+argv[2]='b'
+argv[3]='c'
+argv[4]='d'
+argv[5]='e'
+argv[6]='f'
+argv[7]='g'
+argv[8]='h'
+environ[0]='ENVVAR=123'
+environ[1]='SOMETHING=sldajfasdf'
+environ[2]='BLAHBLAH= hi hi '



More information about the uClibc-cvs mailing list