aboutsummaryrefslogtreecommitdiff
path: root/tests/tail.test
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-04-07 23:15:52 -0700
committerRob Landley <rob@landley.net>2017-04-15 23:14:19 -0500
commit060a9f3380c5c778ab100f52fe5d1a41b0fd8a6c (patch)
tree2a28a86a9b0ee3048fa506b2550fb8d06473a5a8 /tests/tail.test
parent007af3537d18c15de1e632e5731ee57b5b817067 (diff)
downloadtoybox-060a9f3380c5c778ab100f52fe5d1a41b0fd8a6c.tar.gz
Speed up tail.test for shells without builtin printf.
The test only needs echo, and Android currently doesn't use mksh's builtin printf; the toybox printf is fuller featured and less buggy, but a lot slower to call in a loop like this (and mksh doesn't fall back to the printf on the path if given something it can't handle, so we can't have the best of both worlds). Without this hack, the tail test takes as long as all the other tests put together.
Diffstat (limited to 'tests/tail.test')
-rwxr-xr-xtests/tail.test5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/tail.test b/tests/tail.test
index 81dc871f..b148aebc 100755
--- a/tests/tail.test
+++ b/tests/tail.test
@@ -43,13 +43,12 @@ testing "noseek -c+ out of bonds" "tail -c +999" "" "" "$BIGTEST"
makebigfile()
{
-
for j in $(seq 1 100)
do
- printf "%s " $j
+ echo -n "$j "
for i in $(seq 1 100)
do
- printf %s 123456789abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
+ echo -n 123456789abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
done
echo
done