8 |
# Test the number of arguments and the first argument. |
# Test the number of arguments and the first argument. |
9 |
case $#-$1 in |
case $#-$1 in |
10 |
1-clean ) |
1-clean ) |
11 |
rm -fv test_result? tmp_file? |
rm -fv test_result* tmp_file* |
12 |
exit 0 |
exit 0 |
13 |
;; |
;; |
14 |
1-run ) |
1-run ) |
25 |
esac |
esac |
26 |
|
|
27 |
function TestResult { |
function TestResult { |
28 |
if diff $1 $2 |
if cmp -s $1 $2 |
29 |
then |
then |
30 |
echo $2 PASSED |
echo $2 PASSED |
31 |
else |
else |
32 |
echo $2 TEST FAILED '\a' |
echo '' |
33 |
|
echo $2 TEST FAILED |
34 |
|
diff $1 $2 |
35 |
|
echo '' |
36 |
fi |
fi |
37 |
} |
} |
38 |
|
|
75 |
# Test for accidental file overwrite. |
# Test for accidental file overwrite. |
76 |
ResultFile=test_result7 |
ResultFile=test_result7 |
77 |
cp ${srcdir}/file2 tmp_file7 |
cp ${srcdir}/file2 tmp_file7 |
78 |
${command} -aA -dD -cC ${srcdir}/file1 tmp_file7 tmp_file7 >${ResultFile} 2>&1 |
${command} -aA -dD -cC ${srcdir}/file1 tmp_file7 tmp_file7 \ |
79 |
|
>${ResultFile} 2>&1 |
80 |
TestResult ${srcdir}/test_baseline7 ${ResultFile} |
TestResult ${srcdir}/test_baseline7 ${ResultFile} |
81 |
|
|
82 |
|
# Test -D option |
83 |
|
ResultFile=test_result8 |
84 |
|
${command} -D ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1 |
85 |
|
TestResult ${srcdir}/test_baseline8 ${ResultFile} |
86 |
|
|
87 |
|
# Test -D and -M options |
88 |
|
ResultFile=test_result9 |
89 |
|
${command} -D -M '<<<<' '>>>>' \ |
90 |
|
${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1 |
91 |
|
TestResult ${srcdir}/test_baseline9 ${ResultFile} |
92 |
|
|
93 |
|
# Test -D and -B options |
94 |
|
ResultFile=test_result10 |
95 |
|
${command} -D -B ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1 |
96 |
|
TestResult ${srcdir}/test_baseline10 ${ResultFile} |
97 |
|
|
98 |
# EOF |
# EOF |