summaryrefslogtreecommitdiff
path: root/source4/selftest/wscript
blob: 06ccc565d21dcee81b281253261dded0303593f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# selftest main code.

import Scripting, os, Options, Utils, Environment, optparse


########################################################################
# main test entry point
def cmd_test(opt):
    '''Run the quick test suite'''
    print "Starting quick test"
    Scripting.commands += ['build']
    env = Environment.Environment()

    env.TESTS = Options.options.TESTS

    env.OPTIONS = ''
    if Options.options.QUICKTEST:
        env.OPTIONS += '--exclude=./selftest/slow --quick --include=./selftest/quick'

    SELFTEST = 'PYTHON=/usr/bin/python perl -W ../selftest/selftest.pl --prefix=./st --builddir=. --srcdir=. --exclude=./selftest/skip --testlist="./selftest/tests.sh|" ${OPTIONS} --socket-wrapper ${TESTS} | perl -W ../selftest/filter-subunit.pl --expected-failures=./selftest/knownfail | /usr/bin/perl -W ../selftest/format-subunit.pl --prefix=./st --format=plain --immediate'

    cmd = Utils.subst_vars(SELFTEST, env)
    print "test: running %s" % cmd
    ret = os.system(cmd)

def set_options(opt):
    opt.ADD_COMMAND('test', cmd_test)

    gr = opt.add_option_group('test options')

    gr.add_option('--tests',
                  help=("wildcard pattern of tests to run"),
                  action="store", dest='TESTS', default='')
    gr.add_option('--quick',
                  help=("enable only quick tests"),
                  action="store_true", dest='QUICKTEST', default=False)