Mercurial > hg > toybox
annotate tests/zcat.test @ 1499:319e79bab052 draft
Separate more commands so single.sh can build them standalone.
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 26 Sep 2014 18:42:23 -0500 |
parents | 8700cbe1cb29 |
children |
rev | line source |
---|---|
1457
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
1 #!/bin/bash |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
2 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
3 # Copyright 2014 Divya Kothari <divya.s.kothari@gmail.com> |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
4 # Copyright 2014 Naha Maggu <maggu.neha@gmail.com> |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
5 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
6 [ -f testing.sh ] && . testing.sh |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
7 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
8 #testing "name" "command" "result" "infile" "stdin" |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
9 echo "hello" > file |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
10 tar -czf file.gz file |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
11 # Get system zcat |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
12 zcatExe=`which zcat` |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
13 $zcatExe file.gz > zcatOut |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
14 testing "zcat - decompresses a single file" "zcat file.gz > Tempfile && echo "yes"; diff Tempfile zcatOut && echo "yes"; rm -rf file* zcatOut Tempfile" "yes\nyes\n" "" "" |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
15 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
16 #testing "name" "command" "result" "infile" "stdin" |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
17 echo "hello" > file1 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
18 echo "hi" > file2 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
19 echo "Hi, Good morning !! I am a bzcat tester" > file3 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
20 tar -czf file1.gz file1 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
21 tar -czf file2.gz file2 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
22 tar -czf file3.gz file3 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
23 # Get system zcat |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
24 zcatExe=`which zcat` |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
25 $zcatExe file1.gz file2.gz file3.gz > zcatOut |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
26 testing "zcat - decompresses multiple files" "zcat file1.gz file2.gz file3.gz > Tempfile && echo "yes" ; diff Tempfile zcatOut && echo "yes"; rm -rf file* zcatOut Tempfile " "yes\nyes\n" "" "" |