dtc: Fold comment handling test into testsuite

For ages dtc has included a sample dts, comment-test.dts, for checking
various lexical corner cases in comment processing.  In fact, it
predates the automated testsuite, and has never been integrated into
it.  This patch addresses this oversight, folding the comment handling
test in with the rest of the testsuite.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2008-02-15 15:14:16 +11:00 committed by Jon Loeliger
parent 089adb9964
commit d8b6942666
3 changed files with 21 additions and 0 deletions

16
tests/comments-cmp.dts Normal file
View file

@ -0,0 +1,16 @@
/dts-v1/;
/ {
prop1;
prop2;
prop3;
prop4;
prop5;
prop6;
prop7;
prop8;
prop9;
prop10;
child {
};
};

View file

@ -1,5 +1,6 @@
/* regexps for lexing comments are.. tricky. Check if we've actually /* regexps for lexing comments are.. tricky. Check if we've actually
* got it right */ * got it right */
/dts-v1/;
/ { / {
// line comment // line comment

View file

@ -154,6 +154,10 @@ dtc_tests () {
run_test dtc.sh -I dts -O dtb -o dtc_path-references.test.dtb path-references.dts run_test dtc.sh -I dts -O dtb -o dtc_path-references.test.dtb path-references.dts
run_test path-references dtc_path-references.test.dtb run_test path-references dtc_path-references.test.dtb
run_test dtc.sh -I dts -O dtb -o dtc_comments.test.dtb comments.dts
run_test dtc.sh -I dts -O dtb -o dtc_comments-cmp.test.dtb comments-cmp.dts
run_test dtbs_equal_ordered dtc_comments.test.dtb dtc_comments-cmp.test.dtb
# Check -Odts mode preserve all dtb information # Check -Odts mode preserve all dtb information
for tree in test_tree1.dtb dtc_tree1.test.dtb dtc_escapes.test.dtb ; do for tree in test_tree1.dtb dtc_tree1.test.dtb dtc_escapes.test.dtb ; do
run_test dtc.sh -I dtb -O dts -o odts_$tree.test.dts $tree run_test dtc.sh -I dtb -O dts -o odts_$tree.test.dts $tree