summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2014-09-24 20:54:18 +0000
committerRichard Maw <richard.maw@gmail.com>2014-10-01 09:30:15 +0000
commit3c27e08f558bd55b9a39ee8a0a43a08881126f1c (patch)
treec8e89623e5de6f49d2b982a412cf1bf6df7d3274
parent54c81674db48d5c9eb151199ef1bc434fd1bd4a6 (diff)
downloadmorph-3c27e08f558bd55b9a39ee8a0a43a08881126f1c.tar.gz
Move architecture existing test to yarn
-rw-r--r--tests.as-root/archless-system-fails.exit1
-rwxr-xr-xtests.as-root/archless-system-fails.script35
-rw-r--r--tests.as-root/archless-system-fails.stderr1
-rw-r--r--yarns/architecture.yarn12
-rw-r--r--yarns/implementations.yarn19
5 files changed, 31 insertions, 37 deletions
diff --git a/tests.as-root/archless-system-fails.exit b/tests.as-root/archless-system-fails.exit
deleted file mode 100644
index d00491fd..00000000
--- a/tests.as-root/archless-system-fails.exit
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/tests.as-root/archless-system-fails.script b/tests.as-root/archless-system-fails.script
deleted file mode 100755
index e34e9ad6..00000000
--- a/tests.as-root/archless-system-fails.script
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2011-2014 Codethink Limited
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
-## Raise an error if system has no architecture defined.
-
-set -eu
-
-cd "$DATADIR/morphs"
-git checkout --quiet -b archless master
-cat <<EOF >archless-system.morph
-name: archless-system
-kind: system
-strata:
- - morph: hello-stratum
-EOF
-git add archless-system.morph
-git commit --quiet -m "add archless system"
-
-"$SRCDIR/scripts/test-morph" \
- build-morphology test:morphs archless archless-system
diff --git a/tests.as-root/archless-system-fails.stderr b/tests.as-root/archless-system-fails.stderr
deleted file mode 100644
index 71e7dbb0..00000000
--- a/tests.as-root/archless-system-fails.stderr
+++ /dev/null
@@ -1 +0,0 @@
-ERROR: Missing field arch from morphology string
diff --git a/yarns/architecture.yarn b/yarns/architecture.yarn
index d4de308e..07274ec3 100644
--- a/yarns/architecture.yarn
+++ b/yarns/architecture.yarn
@@ -22,3 +22,15 @@ Morph Cross-Bootstrap Tests
WHEN the user checks out the system branch called master
THEN the user cross-bootstraps the system base-system-testarch.morph in branch master of repo test:morphs to the arch testarch
FINALLY the git server is shut down
+
+Architecture validation Tests
+=============================
+
+ SCENARIO building a system with no architecture
+ GIVEN a workspace
+ AND a git server
+ AND a system called base-system-noarch.morph with no architecture in the git server
+ WHEN the user checks out the system branch called master
+ AND the user attempts to build the system base-system-testarch.morph in branch master
+ THEN morph failed
+ FINALLY the git server is shut down
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index 9cf497fc..86c3a9c4 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -363,6 +363,25 @@ have a morphology using the test architecture.
run_in "$DATADIR/gits/morphs" git add "$MATCH_1"
run_in "$DATADIR/gits/morphs" git commit -m "Added $MATCH_1 and strata morphologies."
+You need an architecture to build a system, we don't default to the host architecture.
+
+ IMPLEMENTS GIVEN a system called (\S+) with no architecture in the git server
+ name="$(basename "${MATCH_1%.*}")"
+ cat << EOF > "$DATADIR/gits/morphs/$MATCH_1"
+ configuration-extensions: []
+ description: A system called $name for test architecture
+ kind: system
+ name: $name
+ strata:
+ - name: build-essential
+ morph: strata/build-essential.morph
+ - name: core
+ morph: strata/core.morph
+ EOF
+
+ run_in "$DATADIR/gits/morphs" git add "$MATCH_1"
+ run_in "$DATADIR/gits/morphs" git commit -m "Added $MATCH_1."
+
Implementation sections for system branch operations
----------------------------------------------------