annotate mx.truffle/mx_truffle.py @ 22400:b07854a19ab4

Adding API snapshots as for version truffle-0.9 and enabling their check in the gate
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Fri, 20 Nov 2015 16:41:09 +0100
parents 3ed94f641d52
children 07f3efb4e321
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3718
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
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
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 # ----------------------------------------------------------------------------------------------------
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
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
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 # This code is free software; you can redistribute it and/or modify it
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 # under the terms of the GNU General Public License version 2 only, as
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 # published by the Free Software Foundation.
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 # This code is distributed in the hope that it will be useful, but WITHOUT
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 # version 2 for more details (a copy is included in the LICENSE file that
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 # accompanied this code).
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 # You should have received a copy of the GNU General Public License version
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 # 2 along with this work; if not, write to the Free Software Foundation,
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24 # or visit www.oracle.com if you need additional information or have any
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 # questions.
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
27 # ----------------------------------------------------------------------------------------------------
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
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
22400
b07854a19ab4 Adding API snapshots as for version truffle-0.9 and enabling their check in the gate
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22361
diff changeset
32 from mx_sigtest import sigtest
22034
a4c9f8c89c68 Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents: 22016
diff changeset
33 from mx_gate import Task
a4c9f8c89c68 Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents: 22016
diff changeset
34 import mx_gate
a4c9f8c89c68 Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents: 22016
diff changeset
35
22016
92168cb0e803 removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents: 21984
diff changeset
36 _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
37
4577
bc8b58c11768 Added debug build of HotSpot Client to the gate.
Doug Simon <doug.simon@oracle.com>
parents: 4575
diff changeset
38 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
39 """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
40 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
41 assert len(opts2.remainder) == 0
4145
9aee7df31417 Removed 'tests' command.
Doug Simon <doug.simon@oracle.com>
parents: 4144
diff changeset
42
11867
952ecf32788a mx sl command.
Chris Seaton <chris.seaton@oracle.com>
parents: 11797
diff changeset
43 def sl(args):
12693
c6b833f7935e mx sl: change vm args syntax
Andreas Woess <andreas.woess@jku.at>
parents: 12647
diff changeset
44 """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
45 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
46 mx.run_java(vmArgs + ['-cp', mx.classpath(["TRUFFLE_API", "com.oracle.truffle.sl"]), "com.oracle.truffle.sl.SLLanguage"] + slArgs)
11867
952ecf32788a mx sl command.
Chris Seaton <chris.seaton@oracle.com>
parents: 11797
diff changeset
47
22359
9a6f0c689576 SL: add "mx slcoverage <filename>" as a temporary demo showing line counts; not yet PolyglotEngine integrated
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22055
diff changeset
48 def slcoverage(args):
9a6f0c689576 SL: add "mx slcoverage <filename>" as a temporary demo showing line counts; not yet PolyglotEngine integrated
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22055
diff changeset
49 """Demo: run an SL program with coverage counts printed when done"""
9a6f0c689576 SL: add "mx slcoverage <filename>" as a temporary demo showing line counts; not yet PolyglotEngine integrated
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22055
diff changeset
50 vmArgs, slArgs = mx.extract_VM_args(args)
9a6f0c689576 SL: add "mx slcoverage <filename>" as a temporary demo showing line counts; not yet PolyglotEngine integrated
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22055
diff changeset
51 mx.run_java(vmArgs + ['-cp', mx.classpath("com.oracle.truffle.sl.tools"), "com.oracle.truffle.sl.tools.SLCoverage"] + slArgs)
22361
3ed94f641d52 pylint fix
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22359
diff changeset
52
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
53 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
54 """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
55 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
56 mx.run_java(vmArgs + ['-cp', mx.classpath("com.oracle.truffle.sl.tools"), "com.oracle.truffle.sl.tools.debug.SLREPLServer"] + slArgs)
14769
141d570b397c fixed pylint errors
Doug Simon <doug.simon@oracle.com>
parents: 14767
diff changeset
57
22034
a4c9f8c89c68 Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents: 22016
diff changeset
58 def _truffle_gate_runner(args, tasks):
a4c9f8c89c68 Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents: 22016
diff changeset
59 with Task('Truffle UnitTests', tasks) as t:
a4c9f8c89c68 Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents: 22016
diff changeset
60 if t: unittest(['--suite', 'truffle', '--enable-timing', '--verbose', '--fail-fast'])
22400
b07854a19ab4 Adding API snapshots as for version truffle-0.9 and enabling their check in the gate
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22361
diff changeset
61 with Task('Truffle Signature Tests', tasks) as t:
b07854a19ab4 Adding API snapshots as for version truffle-0.9 and enabling their check in the gate
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22361
diff changeset
62 if t: sigtest(['--check', 'binary'])
22034
a4c9f8c89c68 Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents: 22016
diff changeset
63
a4c9f8c89c68 Add unit tests to truffle gate.
Roland Schatz <roland.schatz@oracle.com>
parents: 22016
diff changeset
64 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
65
22016
92168cb0e803 removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents: 21984
diff changeset
66 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
67 '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
68 'sldebug' : [sldebug, '[SL args|@VM options]'],
22359
9a6f0c689576 SL: add "mx slcoverage <filename>" as a temporary demo showing line counts; not yet PolyglotEngine integrated
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22055
diff changeset
69 'slcoverage' : [slcoverage, '[SL args|@VM options]'],
22016
92168cb0e803 removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents: 21984
diff changeset
70 })