Rev 11299: - Allow 'make test TESTS=RPC' or 'make test TESTS=RPC-DS.*' in file:///home/jelmer/bzr.samba/4.0-perlselftest/

Jelmer Vernooij jelmer at samba.org
Fri Jan 26 09:45:41 GMT 2007


------------------------------------------------------------
revno: 11299
revision-id: jelmer at samba.org-20070126094356-nxt2ky3e82jvvay6
parent: jelmer at samba.org-20070126092718-9peg12aqt416ie95
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 4.0-perlselftest
timestamp: Fri 2007-01-26 10:43:56 +0100
message:
  - Allow 'make test TESTS=RPC' or 'make test TESTS=RPC-DS.*'
  - Make srcdir and builddir options
modified:
  source/main.mk                 svn-v2:8991 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fmain.mk
  source/script/tests/selftest.pl svn-v2:20693 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2fselftest.pl
=== modified file 'source/main.mk'
--- a/source/main.mk	2007-01-26 09:23:23 +0000
+++ b/source/main.mk	2007-01-26 09:43:56 +0000
@@ -286,17 +286,16 @@
 
 test: $(DEFAULT_TEST_TARGET)
 
-SELFTEST = builddir=$(builddir) srcdir=$(srcdir) \
-	    $(srcdir)/script/tests/selftest.pl --prefix=${selftest_prefix}
+SELFTEST = $(srcdir)/script/tests/selftest.pl --prefix=${selftest_prefix} --builddir=$(builddir) --srcdir=$(srcdir)
 
 test-swrap: all libraries
-	$(SELFTEST) --socket-wrapper
+	$(SELFTEST) --socket-wrapper $(TESTS)
 
 test-noswrap: all libraries
-	$(SELFTEST) 
+	$(SELFTEST) $(TESTS)
 
 quicktest: all
-	$(SELFTEST) --quick --socket-wrapper
+	$(SELFTEST) --quick --socket-wrapper $(TESTS)
 
 testenv: all libraries
 	$(SELFTEST) --socket-wrapper xterm 

=== modified file 'source/script/tests/selftest.pl'
--- a/source/script/tests/selftest.pl	2007-01-26 09:27:18 +0000
+++ b/source/script/tests/selftest.pl	2007-01-26 09:43:56 +0000
@@ -13,7 +13,7 @@
 
 selftest --help
 
-selftest [--target=samba4|samba3|win] [--socket-wrapper] [--quick] [--one] [--prefix=prefix] [--immediate] [TESTS]
+selftest [--srcdir=DIR] [--builddir=DIR] [--target=samba4|samba3|win] [--socket-wrapper] [--quick] [--one] [--prefix=prefix] [--immediate] [TESTS]
 
 =head1 DESCRIPTION
 
@@ -27,7 +27,15 @@
 
 Show list of available options.
 
-=item I<--prefix=dir>
+=item I<--srcdir=DIR>
+
+Source directory.
+
+=item I<--builddir=DIR>
+
+Build directory.
+
+=item I<--prefix=DIR>
 
 Change directory to run tests in. Default is 'st'.
 
@@ -111,6 +119,8 @@
 my $opt_one = 0;
 my $opt_immediate = 0;
 my $opt_expected_failures = undef;
+my $srcdir = ".";
+my $builddir = ".";
 my $prefix = "st";
 
 sub slapd_start($$) {
@@ -278,7 +288,9 @@
  --quick                    run quick overall test
  --one                      abort when the first test fails
  --immediate                print test output for failed tests during run
- --expected-failures=file   specify list of tests that is guaranteed to fail
+ --expected-failures=FILE   specify list of tests that is guaranteed to fail
+ --srcdir=DIR               source directory [.]
+ --builddir=DIR             output directory [.]
 ";
 	exit(0);
 }
@@ -293,6 +305,8 @@
 		'one' => \$opt_one,
 		'immediate' => \$opt_immediate,
 		'expected-failures=s' => \$opt_expected_failures,
+		'srcdir=s' => \$srcdir,
+		'builddir=s' => \$builddir
 	    );
 
 if (not $result) {
@@ -321,10 +335,6 @@
 $prefix =~ s+//+/+;
 $ENV{PREFIX} = $prefix;
 
-my $srcdir = "$RealBin/../..";
-if (defined($ENV{srcdir})) {
-	$srcdir = $ENV{srcdir};
-}
 $ENV{SRCDIR} = $srcdir;
 
 my $bindir = "$srcdir/bin";



More information about the samba-cvs mailing list