| cfd13e8d | 02-Mar-2014 |
Stephen Warren <swarren@wwwdotorg.org> |
unit-test: make "test -e" test independent of $CWD
The unit-test for hush's "test -e" currently relies upon being run in the U-Boot build directory, because it tests for the existence of a file that
unit-test: make "test -e" test independent of $CWD
The unit-test for hush's "test -e" currently relies upon being run in the U-Boot build directory, because it tests for the existence of a file that exists in that directory.
Fix this by explicitly creating the file we use for the existence test, and deleting it afterwards so that multiple successive unit-test invocations succeed. This required adding an os.c function to erase files.
Reported-by: Simon Glass <sjg@chromium.org> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
show more ...
|
| fe9ca3d3 | 02-Mar-2014 |
Stephen Warren <swarren@wwwdotorg.org> |
hush: fix some quoted variable expansion issues
The following shell command fails:
if test -z "$x"; then echo "zero"; else echo "non-zero"; fi
(assuming $x does not exist, it prints "non-zero" rat
hush: fix some quoted variable expansion issues
The following shell command fails:
if test -z "$x"; then echo "zero"; else echo "non-zero"; fi
(assuming $x does not exist, it prints "non-zero" rather than "zero").
... since "$x" expands to nothing, and the argument is completely dropped, causing too few to be passed to -z, causing cmd_test() to error out early.
This is because when variable expansions are processed by make_string(), the expanded results are concatenated back into a new string. However, no quoting is applied when doing so, so any empty variables simply don't generate any parameter when the combined string is parsed again.
Fix this by explicitly replacing quoting any argument that was originally quoted when re-generating a string from the already-parsed argument list.
This also fixes loss of whitespace in commands such as:
setenv space " " setenv var " 1${space}${space} 2 " echo ">>${var}<<"
Reported-by: Russell King <linux@arm.linux.org.uk> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
show more ...
|
| 96495d90 | 26-Feb-2014 |
Simon Glass <sjg@chromium.org> |
dm: Add GPIO support and tests
Add driver model support for GPIOs. Since existing GPIO drivers do not use driver model, this feature must be enabled by CONFIG_DM_GPIO. After all GPO drivers are conv
dm: Add GPIO support and tests
Add driver model support for GPIOs. Since existing GPIO drivers do not use driver model, this feature must be enabled by CONFIG_DM_GPIO. After all GPO drivers are converted over we can perhaps remove this config.
Tests are provided for the sandbox implementation, and are a sufficient sanity check for basic operation.
The GPIO uclass understands the concept of named banks of GPIOs, with each GPIO device providing a single bank. Within each bank the GPIOs are numbered using an offset from 0 to n-1. For example a bank named 'b' with 20 offsets will provide GPIOs named b0 to b19.
Anonymous GPIO banks are also supported, and are just numbered without any prefix.
Each time a GPIO driver is added to the uclass, the GPIOs are renumbered accordinging, so there is always a global GPIO numbering order.
Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com> Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
show more ...
|
| 06811959 | 26-Feb-2014 |
Simon Glass <sjg@chromium.org> |
dm: Add a 'dm' command for testing
This command is not required for driver model operation, but can be useful for testing. It provides simple dumps of internal data structures.
Signed-off-by: Simon
dm: Add a 'dm' command for testing
This command is not required for driver model operation, but can be useful for testing. It provides simple dumps of internal data structures.
Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com> Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
show more ...
|
| f2afe701 | 03-Feb-2014 |
Stephen Warren <swarren@nvidia.com> |
unit-test: add lots of tests for the Hush 'test' command
I recently re-wrote cmd_test() to add new features. Add a bunch of unit- tests to make sure I didn't break anything.
Suggested-by: Simon Gla
unit-test: add lots of tests for the Hush 'test' command
I recently re-wrote cmd_test() to add new features. Add a bunch of unit- tests to make sure I didn't break anything.
Suggested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|