Mercurial > hg > toybox
annotate tests/bzcat.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 -cjf file.tar.bz2 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 bzcat |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
12 bzcatExe=`which bzcat` |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
13 $bzcatExe file.tar.bz2 > bzcatOut |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
14 testing "bzcat - decompresses a single file" "bzcat file.tar.bz2 > Tempfile && echo "yes"; diff Tempfile bzcatOut && echo "yes"; rm -rf file* bzcatOut 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 -cjf file1.tar.bz2 file1 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
21 tar -cjf file2.tar.bz2 file2 |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
22 tar -cjf file3.tar.bz2 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 bzcat |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
24 bzcatExe=`which bzcat` |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
25 $bzcatExe file1.tar.bz2 file2.tar.bz2 file3.tar.bz2 > bzcatOut |
d9e937417636
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff
changeset
|
26 testing "bzcat - decompresses multiple files" "bzcat file1.tar.bz2 file2.tar.bz2 file3.tar.bz2 > Tempfile && echo "yes" ; diff Tempfile bzcatOut && echo "yes"; rm -rf file* bzcatOut Tempfile " "yes\nyes\n" "" "" |