Browse Source

test proggy for strtol, strtoul

David Schleef 25 years ago
parent
commit
4c89e03a79
1 changed files with 44 additions and 1 deletions
  1. 44 1
      test/Makefile

+ 44 - 1
test/Makefile

@@ -19,7 +19,9 @@ ifndef $(STRIPTOOL)
 endif
 STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
 
-TARGETS=hello_source hello_glibc hello testmalloc_source testmalloc_glibc testmalloc
+TARGETS=hello_source hello_glibc hello
+TARGETS+=testmalloc_source testmalloc_glibc testmalloc
+TARGETS+=teststrtol_source teststrtol_glibc teststrtol teststrtol_diff
 
 all: $(TARGETS)
 
@@ -90,6 +92,47 @@ testmalloc_glibc: testmalloc.c Makefile $(TOPDIR)libc.a
 	-./$@
 	-@ echo " "
 
+teststrtol_source:
+	-@ echo "-------"
+	-@ echo "teststrtol.c source: "
+	-@ echo " "
+	-@ cat teststrtol.c
+	-@ echo " "
+
+teststrtol: teststrtol.c Makefile $(TOPDIR)libc.a
+	-@ echo "-------"
+	-@ echo " "
+	-@ echo "Compiling vs uC-Libc: "
+	-@ echo " "
+	$(CC) $(XCFLAGS) -c $< -o $@.o
+	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+	$(STRIP)
+	ldd $@
+	ls -sh $@
+	-./$@ | tee $@.out
+	-@ echo " "
+
+teststrtol_glibc: teststrtol.c Makefile $(TOPDIR)libc.a
+	-@ echo "-------"
+	-@ echo " "
+	-@ echo "Compiling vs GNU libc: "
+	-@ echo " "
+	$(CC) $(YCFLAGS) -c $< -o $@.o
+	$(CC) $(YLDFLAGS) --static $@.o -o $@
+	$(STRIP)
+	ldd $@
+	ls -sh $@
+	-./$@ | tee $@.out
+	-@ echo " "
+
+teststrtol_diff: teststrtol_glibc teststrtol
+	-@ echo "-------"
+	-@ echo " "
+	-@ echo "Diffing output: "
+	-@ echo " "
+	-diff -u teststrtol_glibc.out teststrtol.out
+	-@ echo " "
+
 clean:
 	rm -f *.[oa] *~ core $(TARGETS)