1
# See the file LICENSE for redistribution information.
3
# Copyright (c) 2001-2002
4
# Sleepycat Software. All rights reserved.
9
# TEST The scr### directories are shell scripts that test a variety of
10
# TEST things, including things about the distribution itself. These
11
# TEST tests won't run on most systems, so don't even try to run them.
14
# Code to run shell script tests, to incorporate Java, C++,
15
# example compilation, etc. test scripts into the Tcl framework.
16
proc shelltest { { run_one 0 }} {
21
if { [file executable $SH] != 1 } {
22
puts "Shell tests require valid shell /bin/sh: not found."
23
puts "Skipping shell tests."
27
if { $run_one == 0 } {
28
puts "Running shell script tests..."
30
foreach testpair $shelltest_list {
31
set dir [lindex $testpair 0]
32
set test [lindex $testpair 1]
35
shelltest_copy $test_path/$dir $testdir
36
shelltest_run $SH $dir $test $testdir
39
set run_one [expr $run_one - 1];
40
set dir [lindex [lindex $shelltest_list $run_one] 0]
41
set test [lindex [lindex $shelltest_list $run_one] 1]
44
shelltest_copy $test_path/$dir $testdir
45
shelltest_run $SH $dir $test $testdir
49
proc shelltest_copy { fromdir todir } {
50
set globall [glob $fromdir/*]
57
proc shelltest_run { sh srcdir test testdir } {
58
puts "Running shell script $srcdir ($test)..."
60
set ret [catch {exec $sh -c "cd $testdir && sh $test" >&@ stdout} res]
63
puts "FAIL: shell test $srcdir/$test exited abnormally"
67
proc scr001 {} { shelltest 1 }
68
proc scr002 {} { shelltest 2 }
69
proc scr003 {} { shelltest 3 }
70
proc scr004 {} { shelltest 4 }
71
proc scr005 {} { shelltest 5 }
72
proc scr006 {} { shelltest 6 }
73
proc scr007 {} { shelltest 7 }
74
proc scr008 {} { shelltest 8 }
75
proc scr009 {} { shelltest 9 }
76
proc scr010 {} { shelltest 10 }
77
proc scr011 {} { shelltest 11 }
78
proc scr012 {} { shelltest 12 }
79
proc scr013 {} { shelltest 13 }
80
proc scr014 {} { shelltest 14 }
81
proc scr015 {} { shelltest 15 }
82
proc scr016 {} { shelltest 16 }
83
proc scr017 {} { shelltest 17 }
84
proc scr018 {} { shelltest 18 }
85
proc scr019 {} { shelltest 19 }
86
proc scr020 {} { shelltest 20 }
87
proc scr021 {} { shelltest 21 }
88
proc scr022 {} { shelltest 22 }