Merge pull request #459 from dicej/bootimage-test

add bootimage-test option to makefile
This commit is contained in:
Joshua Warner 2015-10-20 17:33:58 +00:00
commit 7cc9f160f2
4 changed files with 35 additions and 7 deletions

View File

@ -83,6 +83,8 @@ public class SystemClassLoader extends ClassLoader {
if (source != null) { if (source != null) {
// todo: load attributes from JAR manifest // todo: load attributes from JAR manifest
definePackage(name, null, null, null, null, null, null, null); definePackage(name, null, null, null, null, null, null, null);
} else {
definePackage(name, null, null, null, null, null, null, null);
} }
} }

View File

@ -45,6 +45,11 @@ ifneq ($(lzma),)
endif endif
ifeq ($(bootimage),true) ifeq ($(bootimage),true)
options := $(options)-bootimage options := $(options)-bootimage
ifeq ($(bootimage-test),true)
# this option indicates that we should AOT-compile the test
# classes as well as the class library
options := $(options)-test
endif
endif endif
ifeq ($(tails),true) ifeq ($(tails),true)
options := $(options)-tails options := $(options)-tails
@ -92,6 +97,12 @@ ifeq ($(platform),ios)
endif endif
endif endif
ifeq ($(bootimage-test),true)
ifneq ($(bootimage),true)
x := $(error "bootimage-test=true only works when bootimage=true")
endif
endif
aot-only = false aot-only = false
root := $(shell (cd .. && pwd)) root := $(shell (cd .. && pwd))
build = build/$(platform)-$(arch)$(options) build = build/$(platform)-$(arch)$(options)
@ -109,6 +120,12 @@ wp8 ?= $(root)/wp8
classpath = avian classpath = avian
bootimage-classpath = $(classpath-build)
ifeq ($(bootimage-test),true)
bootimage-classpath = $(classpath-build):$(test-build)
endif
test-executable = $(shell pwd)/$(executable) test-executable = $(shell pwd)/$(executable)
boot-classpath = $(classpath-build) boot-classpath = $(classpath-build)
embed-prefix = /avian-embedded embed-prefix = /avian-embedded
@ -1647,7 +1664,6 @@ debug: build
vg: build vg: build
$(library-path) $(vg) $(test-executable) $(test-args) $(library-path) $(vg) $(test-executable) $(test-args)
.PHONY: test .PHONY: test
test: build-test run-test test: build-test run-test
@ -2066,9 +2082,9 @@ else
endif endif
$(bootimage-object) $(codeimage-object): $(bootimage-generator) \ $(bootimage-object) $(codeimage-object): $(bootimage-generator) \
$(classpath-jar-dep) $(classpath-jar-dep) $(test-dep)
@echo "generating bootimage and codeimage binaries from $(classpath-build) using $(<)" @echo "generating bootimage and codeimage binaries from $(classpath-build) using $(<)"
$(<) -cp $(classpath-build) -bootimage $(bootimage-object) -codeimage $(codeimage-object) \ $(<) -cp $(bootimage-classpath) -bootimage $(bootimage-object) -codeimage $(codeimage-object) \
-bootimage-symbols $(bootimage-symbols) \ -bootimage-symbols $(bootimage-symbols) \
-codeimage-symbols $(codeimage-symbols) \ -codeimage-symbols $(codeimage-symbols) \
-hostvm $(host-vm) -hostvm $(host-vm)
@ -2126,7 +2142,7 @@ $(unittest-executable): $(unittest-executable-objects)
$(bootimage-generator): $(bootimage-generator-objects) $(vm-objects) $(bootimage-generator): $(bootimage-generator-objects) $(vm-objects)
echo building $(bootimage-generator) arch=$(build-arch) platform=$(bootimage-platform) echo building $(bootimage-generator) arch=$(build-arch) platform=$(bootimage-platform)
$(MAKE) process=interpret bootimage= mode=$(mode) $(MAKE) process=interpret bootimage= bootimage-test= mode=$(mode)
$(MAKE) mode=$(mode) \ $(MAKE) mode=$(mode) \
build=$(host-build-root) \ build=$(host-build-root) \
arch=$(build-arch) \ arch=$(build-arch) \

View File

@ -291,9 +291,18 @@ public class Misc {
test = true; test = true;
} }
} }
expect(count == 2); // This test is only relevant if multi-classpath-test.txt
expect(test); // actually exists in somewhere under the classpath from which
expect(extraDir); // Misc.class was loaded. Since we run this test from an
// AOT-compiled boot image as well as straight from the
// filesystem, and the boot image does not contain
// multi-classpath-test.txt, we'll skip the test if it's not
// present.
if (count != 0) {
expect(count == 2);
expect(test);
expect(extraDir);
}
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@ -97,6 +97,7 @@ else
if has_flag openjdk-src || ! has_flag openjdk; then if has_flag openjdk-src || ! has_flag openjdk; then
run make ${flags} mode=debug bootimage=true ${make_target} run make ${flags} mode=debug bootimage=true ${make_target}
run make ${flags} bootimage=true ${make_target} run make ${flags} bootimage=true ${make_target}
run make ${flags} bootimage=true bootimage-test=true ${make_target}
fi fi
if ! has_flag openjdk && ! has_flag android && ! has_flag arch; then if ! has_flag openjdk && ! has_flag android && ! has_flag arch; then