History log of /external/dtc/tests/fdtget-runtest.sh
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1760e7ca03894689118646e229ca9487158cd0e8 11-Dec-2012 Stephen Warren <swarren@nvidia.com> fdtget-runtest.sh: use printf instead of /bin/echo -e

Not all /bin/echo implementations support the -e option. Instead, use
printf, which appears to be more widely available than /bin/echo -e.

See commit eaec1db "fdtget-runtest.sh: Fix failures when /bin/sh isn't
bash" for history.

I have tested this on Ubuntu 10.04 with /bin/sh pointing to both dash
and bash.

Reported-by: Mike Frysinger <vapier@gentoo.org> # and implemented-by
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/fdtget-runtest.sh
eaec1dbc5946d5fd01a9ef7120f8461c74d759a0 21-Mar-2012 Stephen Warren <swarren@wwwdotorg.org> fdtget-runtest.sh: Fix failures when /bin/sh isn't bash

On Ubuntu, /bin/sh is dash (at least by default), and dash's echo doesn't
accept the -e option. This means that fdtget-runtest.sh's EXPECT file will
contain "-e foo" rather than just "foo", which causes a test failure.

To work around this, run /bin/echo instead of (builtin) echo, which has
more chance of supporting the -e option.

Another possible fix is to change all the #! lines to /bin/bash rather
than /bin/sh, and change run_tests.sh to invoke sub-scripts using $SHELL
instead of just "sh". However, that would require bash specifically, which
may not be desirable.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/fdtget-runtest.sh
097ec97c1a35685957210adb93692c3e210bc82c 03-Mar-2012 Simon Glass <sjg@chromium.org> fdtget: Fix multiple arg bug and add test for it

There is a rather unfortunate bug in fdtget in that if multiple argument
sets are provided, it just repeats displaying the first set ones for
each set.

Fix this bug and add a test for it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/fdtget-runtest.sh
c34e88354a07099dbc15a41621c81f71325d25fd 03-Feb-2012 David Gibson <david@gibson.dropbear.id.au> Don't use diff to check fdt{get,put} results

Currently the fdt{get,put}-runtest.sh scripts invoke diff to check if
fdt{get,put} did the right thing. This isn't great though: it's not
obvious from the diff output which is the expected and which is the
actual result; diff's line by line behaviour is useless here, since all
the results are a single line and finally, when there is a difference
it always prints information even when the tests are supposed to be
running in quiet mode.

This patch uses cmp instead, and explicitly prints the expected results,
when running in verbose mode (the invocation of fdtget itself will have
already displayed the actual results in this mode.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/fdtget-runtest.sh
15b23d21a62b5a0295ee08b54d0842889ce94c92 03-Feb-2012 David Gibson <david@gibson.dropbear.id.au> Clean up invocation of fdt{get,put} tests

This patch cleans up how the fdtget and fdtput tests are invoked.
Specifically we no longer hide the full command lines with a wrapper
function - this makes it possible to distinguish fdtget from similar
fdtput tests and makes it easier to work out how to manually invoke an
individual failing test.

In addition, we remove the testing for errors from the
fdt{get,put}-runtest.sh script, instead using an internal wrapper
analagous to run_wrap_test which can test for any program invocation
that's expected to return an error.

For a couple of the fdtput tests this would result in printing out
ludicrously large command lines. Therefore we introduce a new
mechanism to cut those down to something reasonable.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/fdtget-runtest.sh
c879a8a28b168b3b448ca8a107e3386eda6829c7 03-Feb-2012 David Gibson <david@gibson.dropbear.id.au> Factor signal checks out of test scripts

Several test scripts now have some code to check for a program returning
a signal, and reporting a suitable failure. This patch moves this
duplicated code into a helper function in tests.sh. At the same time we
remove a bashism found in the current copies (using the non portablr $[ ]
construct for arithmetic).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/fdtget-runtest.sh
2ca83614e78f32e68202100e94668b0bb62f1ba6 03-Feb-2012 David Gibson <david@gibson.dropbear.id.au> Use 'trap' builtin to clean up temporaries in test scripts

Some of the test scripts create temporary files, which we remove at the
end. Except that we usually forgot to remove them on some exit paths. To
avoid this problem in future, this modifies the scripts to use the shell's
trap 0 functionality to automatically remove the temporaries on any exit.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/fdtget-runtest.sh
9a50d82c4e3a44ca004ada288f7c37004da0b0cc 03-Feb-2012 David Gibson <david@gibson.dropbear.id.au> Remove unused variable from test scripts

Several of the test scripts remove $TMPFILE, without ever having set
the TMPFILE variable. This patch fixes it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/tests/fdtget-runtest.sh
68d057f20d7c3a93b441d2892c4749392bc83b45 21-Jan-2012 Simon Glass <sjg@chromium.org> Add fdtget utility to read property values from a device tree

This simply utility makes it easy for scripts to read values from the device
tree. It is written in C and uses the same libfdt as the rest of the dtc
package.

What is it for:
- Reading fdt values from scripts
- Extracting fdt information within build systems
- Looking at particular values without having to dump the entire tree

To use it, specify the fdt binary file on command line followed by a list of
node, property pairs. The utility then looks up each node, finds the property
and displays the value.

Each value is printed on a new line.

fdtget tries to guess the type of each property based on its contents. This
is not always reliable, so you can use the -t option to force fdtget to decode
the value as a string, or byte, etc.

To read from stdin, use - as the file.

Usage:
fdtget <options> <dt file> [<node> <property>]...
Options:
-t <type> Type of data
-h Print this help

<type> s=string, i=int, u=unsigned, x=hex
Optional modifier prefix:
hh or b=byte, h=2 byte, l=4 byte (default)

Signed-off-by: Simon Glass <sjg@chromium.org>
/external/dtc/tests/fdtget-runtest.sh