of: Add device tree selftests

Add some runtime test cases for the library of device tree parsing functions.

v2: - Add testcase for phandle with 0 args
    - Don't run testcases if testcase data isn't present in device tree

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
Grant Likely
2011-12-12 09:25:57 -07:00
parent 15c9a0acc3
commit 53a42093d9
6 changed files with 189 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
/ {
testcase-data {
phandle-tests {
provider0: provider0 {
#phandle-cells = <0>;
};
provider1: provider1 {
#phandle-cells = <1>;
};
provider2: provider2 {
#phandle-cells = <2>;
};
provider3: provider3 {
#phandle-cells = <3>;
};
consumer-a {
phandle-list = <&provider1 1>,
<&provider2 2 0>,
<0>,
<&provider3 4 4 3>,
<&provider2 5 100>,
<&provider0>,
<&provider1 7>;
phandle-list-names = "first", "second", "third";
phandle-list-bad-phandle = <12345678 0 0>;
phandle-list-bad-args = <&provider2 1 0>,
<&provider3 0>;
};
};
};
};

View File

@@ -0,0 +1 @@
/include/ "tests-phandle.dtsi"

View File

@@ -46,3 +46,5 @@
};
};
};
/include/ "testcases/tests.dtsi"