aboutsummaryrefslogtreecommitdiffstats
path: root/.extras/test-logic.sh
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-13 10:13:05 +0200
committerDanilo M. <danix@danix.xyz>2026-07-13 10:13:05 +0200
commit1a39e22ddfd989591620995284187fbfbbf93f91 (patch)
tree26bedb8bc8526dcc6f61d79878069ad1736ce8f0 /.extras/test-logic.sh
parenteb749440407dafe821d390e093f2341478f93640 (diff)
downloadsbo-slackbuilds-1a39e22ddfd989591620995284187fbfbbf93f91.tar.gz
sbo-slackbuilds-1a39e22ddfd989591620995284187fbfbbf93f91.zip
test-build: config, arg parsing, version selection
Diffstat (limited to '.extras/test-logic.sh')
-rw-r--r--.extras/test-logic.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/.extras/test-logic.sh b/.extras/test-logic.sh
index 20041a9..81a0841 100644
--- a/.extras/test-logic.sh
+++ b/.extras/test-logic.sh
@@ -30,6 +30,20 @@ bad() { echo " FAIL: $1"; ((fail++)); return 0; }
# Placeholder assertion so this file runs before any logic exists.
ok "script sources without executing main"
+# --- version selection ------------------------------------------------------
+SBO_TREE_CURRENT="/trees/current"
+SBO_TREE_STABLE="/trees/stable"
+IMAGE_CURRENT="sbo-testbuild:current"
+IMAGE_STABLE="sbo-testbuild:15.0"
+
+VERSION_ID="current"; select_version_paths
+[[ "$ACTIVE_TREE" == "/trees/current" ]] && ok "current -> current tree" || bad "current tree wrong: [$ACTIVE_TREE]"
+[[ "$ACTIVE_IMAGE" == "sbo-testbuild:current" ]] && ok "current -> current image" || bad "current image wrong: [$ACTIVE_IMAGE]"
+
+VERSION_ID="15.0"; select_version_paths
+[[ "$ACTIVE_TREE" == "/trees/stable" ]] && ok "15.0 -> stable tree" || bad "stable tree wrong: [$ACTIVE_TREE]"
+[[ "$ACTIVE_IMAGE" == "sbo-testbuild:15.0" ]] && ok "15.0 -> stable image" || bad "stable image wrong: [$ACTIVE_IMAGE]"
+
echo
echo "$pass passed, $fail failed"
[[ $fail -eq 0 ]] || exit 1