From 28b186e83095495aa9829bb1b75de28fd7d3d41b Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 20 Dec 2013 11:19:42 +0000 Subject: Add yarn test for cross-bootstrap --- yarns/architecture.yarn | 11 +++++++++ yarns/implementations.yarn | 61 +++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/yarns/architecture.yarn b/yarns/architecture.yarn index 521575a3..679c804b 100644 --- a/yarns/architecture.yarn +++ b/yarns/architecture.yarn @@ -9,3 +9,14 @@ Morph Cross-Building Tests AND the user attempts to build the system base-system-testarch in branch master THEN morph failed AND the build error message includes the string "Are you trying to cross-build?" + + +Morph Cross-Bootstrap Tests +=========================== + + SCENARIO cross-bootstraping a system for a different architecture + GIVEN a workspace + AND a git server + AND a system called base-system-testarch for the test architecture in the git server + WHEN the user checks out the system branch called master + THEN the user cross-bootstraps the system base-system-testarch in branch master of repo test:morphs to the arch testarch diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 132ce9b3..0fad95be 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -124,6 +124,46 @@ We need a consistent value for the architecture in some tests, so we have a morphology using the test architecture. IMPLEMENTS GIVEN a system called (\S+) for the test architecture in the git server + + cat << EOF > "$DATADIR/gits/test-chunk/stage1-chunk.morph" + name: stage1-chunk + kind: chunk + build-system: dummy + EOF + + run_in "$DATADIR/gits/test-chunk" git init . + run_in "$DATADIR/gits/test-chunk" git add . + run_in "$DATADIR/gits/test-chunk" git commit -m Initial. + + + cat << EOF > "$DATADIR/gits/morphs/build-essential.morph" + name: build-essential + kind: stratum + chunks: + - name: stage1-chunk + repo: test:test-chunk + ref: master + morph: stage1-chunk + build-mode: bootstrap + build-depends: [] + EOF + + cat << EOF > "$DATADIR/gits/morphs/core.morph" + name: core + kind: stratum + build-depends: + - morph: build-essential + ref: master + repo: test:morphs + chunks: + - name: test-chunk + repo: test:test-chunk + ref: master + morph: test-chunk + build-mode: test + build-depends: [] + EOF + cat << EOF > "$DATADIR/gits/morphs/$MATCH_1.morph" arch: testarch configuration-extensions: [] @@ -131,13 +171,20 @@ have a morphology using the test architecture. kind: system name: $MATCH_1 strata: - - name: test-stratum + - name: build-essential repo: test:morphs ref: master - morph: test-stratum + morph: build-essential + - name: core + repo: test:morphs + ref: master + morph: core EOF + + run_in "$DATADIR/gits/morphs" git add "build-essential.morph" + run_in "$DATADIR/gits/morphs" git add "core.morph" run_in "$DATADIR/gits/morphs" git add "$MATCH_1.morph" - run_in "$DATADIR/gits/morphs" git commit -m "Added $MATCH_1 morphology." + run_in "$DATADIR/gits/morphs" git commit -m "Added $MATCH_1 and strata morphologies." Morphologies need to support having a null ref, which means look for the stratum in the same repository and ref. Testing this requires different @@ -466,6 +513,14 @@ Implementation sections for building if [ $MATCH_1 == "builds" ]; then run_morph "$@" else attempt_morph "$@"; fi +Implementation sections for cross-bootstraping +============================================== + + IMPLEMENTS THEN the user cross-bootstraps the system (\S+) in branch (\S+) of repo (\S+) to the arch (\S+) + cd "$DATADIR/workspace/$MATCH_2" + set -- cross-bootstrap "$MATCH_4" "$MATCH_3" "$MATCH_2" "$MATCH_1" + run_morph "$@" + Implementation sections for deployment ====================================== -- cgit v1.2.1