test: Updates.
This commit is contained in:
parent
61ee206b8d
commit
503be95f97
|
@ -9,6 +9,7 @@ if [ -z "$PREFIX" ]; then
|
|||
PREFIX=/usr/local
|
||||
fi
|
||||
|
||||
BASH=$(command -v bash)
|
||||
GUILE=$(command -v guile)
|
||||
GUILE_TOOLS=$(command -v guile-tools)
|
||||
GUILE_SITE_DIR=$PREFIX/share/guile/site/$GUILE_EFFECTIVE_VERSION
|
||||
|
@ -22,6 +23,7 @@ sed \
|
|||
bin/gash.in > bin/gash
|
||||
chmod +x bin/gash
|
||||
cat > .config.make <<EOF
|
||||
BASH=$BASH
|
||||
GUILE=$GUILE
|
||||
GUILE_TOOLS=$GUILE_TOOLS
|
||||
PREFIX=$PREFIX
|
||||
|
|
16
makefile
16
makefile
|
@ -1,4 +1,4 @@
|
|||
.PHONY: all all-go clean install
|
||||
.PHONY: all all-go check clean install
|
||||
-include .config.make
|
||||
|
||||
default: all
|
||||
|
@ -20,8 +20,15 @@ clean:
|
|||
clean-go:
|
||||
rm -f $(shell find . -name '*.go')
|
||||
|
||||
check: all
|
||||
echo TODO
|
||||
check: all check-bash check-gash
|
||||
|
||||
check-bash: all
|
||||
ifneq ($(BASH),)
|
||||
SHELL=$(BASH) ./test.sh
|
||||
endif
|
||||
|
||||
check-gash: all
|
||||
./test.sh
|
||||
|
||||
install: all
|
||||
mkdir -p $(DESTDIR)$(BINDIR)
|
||||
|
@ -40,6 +47,7 @@ Usage: make [OPTION]... [TARGET]...
|
|||
Targets:
|
||||
all update everything
|
||||
all-go update .go files
|
||||
check run ./test.sh
|
||||
clean run git clean -dfx
|
||||
clean-go clean .go files
|
||||
install install in $(PREFIX)
|
||||
|
@ -48,8 +56,10 @@ export HELP_TOP
|
|||
help:
|
||||
@echo "$$HELP_TOP"
|
||||
|
||||
export BUILD_DEBUG
|
||||
export GUILE
|
||||
export GUILE_TOOLS
|
||||
export GUILE_LOAD_PATH
|
||||
export GUILE_LOAD_COMPILED_PATH
|
||||
|
||||
|
||||
|
|
18
test.sh
18
test.sh
|
@ -1 +1,17 @@
|
|||
for f in test/*; do echo $f ":"; bin/gash $f; echo; done
|
||||
if [ -n "$BUILD_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
SHELL=${SHELL-bin/gash}
|
||||
for f in test/*.sh; do
|
||||
echo -n "$f: "
|
||||
b=test/$(basename $f .sh)
|
||||
$SHELL $f
|
||||
r=$?
|
||||
if [ -f $b.exit ]; then
|
||||
e=$(cat $b.exit)
|
||||
else
|
||||
e=0
|
||||
fi
|
||||
[ $r = $e ] || exit 1
|
||||
echo pass
|
||||
done
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
exit
|
|
@ -0,0 +1 @@
|
|||
exit 0
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1 @@
|
|||
exit 1
|
|
@ -0,0 +1 @@
|
|||
echo
|
|
@ -0,0 +1 @@
|
|||
echo $SHELL
|
|
@ -0,0 +1,2 @@
|
|||
SHELL=/bin/bash
|
||||
echo $SHELL
|
|
@ -0,0 +1 @@
|
|||
for f in test/*.sh; do echo "$f:" | grep '.sh' ; done
|
Loading…
Reference in New Issue