Skip to content

Commit

Permalink
test: extend layers test to out-of-source builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jkloetzke committed Oct 17, 2024
1 parent 97d5030 commit 6c697c4
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions test/black-box/layers-checkout/run.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/bash -e
. ../../test-lib.sh 2>/dev/null || { echo "Must run in script directory!" ; exit 1 ; }

foo_dir=$(mktemp -d)
bar_dir=$(mktemp -d)
baz_dir=$(mktemp -d)
trap 'rm -rf "$foo_dir" "$bar_dir" "$baz_dir" layers layers.attic log-status.txt' EXIT
tmp_dir=$(mktemp -d)
mkdir -p "$tmp_dir/"{foo,bar,baz,ext}
foo_dir="$tmp_dir/foo"
bar_dir="$tmp_dir/bar"
baz_dir="$tmp_dir/baz"
ext_dir="$tmp_dir/ext"
trap 'rm -rf "$tmp_dir" layers layers.attic log-status.txt' EXIT
cleanup

# build the git layer bar/1
Expand Down Expand Up @@ -120,6 +123,22 @@ run_bob layers update -DBAR_1_COMMIT=${bar_c0} -DBAR_2_COMMIT=${bar_c1} -DBAR_DI
cleanup
rm -rf layers

# Do the build and update in an external build tree. SCM backed layers are
# checked out into the build tree rather than the project tree.
run_bob init . "$ext_dir"
pushd "$ext_dir"
run_bob dev root -DBAR_1_COMMIT=${bar_c0} -DBAR_2_COMMIT=${bar_c1} -DBAR_DIR=${bar_dir} \
-DBAZ_DIR=${baz_dir} -DBAZ_COMMIT="${baz_c0}" \
-DBAZ1_COMMIT="${baz_c2}" \
-DFOO_DIR=${foo_dir} -DFOO_COMMIT="${foo_c0}" -vvv
expect_exist layers
run_bob layers update -DBAR_1_COMMIT=${bar_c0} -DBAR_2_COMMIT=${bar_c1} -DBAR_DIR=${bar_dir} \
-DBAZ_DIR=${baz_dir} -DBAZ_COMMIT="${baz_c0}" \
-DBAZ1_COMMIT="${baz_c2}" \
-DFOO_DIR=${foo_dir} -DFOO_COMMIT="${foo_c0}"
popd
expect_not_exist layers

# if the layer already exists we fail
mkdir -p layers/bar

Expand Down

0 comments on commit 6c697c4

Please sign in to comment.