Ejemplo n.º 1
0
                      tasks,
                      tags=[testName, testConfigName,
                            GraalJsDefaultTags.all]) as t:
                if t:
                    gateTestCommands[testCommandName](
                        gateTestConfigs[testConfigName])

    with Task('TCK tests',
              tasks,
              tags=[GraalJsDefaultTags.all, GraalJsDefaultTags.tck]) as t:
        if t:
            import mx_truffle
            mx_truffle._tck([])


prepend_gate_runner(_suite, _graal_js_pre_gate_runner)
add_gate_runner(_suite, _graal_js_gate_runner)


class ArchiveProject(mx.ArchivableProject):
    def __init__(self, suite, name, deps, workingSets, theLicense, **args):
        mx.ArchivableProject.__init__(self, suite, name, deps, workingSets,
                                      theLicense)
        assert 'prefix' in args
        assert 'outputDir' in args

    def output_dir(self):
        return join(self.dir, self.outputDir)

    def archive_prefix(self):
        return self.prefix
Ejemplo n.º 2
0
            tmpdir = tempfile.mkdtemp()
            try:
                npm(['--scripts-prepend-node-path=auto', 'install', '--nodedir=' + _suite.dir, 'microtime'], cwd=tmpdir)
                node(['-e', 'print(require("microtime").now());'], cwd=tmpdir)
            finally:
                shutil.rmtree(tmpdir)

    with Task('JniProfilerTests', tasks, tags=[GraalNodeJsTags.allTests, GraalNodeJsTags.jniProfilerTests]) as t:
        if t:
            commonArgs = ['-ea']
            unitTestDir = join(mx.project('com.oracle.truffle.trufflenode.jniboundaryprofiler').dir, 'tests')
            mx.run(['rm', '-rf', 'node_modules', 'build'], cwd=unitTestDir)
            npm(['--scripts-prepend-node-path=auto', 'install', '--nodedir=' + _suite.dir] + commonArgs, cwd=unitTestDir)
            node(['-profile-native-boundary', '-Dtruffle.js.NashornJavaInterop=true', 'test.js'] + commonArgs, cwd=unitTestDir)

mx_gate.prepend_gate_runner(_suite, _graal_nodejs_pre_gate_runner)
mx_gate.add_gate_runner(_suite, _graal_nodejs_post_gate_runner)

def _build(args, debug, shared_library, threading, parallelism, debug_mode):
    _mxrun(['./configure',
            '--partly-static',
            '--build-only-native',
            '--without-dtrace',
            '--without-snapshot',
            '--shared-zlib',
            '--shared-graalvm', _getJdkHome(),
            '--shared-trufflejs', mx.distribution('graal-js:GRAALJS').path
        ] + debug + shared_library + threading,
        cwd=_suite.dir, verbose=True)

    _mxrun([mx.gmake_cmd(), '-j%d' % parallelism], cwd=_suite.dir, verbose=True)