mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
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:
parent
2cf86939af
commit
0d6ade2547
11 changed files with 90 additions and 21 deletions
2
dtc.c
2
dtc.c
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue