summaryrefslogtreecommitdiff
path: root/tests.branching/setup
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-22 18:33:00 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-22 18:33:00 +0000
commitb64a08879c6c6c7e57625ce8c339ce33af193cc4 (patch)
tree285033917a1aaff8edb3ac9948bf6a8b0acaab32 /tests.branching/setup
parent7286464a9feed92910fa57185d9eeefcb4da8a3c (diff)
downloadmorph-b64a08879c6c6c7e57625ce8c339ce33af193cc4.tar.gz
Create dummy git repositories for morphs, hello
Diffstat (limited to 'tests.branching/setup')
-rwxr-xr-xtests.branching/setup55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests.branching/setup b/tests.branching/setup
index cb1c2f4a..61f966e2 100755
--- a/tests.branching/setup
+++ b/tests.branching/setup
@@ -16,7 +16,62 @@
# Set up $DATADIR.
+#
+# - an empty morph mine directory
+# - a git repository called "morphs" for fake system, stratum morphologies
+# - a git repository calle "hello" for a dummy chunk
set -eu
+
+# Create an empty directory to be used as a morph mine
mkdir "$DATADIR/mine"
+
+
+# Create a fake morphs repository
+mkdir "$DATADIR/morphs"
+
+cat <<EOF > "$DATADIR/morphs/hello-system.chunk"
+{
+ "name": "hello-system",
+ "kind": "system",
+ "disk-size": "1G",
+ "strata": [
+ "hello-stratum"
+ ]
+}
+EOF
+
+cat <<EOF > "$DATADIR/morphs/hello-stratum.chunk"
+{
+ "name": "hello-stratum",
+ "kind": "stratum",
+ "sources": [
+ {
+ "name": "hello",
+ "ref": "master"
+ }
+ ]
+}
+EOF
+
+scripts/run-git-in "$DATADIR/morphs" init
+scripts/run-git-in "$DATADIR/morphs" add .
+scripts/run-git-in "$DATADIR/morphs" commit -m initial
+
+
+# Create a dummy chunk repository
+mkdir "$DATADIR/hello"
+
+cat <<EOF > "$DATADIR/hello/hello.chunk"
+{
+ "name": "hello",
+ "kind": "chunk",
+ "build-system": "dummy"
+}
+EOF
+
+scripts/run-git-in "$DATADIR/hello" init
+scripts/run-git-in "$DATADIR/hello" add .
+scripts/run-git-in "$DATADIR/hello" commit -m initial
+