summaryrefslogtreecommitdiff
path: root/.pik/integrations.sh
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-05-17 01:37:24 +0200
committerewy <ewy0@protonmail.com>2026-05-17 01:37:24 +0200
commitf5807d9f3a6c96e70912b61fac17120f412b5782 (patch)
treed6928795e06b1af000ffba2ae50bb6f8f7b72685 /.pik/integrations.sh
parent7984fd9beaa7c903288142818cb328c584a139a5 (diff)
* integration tests with a pik target to run them
* add abstraction for paths to facilitate unit tests * flesh out completion (--install-completion) * do sync init before stateless modes so list knows more
Diffstat (limited to '.pik/integrations.sh')
-rw-r--r--.pik/integrations.sh40
1 files changed, 40 insertions, 0 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