[GENLINK] Add Test suite + simple test

This commit is contained in:
BuFran 2013-07-06 16:21:45 +02:00 committed by Piotr Esden-Tempski
parent bfdc2cd991
commit 89236f0339
4 changed files with 28 additions and 1 deletions

View File

@ -115,5 +115,13 @@ styleclean: $(STYLECHECKFILES:=.styleclean)
%.styleclean:
$(Q)rm -f $*.stylecheck;
.PHONY: build lib $(LIB_DIRS) install doc clean stylecheck styleclean
LDTESTS :=$(wildcard ld/tests/*.data)
LDTESTS :=$(LDTESTS:.data=)
genlinktests:
@for i in $(LDTESTS); do \
printf " TEST\t$$i\t: "; \
./scripts/genlinktest.sh $$i || exit 1; \
done
.PHONY: build lib $(LIB_DIRS) install doc clean generatedheaders cleanheaders stylecheck genlinktests

1
ld/tests/single.data Normal file
View File

@ -0,0 +1 @@
single END A B C D

1
ld/tests/single.result Normal file
View File

@ -0,0 +1 @@
-DA -DB -DC -DD

17
scripts/genlinktest.sh Normal file
View File

@ -0,0 +1,17 @@
#!/bin/sh
# run test
PAAT=`basename $1`;
awk -v PAT="$PAAT" -f scripts/genlink.awk $1.data > $1.out;
#check test
if ! diff -q $1.out $1.result >/dev/null; then
printf "FAILED\n";
exit 1;
fi
#remove workout only if it is OK
rm -f $1.out
printf "OK\n";
exit 0