Skip to content

Commit

Permalink
Merge pull request #101 from chrisseaton/test-downstream
Browse files Browse the repository at this point in the history
Test downstream users (JRuby to start with) of Truffle
  • Loading branch information
chumer committed Mar 7, 2016
2 parents 5304979 + 101f0c0 commit 5f6e175
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
- TEST_COMMAND='mx/mx canonicalizeprojects'
- TEST_COMMAND='mx/mx checkstyle'
- TEST_COMMAND='sh .travis.sigtest.sh'



- TEST_COMMAND='mx/mx testdownstream'
matrix:
allow_failures:
- env: TEST_COMMAND='mx/mx testdownstream'
24 changes: 24 additions & 0 deletions mx.truffle/mx_truffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#
# ----------------------------------------------------------------------------------------------------

import os
import subprocess

import mx

from mx_unittest import unittest
Expand Down Expand Up @@ -54,6 +57,26 @@ def sldebug(args):
vmArgs, slArgs = mx.extract_VM_args(args, useDoubleDash=True)
mx.run_java(vmArgs + ['-cp', mx.classpath("com.oracle.truffle.sl.tools"), "com.oracle.truffle.sl.tools.debug.SLREPL"] + slArgs)

def testdownstream(args):
"""test downstream users of the Truffle API"""
jruby_dir = 'jruby'
jruby_repo = 'https://github.com/jruby/jruby.git'
jruby_branch = 'truffle-head'
git = mx.GitConfig()
if os.path.exists('jruby'):
git.run(['git', 'reset', 'HEAD', '--hard'], nonZeroIsFatal=True, cwd=jruby_dir)
git.pull('jruby')
else:
git.clone(jruby_repo, jruby_dir)
git.run(['git', 'checkout', jruby_branch], nonZeroIsFatal=True, cwd=jruby_dir)
dev_version = _suite.release_version(snapshotSuffix='SNAPSHOT')
subprocess.check_call(['tool/truffle/set_truffle_version.sh', dev_version], cwd=jruby_dir)
mx.build([])
mx.maven_install([])
subprocess.check_call(['./mvnw', 'clean'], cwd=jruby_dir)
subprocess.check_call(['./mvnw'], cwd=jruby_dir)
subprocess.check_call(['bin/jruby', 'tool/jt.rb', 'test', 'fast'], cwd=jruby_dir)

def _truffle_gate_runner(args, tasks):
with Task('Truffle Javadoc', tasks) as t:
if t: mx.javadoc(['--unified'])
Expand All @@ -68,4 +91,5 @@ def _truffle_gate_runner(args, tasks):
'javadoc' : [javadoc, '[SL args|@VM options]'],
'sl' : [sl, '[SL args|@VM options]'],
'sldebug' : [sldebug, '[SL args|@VM options]'],
'testdownstream' : [testdownstream, ''],
})

0 comments on commit 5f6e175

Please sign in to comment.