commit c48d16ab2c12d774f6e96a5a5c768e80fa7ffbc2
parent 198149fa96ea9fdf1840fd105f42167ebdcbab5c
Author: Sean Enck <sean@ttypty.com>
Date: Thu, 14 Jul 2022 18:55:53 -0400
use make in test area
Diffstat:
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
@@ -10,7 +10,7 @@ $(TARGETS): cmd/$@/* internal/* go.*
go build -ldflags '-X main.version=$(VERSION) -X main.libExec=$(LIBEXEC)' -trimpath -buildmode=pie -mod=readonly -modcacherw -o $@ cmd/$(shell basename $@)/main.go
check: $(TARGETS)
- cd tests && ./run.sh ../$(BUILD)
+ cd tests && make BUILD=../$(BUILD)
clean:
rm -rf $(BUILD)
diff --git a/tests/Makefile b/tests/Makefile
@@ -0,0 +1,5 @@
+BUILD :=
+
+all:
+ ./run.sh $(BUILD)
+ diff -u bin/lb.log expected.log
diff --git a/tests/run.sh b/tests/run.sh
@@ -1,10 +1,6 @@
#!/bin/bash
BIN="$1"
TESTS="bin"
-if [ ! -x "$BIN/lb" ]; then
- echo "binaries missing?"
- exit 1
-fi
export LOCKBOX_STORE="$TESTS/lb"
export LOCKBOX_KEYMODE="plaintext"
@@ -63,6 +59,3 @@ LOG=$TESTS/lb.log
_hook > $HOOK
chmod 755 $HOOK
_run 2>&1 | sed "s#$LOCKBOX_STORE##g" > $LOG
-if ! diff -u $LOG expected.log; then
- exit 1
-fi