Skip to content

Commit 9ce2209

Browse files
committed
RVM-984: Don't run unit tests on the built RVM image by default
Running unit tests on the built RVM image leads to build failures for corner cases (e.g. builds with NoGC plan fail) and significantly increases the build time for slow configurations (e.g. prototype).
1 parent dd25c60 commit 9ce2209

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

bin/buildit

+19-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Building Options:
9090
--build-arg Specify an additional argument for the ant build
9191
--bc-arg Specify arguments for the bootimage compiler
9292
--checkstyle Perform source code style checks.
93+
--test-image Run unit tests on the built RVM image and fail the build if the tests fail
9394
-p, --profile Perform a profiled build (including creation of a profile)
9495
--comp-cache-dir Specify a cache location for component downloads
9596
--clear-cc Clear out the component caches
@@ -145,6 +146,7 @@ GetOptions(
145146
"nuke" => \$nuke,
146147
"c|cross-to=s" => \$target,
147148
"checkstyle" => \$checkstyle,
149+
"test-image" => \$test_image,
148150
"p|profile" => \$profile,
149151
"u|user=s" => \$cmd_user,
150152
"build-user=s" => \$cmd_hostUser,
@@ -438,13 +440,26 @@ if ($test_list ne "") {
438440
#
439441
# Configuration
440442
#
443+
444+
# Read out test-run properties that affect the build config (e.g. for checkstyle and
445+
# unit tests on the images) and add them to the build arguments.
446+
#
447+
# Those properties would be ignored otherwise because buildit always skips builds in test-runs.
441448
if ($test_set && !$checkstyle) {
442449
$checkstyle = `grep ^require.checkstyle=true\$ $localRoot/build/test-runs/$test_set.properties`;
443450
chomp($checkstyle);
444451
if ($checkstyle ne "") {
445452
$checkstyle = 1;
446453
}
447454
}
455+
if ($test_set && !$test_image) {
456+
$test_image = `grep ^require.rvm-unit-tests=true\$ $localRoot/build/test-runs/$test_set.properties`;
457+
chomp($test_image);
458+
if ($test_image ne "") {
459+
$test_image = 1;
460+
}
461+
}
462+
448463
$implicitconfigs = ($#gcs == -1 && $compiler eq "");
449464
if ($#gcs == -1 && $test_set && $compiler eq "") {
450465
my $rawconfigs = `grep \"^test.configs=.*$\" $localRoot/build/test-runs/$test_set.properties`;
@@ -653,7 +668,10 @@ if ($ok) {
653668
}
654669
if ($checkstyle ne "") {
655670
$defs .= "-Drequire.checkstyle=true ";
656-
}
671+
}
672+
if ($test_image ne "") {
673+
$defs .= "-Drequire.rvm-unit-tests=true ";
674+
}
657675
if ($x87 ne "") {
658676
$defs .= "-Dtarget.arch.sse2=none ";
659677
}

build.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ Check to make sure all required properties are specified. This includes properti
13471347
</junit>
13481348
</target>
13491349

1350-
<target name="rvm-unit-tests" description="Run unit tests on Jikes RVM" depends="runtime">
1350+
<target name="rvm-unit-tests" description="Run unit tests on Jikes RVM" depends="runtime" if="${require.rvm-unit-tests}">
13511351

13521352
<delete dir="${junit.reports.rvm}"/>
13531353
<mkdir dir="${junit.reports.rvm}"/>

build/test-runs/pre-commit.properties

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#
1717

1818
require.checkstyle=true
19+
require.rvm-unit-tests=true
1920

2021
test.configs=prototype development development_Opt_1
2122

test.xml

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
output="${driver.scratch.dir}/Build-${test.config.@{tag}.configuration}.txt">
144144
<property name="config.name" value="${test.config.@{tag}.configuration}"/>
145145
<property name="require.checkstyle" value="${require.checkstyle}"/>
146+
<property name="require.rvm-unit-tests" value="${require.rvm-unit-tests}"/>
146147
</erant>
147148
<timer property="${test.config.@{tag}.configuration}.build.time" stop="true"/>
148149
<property name="${test.config.@{tag}.configuration}.built" value="true"/>

0 commit comments

Comments
 (0)