packages feed

cpsa-2.1.2: tst/Makefile

# When the binary changes, run the test suite, and look for changes in
# the output.  The changes are not fatal errors, but for a *.sc{m,h} input
# file, an error produced by the binary is fatal.

TSTS	:= $(patsubst %.scm,%.txt,$(wildcard *.scm)) \
		$(patsubst %.sch,%.txt,$(wildcard *.sch)) \
		$(patsubst %.lsp,%.txt,$(wildcard *.lsp))
PROG	= ../dist/build/cpsa/cpsa
CPSAFLAGS = +RTS -M512m -RTS

# The expected answers are in files with the .tst extension.

# Analyze protocols for shapes expecting success
%.txt:	%.scm $(PROG)
	$(PROG) $(CPSAFLAGS) -o $@ $*.scm
	-diff -uw $*.tst $*.txt

# Analyze protocols for shapes expecting failure
%.txt:	%.lsp $(PROG)
	-$(PROG) $(CPSAFLAGS) -o $@ $*.lsp
	-diff -uw $*.tst $*.txt

# Analyze protocols for shapes expecting success using Diffie-Hellman
%.txt:	%.sch $(PROG)
	$(PROG) $(CPSAFLAGS) -a diffie-hellman -o $@ $*.sch
	-diff -uw $*.tst $*.txt

# Extract shapes
%_shapes.txt:	%.txt
	../dist/build/cpsashapes/cpsashapes $(SHAPESFLAGS) -o $@ $<

# Annotate shapes
%_annotations.txt:	%_shapes.txt
	../dist/build/cpsaannotations/cpsaannotations \
		$(ANNOTATIONSFLAGS) -o $@ $<

# Visualize output
%.svg:		%.txt
	../dist/build/cpsagraph/cpsagraph -c -o $@ $<

# Visualize output using the expanded format
%.xml:		%.txt
	../dist/build/cpsagraph/cpsagraph $(GRAPHFLAGS) -o $@ $<

.PRECIOUS:	%.txt %_shapes.txt %_annotations.txt

all:	$(TSTS) $(patsubst %.txt,%.xml,$(TSTS)) \
		$(patsubst %.txt,%_shapes.xml,$(TSTS))

clean:
	-rm *.txt *.xml