commit b397ac9363cedaa37b4e252f50ab65081067c2f2
parent e82bf5eb478e915fbc6a480c3749bd1ecac1724e
Author: lash <dev@holbrook.no>
Date: Sun, 9 Jan 2022 15:46:55 +0000
Add start, refresh tests
Diffstat:
3 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/run_tests.sh b/run_tests.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set +e
+bash tests/test_list.sh
+bash tests/test_start.sh
+bash tests/test_refresh.sh
+set -e
diff --git a/tests/test_refresh.sh b/tests/test_refresh.sh
@@ -0,0 +1,28 @@
+. tests/test_list.sh
+
+hl=$(mktemp)
+
+pushd $ts
+for d in ${ds[@]}; do
+ pushd $d
+ uuidgen > data.txt
+ git commit -a -m "more commit"
+ git rev-parse HEAD >> $hl
+ popd
+done
+popd
+
+bash ./gitrefresh.sh update $td
+
+hr=$(mktemp)
+pushd $td
+for d in ${ds[@]}; do
+ pushd $d
+ git remote update
+ git pull --ff-only
+ git rev-parse HEAD >> $hr
+ popd
+done
+popd
+
+diff $hl $hr
diff --git a/tests/test_start.sh b/tests/test_start.sh
@@ -0,0 +1,19 @@
+. tests/test_list.sh
+
+tn=$(mktemp -d)
+
+>&2 echo "bootstrap on $tn"
+
+cat $vl | bash ./gitstart.sh $tn
+
+vn=$(mktemp)
+bash ./gitlist.sh $td | sort > $vn
+diff $vr $vn
+
+fns=(a.git b.git c.git)
+for f in ${fns[@]}; do
+ echo checking $tn/$f
+ if [ ! -d $tn/$f ]; then
+ exit 1;
+ fi
+done