papa_tb('--'+long, (long, False, dir, xfmap), 'host')
papa_tb('--'+long+'-tb',(long, True, dir, xfmap), 'testbed')
- pa_path('build-tree', 'use build tree from PATH on %s', dir=True)
- pa_path('build-source', 'use tests in DSC on %s (building it)', xfmap=xfmap_dsc)
- #nyi pa_path('install-binary', 'install package found in PATH on %s')
+ pa_path('tests-tree', 'TREE', 'use tests in build tree TREE (found on %s)', dir=True)
+
+ pa_pkg('source', 'DSC', 'build DSC (on %s) on testbed and use its tests and packages', testsrc=True, pkgsrc=True)
+ pa_pkg('source-tests', 'DSC', 'use tests in DSC (found on %s), building it on testbed', testsrc=True, pkgsrc=False)
+ pa_pkg('source-testsinstall', 'DSC', 'build DSC (found on %s), use its tests, and install its'
+ ' binaries (even when apparently not required)', testsrc=True, pkgsrc='*')
+
+ pa_pkg('source-binaries', 'DSC', 'build DSC (on %s) on testbed and use its binary packages'
+ ' as test targets and to satisfy dependencies', testsrc=False, pkgsrc=True)
+ pa_pkg('source-installbinaries','DSC', 'build DSC (on %s) on testbed and install its binary'
+ ' packages (even when apparently not required)', testsrc=False, pkgsrc='*')
+
+ pa_pkg('install-binary', 'DEB', 'install package DEB (found on %s) on testbed', testsrc=None, pkgsrc=None)
+
+
#nyi pa_path('install-from-source', 'build and install package found'+
# ' in PATH on %s', xfmap=xfmap_dsc)
#nyi these install-* options need cb_path to be able to make a list
pa_path('control', 'read control file PATH on %s')
pa_path('output-dir', 'write stderr/out files in PATH on %s', dir=True)
- # nyi: on testbed gain root command
+ pa('','--user', help= 'run tests as USER (needs root on testbed)', type='string', dest='user')
+ pa('','--fakeroot', help= 'prefix debian/rules build with FAKEROOT' type='string', dest='fakeroot')
pa('-d', '--debug', action='store_true', dest='debug');
- pa('','--user', type='string', dest='user', metavar='USER',
- help='run tests as USER (needs root on testbed)')
- pa('','--fakeroot', type='string', dest='fakeroot', metavar='FAKEROOT',
- help='prefix debian/rules build with FAKEROOT')
class SpecialOption(optparse.Option): pass
vs_op = SpecialOption('','--VSERVER-DUMMY')
if not hasattr(opts,'vserver'):
parser.error('you must specifiy --- <virt-server>...')
- if opts.build_tree is not None and opts.build_source is not None:
+ if opts.tests_tree is not None and opts.build_source is not None:
parser.error('do not specify both --build-tree and'
' --build-source')
if opts.control is None:
- opts.control = opts.build_tree.append(
+ opts.control = opts.tests_tree.append(
'debian/tests/control', 'control')
def finalise_options():
global opts, testbed
- if opts.build_tree is None and opts.build_source is None:
- opts.build_tree = Path(False, '.', 'build-tree', dir=True)
+ if opts.tests_tree is None and opts.build_source is None:
+ opts.tests_tree = Path(False, '.', 'build-tree', dir=True)
if opts.user is None and 'root-on-testbed' not in caps:
opts.user = ''
','.join(map(urllib.quote, ['sh','-xec',script]))],
'/dev/null',so.ontb(),se.ontb(), testbed.scratch.ontb())
sod = file(so.onhost()).read().split("\n")
- build_tree = Path(True, sod[0], idstr+'-tree', dir=True)
+ tests_tree = Path(True, sod[0], idstr+'-tree', dir=True)
se.maybe_onhost()
- return (build_tree,)
+ return (tests_tree,)
def acquire_built_source():
global opts
if opts.build_source:
- assert(opts.build_tree is None)
+ assert(opts.tests_tree is None)
bss = build_some_source('t', opts.build_source)
- opts.build_tree = bss[0]
+ opts.tests_tree = bss[0]
class FieldIgnore(FieldBase):
def parse(f): pass
class Restriction:
def __init__(r,rname,base): pass
-class Restriction_rw_build_tree(Restriction): pass
+class Restriction_rw_tests_tree(Restriction): pass
class Field_Restrictions(FieldBase):
def parse(f):
t.tname = tname
if len(base['testsdir']): tpath = base['testsdir'] + '/' + tname
else: tpath = tname
- t.p = opts.build_tree.append(tpath, 'test-'+tname)
+ t.p = opts.tests_tree.append(tpath, 'test-'+tname)
def report(t, m):
report(t.tname, m)
def reportfail(t, m):
so = stdouterr('stdout')
se = stdouterr('stderr')
rc = testbed.commandr1('execute',(t.p.ontb(),
- '/dev/null', so.ontb(), se.ontb(), opts.build_tree.ontb()))
+ '/dev/null', so.ontb(), se.ontb(), opts.tests_tree.ontb()))
soh = stdouterrh(so, 'stdout')
seh = stdouterrh(se, 'stderr')
rc = int(rc)
.SH OPTIONS
.TP
-.BR --build-tree [ -tb ] " " \fIdirectory\fR
+.BR --tests-tree [ -tb ] " " \fIdirectory\fR
Specifies that the built source tree can be found in
.IR directory .
(Default: adt-run's current directory, on the host.)
.TP
-.BR --build-source [ -tb ] " " \fIfilename\fR
+.BR --source [ -tb ] " " \fIdsc\fR
+Builds \fIdsc\fR, and then uses the tests in that tree, as well as
+testing the packages from this build and using them to satisfy
+dependencies. Equivalent to \fB--source-tests\fI and
+\fB--source-binaries\fI (except that it only does the build once).
+.TP
+.BR --source-tests [ -tb ] " " \fIdsc\fR
+Builds \fIdsc\fR (installing dependencies as appropriate), and then
+uses the tests in that tree. The packages tested will be those
+installed on the testbed, not the ones from this build.
+.TP
+.BR --source-testsinstall [ -tb ] " " \fIdsc\fR
+Builds \fIdsc\fR (installing dependencies as appropriate), and then
+installs the packages which result (subject to
+\fB--package-filter-source-install\fR). The packages tested will be
+those installed on the testbed, not the ones from this build. This is
+like \fB--source-tests\fR except that the packages from the build are
+installed even if they are not required as a dependency for any test.
+.TP
+.BR --source-binaries [ -tb ] " " \fIdsc\fR
+Builds \fIdsc\fR (installing dependencies as appropriate), and then
+use the resulting binary packages to satisfy dependencies (instead of
+packages from the default archive).
+
+
+Only dependencies mentioned by
+tests, or binary packages built by or provided directly to
+\fBadt-run\fR, are affected: dependencies mentioned by binary packages
+installed implicitly
+
+ The dependencies affected are
+
+
+which are themselves installed deliberately by the test
+. Binary packages
+installed implicitly by
+
+
+direct \Test-Depends lines,
+
+installs the packages which result (subject to
+\fB--package-filter-source-install\fR). The packages tested will be
+those installed on the testbed, not the ones from this build.
+
+
+
+
+Equivalent to \fB--source-tests\fR but
+
+; also uses the tests in the
+resulting build tree.
+
+
+and then
+uses the tests in that tree. The packages tested will be those
+installed on the testbed, not the ones from this build.
+.TP
+
+
+
+, as well as
+testing the packages from this build and using them to satisfy
+dependencies. Equivalent to \fB--source-tests\fI and
+\fB--source-binaries\fI (except that it only does the build once).
+
+
+
Specifies that the source to use for the tests can be found in
.IR filename
(which should be a \fB.dsc\fR). The source will be unpacked