mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-13 12:19:25 +00:00
Merge pull request #8654 from keymanapp/fix/common/8650-deps-flag
fix(common): builder - pass deps flags to child scripts
This commit is contained in:
commit
bb4d335401
6 changed files with 57 additions and 3 deletions
3
resources/build/tests/trees/.gitignore
vendored
3
resources/build/tests/trees/.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
child?.*
|
||||
child?.*
|
||||
dep.*
|
||||
|
|
@ -32,7 +32,7 @@ else
|
|||
fi
|
||||
|
||||
# All child actions will generate files which we need to verify for test
|
||||
rm -f ./child?.*
|
||||
rm -f ./child?.* ./dep.clean ./dep.configure ./dep.build
|
||||
|
||||
function test_present() {
|
||||
local target=$1
|
||||
|
|
@ -45,7 +45,7 @@ function test_present() {
|
|||
if [ ! -f $target.$action ]; then
|
||||
builder_die "$CROSS FAIL: ./$target.$action to be present"
|
||||
else
|
||||
echo "$CHECK PASS: ./$target.$action found as expected"
|
||||
echo -e "$CHECK PASS: ./$target.$action found as expected"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ cd "$THIS_SCRIPT_PATH"
|
|||
project=child1
|
||||
|
||||
builder_describe "$project test module" \
|
||||
"@../dep" \
|
||||
clean \
|
||||
configure \
|
||||
build \
|
||||
|
|
|
|||
41
resources/build/tests/trees/dep/build.sh
Executable file
41
resources/build/tests/trees/dep/build.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
||||
# Test builder_describe_outputs and dependencies
|
||||
|
||||
project=dep
|
||||
|
||||
builder_describe "$project test module" \
|
||||
clean \
|
||||
configure \
|
||||
build
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
if builder_is_child_build; then
|
||||
builder_die "FAIL: builder_is_child_build should return false but was $_builder_is_child for a dependency script"
|
||||
else
|
||||
builder_echo "PASS: builder_is_child_build is false ($_builder_is_child) for the dependency script"
|
||||
fi
|
||||
|
||||
function test_action() {
|
||||
local action=$1
|
||||
|
||||
if builder_start_action $action; then
|
||||
touch ../$project.$action
|
||||
builder_finish_action success $action
|
||||
fi
|
||||
}
|
||||
|
||||
test_action clean
|
||||
test_action configure
|
||||
test_action build
|
||||
|
|
@ -2,16 +2,26 @@
|
|||
|
||||
set -eu
|
||||
|
||||
echo "--- Full clean configure build install test build ---"
|
||||
./build.sh clean configure build install test
|
||||
if [ $(ls child?.* | wc -l) -ne 14 ]; then
|
||||
echo unexpected output file count
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "--- Test error result for child build ---"
|
||||
./build.sh error && (echo should not have passed; exit 1) || (echo " ... build returned error as expected")
|
||||
|
||||
echo "--- Test building only specific actions and targets (install:child1 test:child2) ---"
|
||||
./build.sh install:child1 test:child2
|
||||
if [ $(ls child?.* | wc -l) -ne 2 ]; then
|
||||
echo unexpected output file count
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "--- Test that --no-deps is passed correctly to child scripts ---"
|
||||
./build.sh --no-deps
|
||||
if [ -f ./dep.configure ] || [ -f ./dep.build ]; then
|
||||
echo unexpected dep.configure or dep.build file, should not have built this because of --no-deps flag
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -394,6 +394,7 @@ _builder_execute_child() {
|
|||
|
||||
"$script" $action \
|
||||
--builder-child \
|
||||
$_builder_build_deps \
|
||||
${child_options[@]} \
|
||||
$builder_verbose \
|
||||
$builder_debug \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue