summaryrefslogtreecommitdiff
path: root/.pik
diff options
context:
space:
mode:
Diffstat (limited to '.pik')
-rw-r--r--.pik/integrations.sh40
-rw-r--r--.pik/test.sh4
2 files changed, 43 insertions, 1 deletions
diff --git a/.pik/integrations.sh b/.pik/integrations.sh
new file mode 100644
index 0000000..4c1af78
--- /dev/null
+++ b/.pik/integrations.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+# build pik and set $PIK to the built version
+go build -o pik .
+PIK="$(realpath ./pik)"
+export PIK
+
+cd integration_tests
+
+FAILED=""
+
+for dir in *
+do
+ if [ -d "$dir" ] ; then
+ cd "$dir"
+ for file in *.test.sh
+ do
+ tmpdir=$(mktemp -d)
+ XDG_CACHE_HOME="$tmpdir"
+ XDG_CONFIG_HOME="$tmpdir"
+ export XDG_CACHE_HOME XDG_CONFIG_HOME
+
+ if ! bash "$file" 1>/dev/null 2>&1 ; then
+ echo "$dir/$file $(tput setaf 1)failed$(tput sgr0)" 2>&1
+ bash -x "$file" || true
+ FAILED=yes
+ else
+ echo "$dir/$file $(tput setaf 2)succeeded$(tput sgr0)" 2>&1
+ rm -rf "$tmpdir"
+ fi
+ done
+ cd - > /dev/null
+ fi
+done
+
+if [ -n "$FAILED" ] ; then
+ exit 1
+fi \ No newline at end of file
diff --git a/.pik/test.sh b/.pik/test.sh
index bb91492..ac4945f 100644
--- a/.pik/test.sh
+++ b/.pik/test.sh
@@ -1,2 +1,4 @@
#!/usr/bin/env bash
-go test -tags test -v ./... \ No newline at end of file
+set -euo pipefail
+go test -tags test -v ./...
+bash .pik/integrations.sh \ No newline at end of file