diff --git a/test_programs/README b/test_programs/README new file mode 100644 index 0000000..be6967b --- /dev/null +++ b/test_programs/README @@ -0,0 +1,5 @@ +This is a collection of programs I'm using to test the library. These +are functional tests: the library is supposed to do something, and produce +a particular result. For example, "printf_test" exercises a bunch of +output formatting rules. Currently, there is only an smakefile for SAS/C +to build these programs with. diff --git a/test_programs/smakefile b/test_programs/smakefile new file mode 100644 index 0000000..c458159 --- /dev/null +++ b/test_programs/smakefile @@ -0,0 +1,124 @@ +# +# $Id: smakefile,v 1.1 2004-08-06 11:51:50 obarthel Exp $ +# +# :ts=8 +# + +############################################################################## + +.c.o: + @echo "Compiling $<" + @sc nover $(CFLAGS) $< + +.asm.o: + @echo "Assembling $<" + @asm $(AFLAGS) $< + +############################################################################## + +# You might want to change this to the directory where your operating system +# header files are stored. On my system, that's "V:include", but you might +# get lucky with "sc:include" instead, which is the default for SAS/C. +INCLUDE_DIR = V:include +#INCLUDE_DIR = sc:include + +############################################################################## + +# This is where the header files, the startup code and the c.lib files are +# stored; see below how this prefix is used. +LIB = /library/ + +############################################################################## + + OPTIMIZE = optimize opttime optschedule optinline +#DEBUG = debug=line noopt define=CHECK_FOR_NULL_POINTERS +#DEBUG = debug=line +#DEBUG = debug=line define=NDEBUG + DEBUG = debug=sf noopt +#DEBUG = debug=sf noopt define=CHECK_FOR_NULL_POINTERS +#PROFILE = profile + DATA = data=faronly +#CODE = code=far + CPU = cpu=060 +MATH = define=IEEE_FLOATING_POINT_SUPPORT math=IEEE +SUPPORT = define=UNIX_PATH_SEMANTICS define=SOCKET_SUPPORT define=USERGROUP_SUPPORT \ + define=__C_MACROS__ + +############################################################################## + +CFLAGS = \ + resopt \ + nover \ + memorysize=huge \ + idlen=64 \ + commentnest \ + nostackcheck \ + stringmerge \ + errorrexx \ + $(PROFILE) $(OPTIMIZE) $(CODE) $(DATA) $(CPU) $(MATH) \ + $(SUPPORT) $(DEBUG) + +AFLAGS = \ + -d -m2 + +############################################################################## + +all: setup test fgets_test iotest sscanf_test printf_test stack_size_test translate_test cleanup + +clean: + -delete \#?.o \#?.map test fgets_test iotest sscanf_test printf_test stack_size_test translate_test + +############################################################################## + +setup: + @echo "Setting up include: assignment" + @assign include: $(LIB)include V:include + +cleanup: + @echo "Cleaning up include: assignment" + @assign include: sc:include + +############################################################################## + +test: test.o + @echo "Linking $@" + @slink $(LIB)startup.o test.o to $@ lib $(LIB)c.lib addsym \ + map $@.map,fhx fwidth 32 pwidth 32 swidth 32 + +fgets_test: fgets_test.o + @echo "Linking $@" + @slink $(LIB)startup.o fgets_test.o to $@ lib $(LIB)c.lib addsym \ + map $@.map,fhx fwidth 32 pwidth 32 swidth 32 + +iotest: iotest.o + @echo "Linking $@" + @slink $(LIB)startup.o iotest.o to $@ lib $(LIB)c.lib addsym \ + map $@.map,fhx fwidth 32 pwidth 32 swidth 32 + +sscanf_test: sscanf_test.o + @echo "Linking $@" + @slink $(LIB)startup.o sscanf_test.o to $@ lib $(LIB)c.lib addsym \ + map $@.map,fhx fwidth 32 pwidth 32 swidth 32 + +printf_test: printf_test.o + @echo "Linking $@" + @slink $(LIB)startup.o printf_test.o to $@ lib $(LIB)c.lib addsym \ + map $@.map,fhx fwidth 32 pwidth 32 swidth 32 + +stack_size_test: stack_size_test.o + @echo "Linking $@" + @slink $(LIB)startup.o stack_size_test.o to $@ lib $(LIB)c.lib addsym \ + map $@.map,fhx fwidth 32 pwidth 32 swidth 32 + +translate_test: translate_test.o + @echo "Linking $@" + @slink $(LIB)startup.o translate_test.o to $@ lib $(LIB)c.lib addsym \ + map $@.map,fhx fwidth 32 pwidth 32 swidth 32 + +############################################################################## + +mkid: + mkid \#?.(c|h|asm|i) include/\#?.(c|h|asm|i) include/sys/\#?.(c|h|asm|i) + +update: + mkid -v -u