annotate tests/xzcat.test @ 1776:7bf68329eb3b draft default tip

Repository switched to git at https://github.com/landley/toybox
author Rob Landley <rob@landley.net>
date Thu, 09 Apr 2015 02:28:32 -0500
parents 8700cbe1cb29
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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.xz 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 xzcat
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
12 xzcatExe=`which xzcat`
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
13 $xzcatExe file.xz > xzcatOut
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
14 testing "xzcat - decompresses a single file" "xzcat file.xz > Tempfile && echo "yes"; diff Tempfile xzcatOut && echo "yes"; rm -rf file* xzcatOut 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 xzcat 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.xz 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.xz 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.xz 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 xzcat
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
24 xzcatExe=`which xzcat`
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
25 $xzcatExe file1.xz file2.xz file3.xz > xzcatOut
d9e937417636 Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari <divya.s.kothari@gmail.com>
parents:
diff changeset
26 testing "xzcat - decompresses multiple files" "xzcat file1.xz file2.xz file3.xz > Tempfile && echo "yes" ; diff Tempfile xzcatOut && echo "yes"; rm -rf file* xzcatOut Tempfile " "yes\nyes\n" "" ""