Exemple #1
0
def _fastr_gate_runner(args, tasks):
    # Until fixed, we call Checkstyle here and limit to primary
    with mx_gate.Task('Checkstyle check', tasks) as t:
        if t:
            if mx.checkstyle(['--primary']) != 0:
                t.abort('Checkstyle warnings were found')

    # FastR has custom copyright check
    with mx_gate.Task('Copyright check', tasks) as t:
        if t:
            if mx.checkcopyrights(['--primary']) != 0:
                t.abort('copyright errors')

    # build the native projects (GnuR/VM)
    with mx_gate.Task('BuildNative', tasks):
        build([])

    # check that the expected test output file is up to date
    with mx_gate.Task('UnitTests: ExpectedTestOutput file check', tasks) as t:
        if t:
            if junit(['--tests', _gate_noapps_unit_tests(), '--check-expected-output']) != 0:
                t.abort('unit tests expected output check failed')

    with mx_gate.Task('UnitTests: +EST', tasks) as t:
        if t:
            if junit(['--J', '@-DR:+NewStateTransition', '--tests', _gate_noapps_unit_tests()]) != 0:
                t.abort('unit tests failed')

    with mx_gate.Task('UnitTests: -EST', tasks) as t:
        if t:
            if junit(['--J', '@-DR:-NewStateTransition', '--tests', _gate_noapps_unit_tests()]) != 0:
                t.abort('unit tests failed')
Exemple #2
0
def gate(args):
    """run the tests used to validate a push to the stable Maxine repository

    If this commands exits with a 0 exit code, then the source code is in
    a state that would be accepted for integration into the main repository."""

    check = True
    testArgs = []

    i = 0
    while i < len(args):
        arg = args[i]
        if arg == '-nocheck':
            check = False
        else:
            testArgs += [arg]
        i += 1

    if check:
        mx._opts.specific_suite = "maxine"
        if mx.checkstyle([]):
            mx.abort('Checkstyle warnings were found')

        if exists(join(_maxine_home, '.hg')):
            # Copyright check depends on the sources being in a Mercurial repo
            mx.log('Running copycheck')
            hgNode = os.getenv('hg_node')
            if hgNode is None:
                copycheck(['-modified', '-reporterrors=true', '-continueonerror'])
            else:
                revTip = int(subprocess.check_output(['hg', 'tip', '--template', "'{rev}'"]).strip("'"))
                revLast = int(subprocess.check_output(['hg', 'log', '-r', hgNode, '--template', "'{rev}'"]).strip("'"))
                changesetCount = revTip - revLast + 1
                copycheck(['-last=' + str(changesetCount), '-reporterrors=true', '-continueonerror'])

    mx.log('Ensuring JavaTester harness is up to date')
    try:
        jttgen([])
    except SystemExit:
        mx.log('Updated JavaTesterRunScheme.java or JavaTesterTests.java in com.sun.max.vm.jtrun.all.')
        mx.log('To push your changes to the repository, these files need to be generated locally and checked in.')
        mx.log('The files can be generated by running: mx jttgen')
        mx.abort(1)

    mx.log('Ensuring mx/projects files are canonicalized')
    try:
        mx.canonicalizeprojects([])
    except SystemExit:
        mx.log('Rerun "mx canonicalizeprojects" and check-in the modified mx/projects files.')
        mx.abort(1)

    mx.log('Running MaxineTester...')

    test(['-image-configs=java', '-fail-fast'] + testArgs)
    test(['-image-configs=ss', '-tests=output:Hello+Catch+GC+WeakRef+Final', '-fail-fast'] + testArgs)
Exemple #3
0
def gate(args):
    """run the tests used to validate a push to the stable Maxine repository

    If this commands exits with a 0 exit code, then the source code is in
    a state that would be accepted for integration into the main repository."""
    
    check = True
    testArgs = []
   
    i = 0
    while i < len(args):
        arg = args[i]
        if arg == '-nocheck':
            check = False
        else:
            testArgs += [arg]
        i += 1

    if check:
        mx._opts.specific_suite = "maxine"
        if mx.checkstyle([]):
            mx.abort('Checkstyle warnings were found')

        if exists(join(_maxine_home, '.hg')):
            # Copyright check depends on the sources being in a Mercurial repo
            mx.log('Running copycheck')
            hgNode = os.getenv('hg_node')
            if hgNode is None:
                copycheck(['-modified', '-reporterrors=true', '-continueonerror'])
            else:
                revTip = int(subprocess.check_output(['hg', 'tip', '--template', "'{rev}'"]).strip("'"))
                revLast = int(subprocess.check_output(['hg', 'log', '-r', hgNode, '--template', "'{rev}'"]).strip("'"))
                changesetCount = revTip - revLast + 1
                copycheck(['-last=' + str(changesetCount), '-reporterrors=true', '-continueonerror'])

    mx.log('Ensuring JavaTester harness is up to date')
    try:
        jttgen([])
    except SystemExit:
        mx.log('Updated JavaTesterRunScheme.java or JavaTesterTests.java in com.sun.max.vm.jtrun.all.')
        mx.log('To push your changes to the repository, these files need to be generated locally and checked in.')
        mx.log('The files can be generated by running: mx jttgen')
        mx.abort(1)

    mx.log('Ensuring mx/projects files are canonicalized')
    try:
        mx.canonicalizeprojects([])
    except SystemExit:
        mx.log('Rerun "mx canonicalizeprojects" and check-in the modified mx/projects files.')
        mx.abort(1)

    mx.log('Running MaxineTester...')

    test(['-image-configs=java', '-fail-fast'] + testArgs)
    test(['-image-configs=ss', '-tests=output:Hello+Catch+GC+WeakRef+Final', '-fail-fast'] + testArgs)
Exemple #4
0
def _fastr_gate_runner(args, tasks):
    # Until fixed, we call Checkstyle here and limit to primary
    with mx_gate.Task('Checkstyle check', tasks) as t:
        if t:
            if mx.checkstyle(['--primary']) != 0:
                t.abort('Checkstyle warnings were found')

    # FastR has custom copyright check
    with mx_gate.Task('Copyright check', tasks) as t:
        if t:
            if mx.checkcopyrights(['--primary']) != 0:
                t.abort('copyright errors')

    # check that the expected test output file is up to date
    with mx_gate.Task('UnitTests: ExpectedTestOutput file check', tasks) as t:
        if t:
            if junit(['--tests', _gate_noapps_unit_tests(), '--check-expected-output']) != 0:
                t.abort('unit tests expected output check failed')

    with mx_gate.Task('UnitTests', tasks) as t:
        if t:
            if junit(['--tests', _gate_noapps_unit_tests()]) != 0:
                t.abort('unit tests failed')
Exemple #5
0
def gate(args):
    """run the tests used to validate a push to the stable Maxine repository

    If this commands exits with a 0 exit code, then the source code is in
    a state that would be accepted for integration into the main repository."""

    check = True
    testArgs = []

    i = 0
    while i < len(args):
        arg = args[i]
        if arg == '-nocheck':
            check = False
        else:
            testArgs += [arg]
        i += 1

    mx._opts.specific_suites = ["maxine"]
    if check:
        if mx.checkstyle([]):
            mx.abort('Checkstyle warnings were found')

        if exists(join(_maxine_home, '.git')):
            # Copyright check depends on the sources being in a git repo
            mx.log('Running checkcopyrights')
            if checkcopyrights(['--modified', '--report-errors']):
                mx.abort('Copyright issues were found')

    mx.log('Ensuring JavaTester harness is up to date')
    try:
        jttgen([])
    except SystemExit:
        mx.log(
            'Updated JavaTesterRunScheme.java or JavaTesterTests.java in com.sun.max.vm.jtrun.all.'
        )
        mx.log(
            'To push your changes to the repository, these files need to be generated locally and checked in.'
        )
        mx.log('The files can be generated by running: mx jttgen')
        mx.abort(1)

    mx.log('Ensuring mx/suite.py files are canonicalized')
    try:
        mx.canonicalizeprojects([])
    except SystemExit:
        mx.log(
            'Rerun "mx canonicalizeprojects" and check-in the modified mx/suite.py files.'
        )
        mx.abort(1)

    mx.log('Running MaxineTester...')

    testme([
        '-image-configs=java', '-maxvm-configs=std,forceC1X,forceT1X',
        '-jtt-image-configs=jtt-c1xc1x,jtt-t1xc1x,jtt-c1xt1x,jtt-t1xt1x',
        '-tests=c1x,junit:uk.ac+tests.unsafe+tests.vm+max.l+max.c+max.u+max.i+max.M+max.p,jsr292,output,javatester'
    ] + testArgs)
    testme([
        '-image-configs=ss', '-tests=output:Hello+Catch+GC+WeakRef+Final',
        '-fail-fast'
    ] + testArgs)