aboutsummaryrefslogtreecommitdiff
path: root/include/test
diff options
context:
space:
mode:
authorSimon Glass2022-09-06 20:27:11 -0600
committerTom Rini2022-09-29 16:11:14 -0400
commit8d468a188f69424b3461ba681a26b95bb9679f53 (patch)
tree138ca8a47a3cdfb49dc88affb0453ababdd30fad /include/test
parent756c01422dfa193097aa3d43c083b8b23e4b2301 (diff)
sandbox: test: Provide an easy way to use the other FDT
Add a test flag which indicates that the 'other' FDT should be set up ready for use. Handle this by copying in the FDT, unflattening it for livetree tests. Free the structures when the tests have run. We cannot use the other FDT unless we are using live tree or OFNODE_MULTI_TREE is enabled, since only one tree is supported by the ofnode interface in that case. Add this condition into ut_run_test_live_flat() and update the comments. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/test')
-rw-r--r--include/test/test.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/test/test.h b/include/test/test.h
index 225bf455043..3bbd77c38b5 100644
--- a/include/test/test.h
+++ b/include/test/test.h
@@ -25,6 +25,7 @@
* @fdt_size: Size of the device-tree copy
* @other_fdt: Buffer for the other FDT (UT_TESTF_OTHER_FDT)
* @other_fdt_size: Size of the other FDT (UT_TESTF_OTHER_FDT)
+ * @of_other: Live tree for the other FDT
* @runs_per_test: Number of times to run each test (typically 1)
* @expect_str: Temporary string used to hold expected string value
* @actual_str: Temporary string used to hold actual string value
@@ -43,6 +44,7 @@ struct unit_test_state {
uint fdt_size;
void *other_fdt;
int other_fdt_size;
+ struct device_node *of_other;
int runs_per_test;
char expect_str[512];
char actual_str[512];
@@ -58,6 +60,7 @@ enum {
UT_TESTF_CONSOLE_REC = BIT(5), /* needs console recording */
/* do extra driver model init and uninit */
UT_TESTF_DM = BIT(6),
+ UT_TESTF_OTHER_FDT = BIT(7), /* read in other device tree */
};
/**