@@ -415,13 +415,7 @@ def mx_os
415
415
end
416
416
end
417
417
418
- def mspec ( command , *args )
419
- env_vars = { }
420
- if command . is_a? ( Hash )
421
- env_vars = command
422
- command , *args = args
423
- end
424
-
418
+ def run_mspec ( env_vars , command = 'run' , *args )
425
419
mspec_args = [ 'spec/mspec/bin/mspec' , command , '--config' , 'spec/truffle.mspec' ]
426
420
427
421
if i = args . index ( '-t' )
@@ -504,6 +498,8 @@ def help
504
498
jt test report :language build a report on language specs
505
499
:core (results go into test/target/mspec-html-report)
506
500
:library
501
+ jt test unit run Java unittests
502
+ jt test tck run tck tests
507
503
jt gem-test-pack check that the gem test pack is downloaded, or download it for you, and print the path
508
504
jt rubocop [rubocop options] run rubocop rules (using ruby available in the environment)
509
505
jt tag spec/ruby/language tag failing specs in this directory
@@ -577,8 +573,12 @@ def clean(*options)
577
573
mx 'clean' , '--dependencies' , 'org.truffleruby.cext'
578
574
when nil
579
575
mx 'clean'
580
- sh 'rm' , '-rf' , 'mxbuild'
581
576
sh 'rm' , '-rf' , 'spec/ruby/ext'
577
+ Dir . glob ( "#{ TRUFFLERUBY_DIR } /mxbuild/{*,.*}" ) do |path |
578
+ next if File . basename ( path ) . start_with? ( 'truffleruby-' )
579
+ next if %w( . .. ) . include? File . basename ( path )
580
+ sh 'rm' , '-rf' , path
581
+ end
582
582
else
583
583
raise ArgumentError , project
584
584
end
@@ -791,7 +791,6 @@ def test(*args)
791
791
792
792
case path
793
793
when nil
794
- ENV [ 'HAS_REDIS' ] = 'true'
795
794
%w[ specs mri bundle cexts integration gems ecosystem compiler ] . each do |kind |
796
795
jt ( 'test' , kind )
797
796
end
@@ -806,6 +805,8 @@ def test(*args)
806
805
when 'basictest' then test_basictest ( *rest )
807
806
when 'bootstraptest' then test_bootstraptest ( *rest )
808
807
when 'mri' then test_mri ( *rest )
808
+ when 'unit' , 'unittest' then mx 'unittest' , 'org.truffleruby'
809
+ when 'tck' then mx 'tck'
809
810
else
810
811
if File . expand_path ( path , TRUFFLERUBY_DIR ) . start_with? ( "#{ TRUFFLERUBY_DIR } /test" )
811
812
test_mri ( *args )
@@ -1230,7 +1231,7 @@ def test_bundle(*args)
1230
1231
end
1231
1232
1232
1233
def mspec ( *args )
1233
- super ( *args )
1234
+ run_mspec ( { } , *args )
1234
1235
end
1235
1236
1236
1237
def test_specs ( command , *args )
@@ -1307,7 +1308,7 @@ def test_specs(command, *args)
1307
1308
build ( "cexts" )
1308
1309
end
1309
1310
1310
- mspec env_vars , command , *options , *args
1311
+ run_mspec env_vars , command , *options , *args
1311
1312
end
1312
1313
private :test_specs
1313
1314
@@ -1859,6 +1860,16 @@ def build_graalvm(*options)
1859
1860
rubies_dir = chruby_versions if File . directory? ( chruby_versions )
1860
1861
1861
1862
if rubies_dir
1863
+ Dir . glob ( rubies_dir + "/truffleruby-*" ) . each do |link |
1864
+ next unless File . symlink? ( link )
1865
+ next if File . exist? ( link )
1866
+ target = File . readlink ( link )
1867
+ next unless target . start_with? ( "#{ TRUFFLERUBY_DIR } /mxbuild" )
1868
+
1869
+ File . delete link
1870
+ puts "Deleted old link: #{ link } -> #{ target } "
1871
+ end
1872
+
1862
1873
link_path = "#{ rubies_dir } /#{ name } "
1863
1874
File . delete link_path if File . exist? link_path
1864
1875
File . symlink dest_ruby , link_path
0 commit comments