summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2013-10-08 13:09:37 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2013-10-08 13:09:37 +0000
commit50eb2d9039a3598be64e977a9c2d4bbcdad4a414 (patch)
treea6b222c1b87fdeafbc37fabc03f8f5adaa8ff952
parentdf64e4300d7b39c29ce75273196a7894c86a98a9 (diff)
downloadmorph-50eb2d9039a3598be64e977a9c2d4bbcdad4a414.tar.gz
Add yarn test for autotools version guesser
-rw-r--r--yarns/branches-workspaces.yarn8
-rw-r--r--yarns/implementations.yarn35
2 files changed, 43 insertions, 0 deletions
diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn
index f523ebcd..cd3f7a0e 100644
--- a/yarns/branches-workspaces.yarn
+++ b/yarns/branches-workspaces.yarn
@@ -352,3 +352,11 @@ Petrifying also leaves null refs unmolested
AND remembering all refs in foo
AND petrifying foo
THEN in branch foo, system test-system refs test-stratum in None
+
+Generating a manifest works
+
+ SCENARIO morph generates a manifest
+ GIVEN a workspace
+ AND a system artifact
+ WHEN morph generates a manifest
+ THEN the manifest is generated
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index e35e4219..14ac685c 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -382,3 +382,38 @@ Tagging.
assert_morphologies_are_petrified "$MATCH_1" temptemptemp
done
+Generating a manifest.
+
+ IMPLEMENTS GIVEN a system artifact
+ mkdir "$DATADIR/hello_world"
+
+ git init "$DATADIR/hello_world"
+ touch "$DATADIR/hello_world/configure.ac"
+ run_in "$DATADIR/hello_world" git add configure.ac
+ run_in "$DATADIR/hello_world" git commit -m 'Add configure.ac'
+
+ mkdir "$DATADIR/baserock"
+ run_in "$DATADIR/hello_world" cat << EOF > "$DATADIR/baserock/hello_world.meta"
+ {
+ "artifact-name": "hello_world",
+ "cache-key": "ab8d00a80298a842446ce23507cea6b4d0e34c7ddfa05c67f460318b04d21308",
+ "kind": "chunk",
+ "morphology": "hello_world.morph",
+ "original_ref": "$(run_in "$DATADIR/hello_world" git rev-parse HEAD)",
+ "repo": "file://$DATADIR/hello_world",
+ "repo-alias": "upstream:hello_world",
+ "sha1": "$(run_in "$DATADIR/hello_world" git rev-parse HEAD)",
+ "source-name": "hello_world"
+ }
+ EOF
+ run_in "$DATADIR" tar -c baserock > "$DATADIR/artifact.tar"
+
+ IMPLEMENTS WHEN morph generates a manifest
+ run_morph generate-manifest "$DATADIR/artifact.tar" > "$DATADIR/manifest"
+
+ IMPLEMENTS THEN the manifest is generated
+
+ # Generated manifest should contain the name of the repository
+ if ! grep -q hello_world "$DATADIR/manifest"; then
+ die "Output isn't what we expect"
+ fi