# Test that the mk and ninja files generated by Soong don't change if some # incremental modules are restored from cache.
source "$(dirname "$0")/lib.sh"
function test_build_action_restoring() {
setup
do_test_build_action_restoring
}
function test_build_action_restoring_providers() {
setup
do_test_build_action_restoring "--incremental-provider-test"
}
function do_test_build_action_restoring() {
local test_dir="test_build_action_restoring"
mkdir -p ${test_dir} cat > ${test_dir}/Android.bp <<'EOF'
python_binary_host {
name: "my_little_binary_host",
srcs: ["my_little_binary_host.py"],
}
EOF
touch ${test_dir}/my_little_binary_host.py
run_soong SOONG_INCREMENTAL_ANALYSIS=true "$@"
local dir_before="${test_dir}/before"
mkdir -p ${dir_before} cp -pr out/soong/build.test_arm64*.ninja* ${test_dir}/before # add a comment to the bp file, this should force a new analysis but no module # should be really impacted, so all the incremental modules should be skipped. cat >> ${test_dir}/Android.bp <<'EOF'
// new comments
EOF
run_soong SOONG_INCREMENTAL_ANALYSIS=true "$@"
local dir_after="${test_dir}/after"
mkdir -p ${dir_after} cp -pr out/soong/build.test_arm64*.ninja* ${test_dir}/after
compare_files_parity $dir_before $dir_after rm -rf "$test_dir" echo"test_build_action_restoring test passed"
}
function test_incremental_build_parity() {
setup
local test_dir="test_incremental_build_parity"
run_soong SOONG_INCREMENTAL_ANALYSIS=false
local dir_before="${test_dir}/before"
mkdir -p ${dir_before} cp -pr out/soong/build.test_arm64*.ninja* ${test_dir}/before
# Now run clean build with incremental enabled rm -rf out
run_soong SOONG_INCREMENTAL_ANALYSIS=true
local dir_after="${test_dir}/after"
mkdir -p ${dir_after} cp -pr out/soong/build.test_arm64*.ninja* ${test_dir}/after
compare_incremental_files $dir_before $dir_after rm -rf "$test_dir" echo"test_incremental_build_parity test passed"
}
function test_recreate_module() { # Regression test for b/466891621
setup
# Create two new modules that share a dependency. This should cause them # each to have a meta_lic rule that has the same set of order-only dependencies, # resulting in a deduped order-only phony dependency.
mkdir -p a cat >> a/Android.bp <<EOF
python_binary_host {
name: "my_little_binary_host",
srcs: ["my_little_binary_host.py"],
libs: ["my_little_library_host"],
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.