blob: 9b5f9d5ab9bb2c084bd366e6f639b9d5ee20944a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#!/bin/bash
# This file is part of util-linux.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
TS_TOPDIR="${0%/*}/../.."
TS_DESC="options"
. $TS_TOPDIR/functions.sh
ts_init "$*"
export SCRIPT_TEST_SECOND_SINCE_EPOCH=1432489398
export TZ="GMT"
ts_check_test_command "$TS_HELPER_SCRIPT"
ts_init_subtest "append"
$TS_HELPER_SCRIPT --command "echo append1" $TS_OUTPUT </dev/null >/dev/null 2>&1
$TS_HELPER_SCRIPT --append -c "echo append2" $TS_OUTPUT </dev/null >/dev/null 2>&1
ts_finalize_subtest
ts_init_subtest "force"
ln -s $TS_OUTPUT typescript
$TS_HELPER_SCRIPT --command "echo no force" </dev/null >/dev/null 2>> $TS_OUTPUT
echo $? >> $TS_OUTPUT
$TS_HELPER_SCRIPT -a --force --command "echo with force" </dev/null >/dev/null
echo $? >> $TS_OUTPUT
rm -f typescript
ln -s $TS_OUTPUT tpircsepyt
$TS_HELPER_SCRIPT -a --command "echo not typescript" tpircsepyt </dev/null >/dev/null
echo $? >> $TS_OUTPUT
rm -f tpircsepyt
ts_finalize_subtest
ts_init_subtest "quiet"
$TS_HELPER_SCRIPT --quiet --command "echo quiet1" $TS_OUTPUT </dev/null >/dev/null 2>&1
$TS_HELPER_SCRIPT -a -q --command "echo quiet2" $TS_OUTPUT </dev/null >/dev/null 2>&1
ts_finalize_subtest
ts_init_subtest "return"
$TS_HELPER_SCRIPT --command "exit 1" $TS_OUTPUT </dev/null >/dev/null 2>&1
echo $? >> $TS_OUTPUT
$TS_HELPER_SCRIPT -a --command "exit 0" $TS_OUTPUT </dev/null >/dev/null 2>&1
echo $? >> $TS_OUTPUT
$TS_HELPER_SCRIPT -e --append -c "exit 42" $TS_OUTPUT </dev/null >/dev/null 2>&1
echo $? >> $TS_OUTPUT
$TS_HELPER_SCRIPT --return --append -c "exit 127" $TS_OUTPUT </dev/null >/dev/null 2>&1
echo $? >> $TS_OUTPUT
ts_finalize_subtest
ts_init_subtest "size"
$TS_HELPER_SCRIPT --output-limit 9 --command "echo 1:1234567890" $TS_OUTPUT </dev/null >/dev/null 2>&1
$TS_HELPER_SCRIPT -a -o 9 --command "echo 2:1234567890" $TS_OUTPUT </dev/null >/dev/null 2>&1
echo $? >> $TS_OUTPUT
ts_finalize_subtest
ts_finalize
|