Browse Source

Added test cases for target references

This commit adds test cases for commits "Correct overlay syntactic
sugar for generating target-path fragments" and "Merge nodes with
local target label references".

It verifies that target path references are not resolved locally and
that target label references that can be resolved locally are.

Signed-off-by: Fredrik Markstrom <fredrik.markstrom@gmail.com>
[dwg: Fixed some whitespace problems]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Fredrik Markstrom 6 years ago committed by David Gibson
parent
commit
e45198c983
  1. 29
      tests/overlay_overlay_local_merge.dts
  2. 5
      tests/run_tests.sh

29
tests/overlay_overlay_local_merge.dts

@ -0,0 +1,29 @@
/*
* Copyright (c) 2016 NextThing Co
* Copyright (c) 2016 Free Electrons
* Copyright (c) 2016 Konsulko Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/

/dts-v1/;
/plugin/;

&test {
parent: new-node {
parent-property;
};
};

&parent {
new-merged-property;
new-merged-node {
new-property;
};
};

&{/} {
new-root-node {
new-root-node-property;
};
};

5
tests/run_tests.sh

@ -257,6 +257,11 @@ dtc_overlay_tests () {
run_test check_path overlay_overlay_bypath.test.dtb not-exists "/__fixups__" run_test check_path overlay_overlay_bypath.test.dtb not-exists "/__fixups__"
run_test check_path overlay_overlay_bypath.test.dtb exists "/__local_fixups__" run_test check_path overlay_overlay_bypath.test.dtb exists "/__local_fixups__"


# Make sure local target references are resolved and nodes are merged and that path references are not
run_dtc_test -I dts -O dtb -o overlay_overlay_local_merge.test.dtb overlay_overlay_local_merge.dts
run_test check_path overlay_overlay_local_merge.test.dtb exists "/fragment@0/__overlay__/new-node/new-merged-node"
run_test check_path overlay_overlay_local_merge.test.dtb exists "/fragment@1/__overlay__/new-root-node"

# Check building works the same as manual constructions # Check building works the same as manual constructions
run_test dtbs_equal_ordered overlay_overlay.test.dtb overlay_overlay_nosugar.test.dtb run_test dtbs_equal_ordered overlay_overlay.test.dtb overlay_overlay_nosugar.test.dtb



Loading…
Cancel
Save