[GENLINK] Add Test suite + simple test
This commit is contained in:
parent
bfdc2cd991
commit
89236f0339
10
Makefile
10
Makefile
@ -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
1
ld/tests/single.data
Normal file
@ -0,0 +1 @@
|
||||
single END A B C D
|
1
ld/tests/single.result
Normal file
1
ld/tests/single.result
Normal file
@ -0,0 +1 @@
|
||||
-DA -DB -DC -DD
|
17
scripts/genlinktest.sh
Normal file
17
scripts/genlinktest.sh
Normal 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
|
Loading…
x
Reference in New Issue
Block a user