head	1.2;
access;
symbols
	RPM_4_2_1:1.1.1.4
	RPM_4_2:1.1.1.4
	RPM_4_1_1:1.1.1.4
	RPM_4_1:1.1.1.3
	RPM_4_0_5:1.1.1.2
	RPM_4_0_4:1.1.1.1
	RPM:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2008.01.02.09.59.03;	author rse;	state dead;
branches;
next	1.1;
commitid	z4cpSiAhOCXk5PLs;

1.1
date	2002.01.07.22.31.02;	author rse;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2002.01.07.22.31.02;	author rse;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2003.01.18.13.49.11;	author rse;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2002.01.17.20.11.43;	author rse;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2003.01.18.14.05.14;	author rse;	state Exp;
branches;
next	;


desc
@@


1.2
log
@remove the ancient RPM 4.2.1 source tree copy
@
text
@# See the file LICENSE for redistribution information.
#
# Copyright (c) 2001
#	Sleepycat Software.  All rights reserved.
#
# Id: shelltest.tcl,v 1.15 2001/11/03 18:43:48 bostic Exp 
#
# TEST	scr###
# TEST	The scr### directories are shell scripts that test a variety of
# TEST	things, including things about the distribution itself.  These
# TEST	tests won't run on most systems, so don't even try to run them.
#
# shelltest.tcl:
#	Code to run shell script tests, to incorporate Java, C++,
#	example compilation, etc. test scripts into the Tcl framework.
proc shelltest { { run_one 0 }} {
	source ./include.tcl
	global shelltest_list

	set SH /bin/sh
	if { [file executable $SH] != 1 } {
		puts "Shell tests require valid shell /bin/sh: not found."
		puts "Skipping shell tests."
		return 0
	}

	if { $run_one == 0 } {
		puts "Running shell script tests..."

		foreach testpair $shelltest_list {
			set dir [lindex $testpair 0]
			set test [lindex $testpair 1]

			env_cleanup $testdir
			shelltest_copy $test_path/$dir $testdir
			shelltest_run $SH $dir $test $testdir
		}
	} else {
		set run_one [expr $run_one - 1];
		set dir [lindex [lindex $shelltest_list $run_one] 0]
		set test [lindex [lindex $shelltest_list $run_one] 1]

		env_cleanup $testdir
		shelltest_copy $test_path/$dir $testdir
		shelltest_run $SH $dir $test $testdir
	}
}

proc shelltest_copy { fromdir todir } {
	set globall [glob $fromdir/*]

	foreach f $globall {
		file copy $f $todir/
	}
}

proc shelltest_run { sh srcdir test testdir } {
	puts "Running shell script $srcdir ($test)..."

	set ret [catch {exec $sh -c "cd $testdir && sh $test" >&@@ stdout} res]

	if { $ret != 0 } {
		puts "FAIL: shell test $srcdir/$test exited abnormally"
	}
}

proc scr001 {} { shelltest 1 }
proc scr002 {} { shelltest 2 }
proc scr003 {} { shelltest 3 }
proc scr004 {} { shelltest 4 }
proc scr005 {} { shelltest 5 }
proc scr006 {} { shelltest 6 }
proc scr007 {} { shelltest 7 }
proc scr008 {} { shelltest 8 }
proc scr009 {} { shelltest 9 }
proc scr010 {} { shelltest 10 }
proc scr011 {} { shelltest 11 }
proc scr012 {} { shelltest 12 }
proc scr013 {} { shelltest 13 }
proc scr014 {} { shelltest 14 }
proc scr015 {} { shelltest 15 }
proc scr016 {} { shelltest 16 }
proc scr017 {} { shelltest 17 }
proc scr018 {} { shelltest 18 }
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@Import: RPM 4.0.4
@
text
@@


1.1.1.2
log
@Import: RPM 4.0.5
@
text
@d3 1
a3 1
# Copyright (c) 2001-2002
d6 1
a6 1
# Id: shelltest.tcl,v 1.20 2002/04/19 15:42:20 bostic Exp 
a84 4
proc scr019 {} { shelltest 19 }
proc scr020 {} { shelltest 20 }
proc scr021 {} { shelltest 21 }
proc scr022 {} { shelltest 22 }
@


1.1.1.3
log
@Import: RPM 4.1
@
text
@d3 1
a3 1
# Copyright (c) 2001
d6 1
a6 1
# Id: shelltest.tcl,v 1.15 2001/11/03 18:43:48 bostic Exp 
d85 4
@


1.1.1.4
log
@Import: RPM 4.1.1
@
text
@d3 1
a3 1
# Copyright (c) 2001-2002
d6 1
a6 1
# Id: shelltest.tcl,v 1.20 2002/04/19 15:42:20 bostic Exp 
a84 4
proc scr019 {} { shelltest 19 }
proc scr020 {} { shelltest 20 }
proc scr021 {} { shelltest 21 }
proc scr022 {} { shelltest 22 }
@


