Mercurial > hg > truffle
annotate mx.truffle/mx_truffle.py @ 22242:463c2ea336ab
Truffle/Intrumentation: fix imports
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Tue, 22 Sep 2015 20:31:48 -0700 |
parents | 2867e02e6fdb |
children | 9a6f0c689576 c3e397ce5941 |
rev | line source |
---|---|
3718 | 1 # |
4225
339cf8d4904d
Made mx.run work properly when stderr is redirected to stdout.
Doug Simon <doug.simon@oracle.com>
parents:
4219
diff
changeset
|
2 # commands.py - the GraalVM specific commands |
3718 | 3 # |
4 # ---------------------------------------------------------------------------------------------------- | |
5 # | |
18891
9afee75cee46
mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents:
18888
diff
changeset
|
6 # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. |
3718 | 7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
8 # | |
9 # This code is free software; you can redistribute it and/or modify it | |
10 # under the terms of the GNU General Public License version 2 only, as | |
11 # published by the Free Software Foundation. | |
12 # | |
13 # This code is distributed in the hope that it will be useful, but WITHOUT | |
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 # version 2 for more details (a copy is included in the LICENSE file that | |
17 # accompanied this code). | |
18 # | |
19 # You should have received a copy of the GNU General Public License version | |
20 # 2 along with this work; if not, write to the Free Software Foundation, | |
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
22 # | |
23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
24 # or visit www.oracle.com if you need additional information or have any | |
25 # questions. | |
26 # | |
27 # ---------------------------------------------------------------------------------------------------- | |
28 | |
4144
34527a24bcf8
Adopted mxtool changes.
Doug Simon <doug.simon@oracle.com>
parents:
3736
diff
changeset
|
29 import mx |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
30 |
22034
a4c9f8c89c68
Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents:
22016
diff
changeset
|
31 from mx_unittest import unittest |
a4c9f8c89c68
Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents:
22016
diff
changeset
|
32 from mx_gate import Task |
a4c9f8c89c68
Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents:
22016
diff
changeset
|
33 import mx_gate |
a4c9f8c89c68
Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents:
22016
diff
changeset
|
34 |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
35 _suite = mx.suite('truffle') |
16622
faaea970b951
Add an mx install command to install the Truffle jars to the local Maven repository.
Chris Seaton <chris.seaton@oracle.com>
parents:
16621
diff
changeset
|
36 |
4577
bc8b58c11768
Added debug build of HotSpot Client to the gate.
Doug Simon <doug.simon@oracle.com>
parents:
4575
diff
changeset
|
37 def build(args, vm=None): |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
38 """build the Java sources""" |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
39 opts2 = mx.build(['--source', '1.7'] + args) |
11392
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
40 assert len(opts2.remainder) == 0 |
4145
9aee7df31417
Removed 'tests' command.
Doug Simon <doug.simon@oracle.com>
parents:
4144
diff
changeset
|
41 |
11867 | 42 def sl(args): |
12693
c6b833f7935e
mx sl: change vm args syntax
Andreas Woess <andreas.woess@jku.at>
parents:
12647
diff
changeset
|
43 """run an SL program""" |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
44 vmArgs, slArgs = mx.extract_VM_args(args) |
22055
2867e02e6fdb
Rename truffle-api.jar distribution to TRUFFLE_API
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
22044
diff
changeset
|
45 mx.run_java(vmArgs + ['-cp', mx.classpath(["TRUFFLE_API", "com.oracle.truffle.sl"]), "com.oracle.truffle.sl.SLLanguage"] + slArgs) |
11867 | 46 |
21568
3b8bbf51d320
Truffle/Debugging: add the Truffle DebugEngine and supporting code, as well as add a crude command-line debugging tool used mainly to test the DebugEngine. Migrate the small tols out of project com.oracle.truffle.api into the new project com.oracle.truffle.tools.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
21447
diff
changeset
|
47 def sldebug(args): |
3b8bbf51d320
Truffle/Debugging: add the Truffle DebugEngine and supporting code, as well as add a crude command-line debugging tool used mainly to test the DebugEngine. Migrate the small tols out of project com.oracle.truffle.api into the new project com.oracle.truffle.tools.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
21447
diff
changeset
|
48 """run a simple command line debugger for the Simple Language""" |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
49 vmArgs, slArgs = mx.extract_VM_args(args, useDoubleDash=True) |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
50 mx.run_java(vmArgs + ['-cp', mx.classpath("com.oracle.truffle.sl.tools"), "com.oracle.truffle.sl.tools.debug.SLREPLServer"] + slArgs) |
14769 | 51 |
22034
a4c9f8c89c68
Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents:
22016
diff
changeset
|
52 def _truffle_gate_runner(args, tasks): |
a4c9f8c89c68
Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents:
22016
diff
changeset
|
53 with Task('Truffle UnitTests', tasks) as t: |
a4c9f8c89c68
Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents:
22016
diff
changeset
|
54 if t: unittest(['--suite', 'truffle', '--enable-timing', '--verbose', '--fail-fast']) |
a4c9f8c89c68
Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents:
22016
diff
changeset
|
55 |
a4c9f8c89c68
Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents:
22016
diff
changeset
|
56 mx_gate.add_gate_runner(_suite, _truffle_gate_runner) |
a4c9f8c89c68
Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents:
22016
diff
changeset
|
57 |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
58 mx.update_commands(_suite, { |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
59 'sl' : [sl, '[SL args|@VM options]'], |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
60 'sldebug' : [sldebug, '[SL args|@VM options]'], |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
61 }) |