[Crosstoolchain-logs] [device-tree-compiler] 260/357: dtc: Testcases for input handling

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:06:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/1.3.x
in repository device-tree-compiler.

commit 6c2e4d61f83af4233c3270e4f1ec1da01d90466e
Author: David Gibson <david at gibson.dropbear.id.au>
Date:   Wed Mar 5 16:22:41 2008 +1100

    dtc: Testcases for input handling
    
    This patch adds some testcases checking corner cases of dtc's input
    file handling.  Specifically it checks that dtc works correctly when
    given input via stdin, and it checks that dtc fails gracefully if
    given a nonexistent input file (or directory, in the case of -Ifs
    mode).
    
    Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
 tests/dtc-fatal.sh | 14 ++++++++++++++
 tests/run_tests.sh | 11 +++++++++++
 2 files changed, 25 insertions(+)

diff --git a/tests/dtc-fatal.sh b/tests/dtc-fatal.sh
new file mode 100644
index 0000000..8eb1b44
--- /dev/null
+++ b/tests/dtc-fatal.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+. tests.sh
+
+verbose_run $VALGRIND "$DTC" -o/dev/null "$@"
+ret="$?"
+
+if [ "$ret" -gt 127 ]; then
+    FAIL "dtc killed by signal (ret=$ret)"
+elif [ "$ret" != "1" ]; then
+    FAIL "dtc returned incorrect status $ret instead of 1"
+fi
+
+PASS
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 3d09cfc..27dc11a 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -238,6 +238,17 @@ dtc_tests () {
     run_sh_test dtc-checkfails.sh node_name_chars -- -I dtb -O dtb bad_node_char.dtb
     run_sh_test dtc-checkfails.sh node_name_format -- -I dtb -O dtb bad_node_format.dtb
     run_sh_test dtc-checkfails.sh prop_name_chars -- -I dtb -O dtb bad_prop_char.dtb
+
+    # Check for proper behaviour reading from stdin
+    run_dtc_test -I dts -O dtb -o stdin_dtc_tree1.test.dtb - < test_tree1.dts
+    run_wrap_test cmp stdin_dtc_tree1.test.dtb dtc_tree1.test.dtb
+    run_dtc_test -I dtb -O dts -o stdin_odts_test_tree1.dtb.test.dts - < test_tree1.dtb
+    run_wrap_test cmp stdin_odts_test_tree1.dtb.test.dts odts_test_tree1.dtb.test.dts
+
+    # Check for graceful failure in some error conditions
+    run_sh_test dtc-fatal.sh -I dts -O dtb nosuchfile.dts
+    run_sh_test dtc-fatal.sh -I dtb -O dtb nosuchfile.dtb
+    run_sh_test dtc-fatal.sh -I fs -O dtb nosuchfile
 }
 
 while getopts "vt:m" ARG ; do

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list