dtc: Add testcases for tree checks

This patch adds a group of testcases to check that dtc correctly
rejects trees with various structural errors.

To make things easier to test, we change dtc so that failing checks
(as opposed to other errors) result in exit code 2.

This patch also fixes an embarrasing bug uncovered by these new tests:
check_phandles() worked out if the tree's phandles were valid, then
throws that information away and returns success always.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2007-11-20 16:24:23 +11:00 committed by Jon Loeliger
parent 2cf86939af
commit 0d6ade2547
11 changed files with 90 additions and 21 deletions

2
dtc.c
View file

@ -197,7 +197,7 @@ int main(int argc, char *argv[])
if (!structure_ok) {
if (!force) {
fprintf(stderr, "ERROR: Input tree has structural errors, aborting (use -f to force output)\n");
exit(1);
exit(2);
} else if (quiet < 3) {
fprintf(stderr, "Warning: Input tree has structural errors, output forced\n");
}