summaryrefslogtreecommitdiff
path: root/tests/setup_once
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-12-08 13:21:55 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-09 11:57:15 +0000
commitc90af8cff7819d40d0fdd14f1ea9c162f7d5d7d2 (patch)
treefeb40429e34701262bf454d12c867cc84e72486c /tests/setup_once
parentc4a6872bcb4cf2c5e9450004579d65b31aaa3741 (diff)
downloadmorph-c90af8cff7819d40d0fdd14f1ea9c162f7d5d7d2.tar.gz
add method to compute recursive cache id
The cache id will be used as a prefix in filenames in the cache directory. The new way of computing it includes the cache ids of any components so that if chunk A is included in stratum B, and A changes, the new version of A has a new cache id, which means that when we compute cache id for B, it also changes. This will allow us to easily find out if we need to rebuild B. The test repository is split into two: one for the chunk, one for the stratum and system morphologies. This is so that the rebuild test can modify just the chunk, and does not need to trigger both builds. Signed-off-by: Lars Wirzenius <liw@liw.fi>
Diffstat (limited to 'tests/setup_once')
-rwxr-xr-xtests/setup_once36
1 files changed, 26 insertions, 10 deletions
diff --git a/tests/setup_once b/tests/setup_once
index e969c1a3..0fa19fc4 100755
--- a/tests/setup_once
+++ b/tests/setup_once
@@ -1,12 +1,15 @@
#!/bin/sh
#
-# Create a git repository for tests. The repository will contain a simple
-# "hello, world" C program, and two branches ("master", "farrokh"), with
-# the master branch containing just a README. The two branches are there
+# Create git repositories for tests. The chunk repository will contain a
+# simple "hello, world" C program, and two branches ("master", "farrokh"),
+# with the master branch containing just a README. The two branches are there
# so that we can test building a branch that hasn't been checked out.
# The branches are different so that we know that if the wrong branch
# is uses, the build will fail.
#
+# The stratum repository contains a single branch, "master", with a
+# stratum and a system morphology that include the chunk above.
+#
# Copyright (C) 2011 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
@@ -25,9 +28,11 @@
set -e
-repo="$DATADIR/repo"
-mkdir "$repo"
-cd "$repo"
+# Create chunk repository.
+
+chunkrepo="$DATADIR/chunk-repo"
+mkdir "$chunkrepo"
+cd "$chunkrepo"
git init --quiet
cat <<EOF > README
@@ -64,6 +69,19 @@ cat <<EOF > hello.morph
EOF
git add hello.morph
+git commit --quiet -m "add a hello world program and morph"
+
+git checkout --quiet master
+
+
+
+# Create morph repository.
+
+morphsrepo="$DATADIR/morphs-repo"
+mkdir "$morphsrepo"
+cd "$morphsrepo"
+git init --quiet
+
cat <<EOF > hello-stratum.morph
{
"name": "hello-stratum",
@@ -71,7 +89,7 @@ cat <<EOF > hello-stratum.morph
"sources": [
{
"name": "hello",
- "repo": "repo",
+ "repo": "chunk-repo",
"ref": "farrokh"
}
]
@@ -91,7 +109,5 @@ cat <<EOF > hello-system.morph
EOF
git add hello-system.morph
-git commit --quiet -m "add a hello world program and morphs"
-
-git checkout --quiet master
+git commit --quiet -m "add morphs"