Imported Upstream version 4.6.0.125

Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-03 10:59:49 +00:00
parent a569aebcfd
commit e79aa3c0ed
17047 changed files with 3137615 additions and 392334 deletions

View File

@@ -0,0 +1,23 @@
ACCEPTANCE_TESTS_PATH=external
ROSLYN_PATH=$(ACCEPTANCE_TESTS_PATH)/roslyn
CORECLR_PATH=$(ACCEPTANCE_TESTS_PATH)/coreclr
MSTESTSUITE_PATH=$(ACCEPTANCE_TESTS_PATH)/ms-test-suite
CLEANFILES = *.dll *.exe *.mdb
EXTRA_DIST=README.md SUBMODULES.json versions.mk roslyn.mk coreclr.mk ms-test-suite.mk
CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
with_mono_path = MONO_PATH=$(CLASS)
RUNTIME = $(with_mono_path) $(abs_top_builddir)/runtime/mono-wrapper --debug
MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe
ILASM = $(RUNTIME) $(CLASS)/ilasm.exe
include versions.mk
include roslyn.mk
include coreclr.mk
include ms-test-suite.mk
check-full: check-roslyn check-coreclr check-ms-test-suite
clean-local: clean-local-coreclr

View File

@@ -1 +0,0 @@
68b9ff90e7dc4c8e38686a067a75eb9365f9504b

View File

@@ -1 +1 @@
24a4c4858927915808d8266273160d32e9ac9e4d
32956102bf8b153420545562e9066c249e538001

View File

@@ -1,14 +1,35 @@
This directory contains acceptance tests, handled by optional non git submodule based submodules. Run the tests via "make check-full" (there are also targets for individual test suites).
Acceptance tests
================
The SUBMODULES.json file stores information about the submodules, and make targets are used to check out submodules, check their versions, and update the submodule information.
This directory contains acceptance tests, which are third party test suites and frameworks that are used to validate Mono against a wider range of test cases that go beyond the Mono unit tests that run as part of CI.
By convention, submodules repositories are at the same level as the mono repository.
In order to make checking out those test suites optional we don't use traditional git submodules, but instead clone them on demand when needed. The custom submodule repositories are checked out into the acceptance-tests/external/ directory.
Make targets available:
## Usage
make check-<module> - Checks whenever <module> is checked out and matches the version in the info file.
make reset-<module> - Clones <module>if neccesary and checks out the revision specified in the info file.
make bump-<module> - Updates the revision stored in the info file for <module>.
make bump-current-<module> - Updates the revision stored in the info file for <module> to the current revision.
make commit-bump-<module> - Same as make bump-<module>, but commits the change.
make commit-bump-current-<module> - Same as make bump-current-<module>, but commits the change.
Running all test suites is possible via "make check-full". There are also targets for running individual test suites, see below.
Some of the test suites require an installed Mono (i.e. they don't work with the in-tree build), those will ask you to pass in the PREFIX variable pointing to the installation directory when invoking make. Note that this directory needs to be writable as we overwrite some files there as part of testing.
## Individual test suites and targets
* `make check-ms-test-suite` - Runs tests that were shared with Xamarin, those are not available publically and will be skipped when the repository is not accessible.
* `make check-roslyn` - Runs the Roslyn test suite.
* `make check-coreclr` - Runs the CoreCLR test suite.
* `make coreclr-runtest-coremanglib` - Runs only the CoreMangLib portion of the CoreCLR tests, those tests mostly target the BCL behavior.
* `make coreclr-runtest-basic` - Runs only the CoreCLR tests that target runtime behavior and stability.
* `make coreclr-compile-tests` - Convenience target that precompiles all the test cases in parallel.
* `make coreclr-gcstress` - Runs the CoreCLR GC stress tests.
## Updating submodules
The SUBMODULES.json file stores information about the submodules, and make targets are used to check out submodules, check their versions, and update the submodule information:
* `make validate-<module>` - Checks whenever `<module>` is checked out and matches the version in the info file.
* `make reset-<module>` - Clones `<module>` if neccesary and checks out the revision specified in the info file.
* `make bump-<module>` - Updates the revision stored in the info file for `<module>`.
* `make bump-current-<module>` - Updates the revision stored in the info file for `<module>` to the current revision.
* `make commit-bump-<module>` - Same as `make bump-<module>`, but commits the change.
* `make commit-bump-current-<module>` - Same as `make bump-current-<module>`, but commits the change.
Example: when making a change in the CoreCLR submodule (like disabling something on Mono), you'd commit the change there and then run `make bump-current-coreclr` or `make commit-bump-current-coreclr` to update the version in SUBMODULES.json.

View File

@@ -10,7 +10,7 @@
{
"name": "coreclr",
"url": "git://github.com/mono/coreclr.git",
"rev": "96cf61f96b42cf9d013e641609cb7787f6e3a71f",
"rev": "c7da48acf72c40c0c0ed1a80ebfacea21bb3a271",
"remote-branch": "origin/mono",
"branch": "mono",
"directory": "coreclr"
@@ -18,7 +18,7 @@
{
"name": "ms-test-suite",
"url": "git@github.com:xamarin/ms-test-suite.git",
"rev": "8eb26bd72a38e2c78675db45b13e89237dbdf4f2",
"rev": "840653918efed24f00f5e166094f06354cae7255",
"remote-branch": "origin/master",
"branch": "master",
"directory": "ms-test-suite"

View File

@@ -0,0 +1 @@
8f75b05470fe46685d232f3a35933dbc1080fc59

View File

@@ -0,0 +1,10 @@
check-ms-test-suite:
@if $(MAKE) validate-ms-test-suite RESET_VERSIONS=1; then \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -t:library -warn:1 -r:nunit.framework" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-console.exe -nologo -exclude=MonoBug,BadTest" NUNIT_XML_RESULT=$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml || EXIT_CODE=1; \
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug -warn:1" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run MONO="$(RUNTIME)" || EXIT_CODE=1; \
exit $$EXIT_CODE; \
else \
echo "*** [ms-test-suite] Getting the repository failed, you probably don't have access to this Xamarin-internal resource. Skipping."; \
fi

View File

@@ -0,0 +1,24 @@
check-roslyn:
@$(MAKE) validate-roslyn RESET_VERSIONS=1
@if [ -z $$PREFIX ]; then echo "You need to set PREFIX to the prefix of the Mono installation that should be used for testing Roslyn." && exit 1; fi
sed -i -e 's/\\4.5-api"/\\4.5"/g' $$PREFIX/lib/mono/xbuild-frameworks/.NETFramework/v4.5/RedistList/FrameworkList.xml; \
export MSBuildExtensionsPath=$$PREFIX/lib/mono/xbuild; \
MONO_DOTNET_PORTABLE_DIR=$$PREFIX/lib/mono/xbuild-frameworks/.NETPortable/; \
MONO_NUGET_TARGETS_DIR=$$PREFIX/lib/mono/xbuild/Microsoft/NuGet/; \
MONO_PORTABLE_TARGETS_DIR=$$PREFIX/lib/mono/xbuild/Microsoft/Portable/v5.0; \
if [ ! -d "$$MONO_DOTNET_PORTABLE_DIR/v5.0" ]; then \
mkdir -p $$MONO_DOTNET_PORTABLE_DIR; \
mkdir -p $$MONO_NUGET_TARGETS_DIR; \
mkdir -p $$MONO_PORTABLE_TARGETS_DIR; \
curl -SL "http://download.mono-project.com/third-party/RoslynBuildDependencies.zip" > /tmp/RoslynBuildDependencies.zip; \
unzip -o /tmp/RoslynBuildDependencies.zip -d /tmp/RoslynBuildDependencies; \
cp -r /tmp/RoslynBuildDependencies/PortableReferenceAssemblies/* $$MONO_DOTNET_PORTABLE_DIR; \
cp /tmp/RoslynBuildDependencies/NuGetTargets/* $$MONO_NUGET_TARGETS_DIR; \
cp /tmp/RoslynBuildDependencies/PortableTargets/* $$MONO_PORTABLE_TARGETS_DIR; \
fi; \
cd $(ROSLYN_PATH); \
sed -i -e 'N; s/bootstrapArg=".*\n.*"/bootstrapArg=""/g' cibuild.sh; \
sed -i -e 's#-xml Binaries/\$$BUILD_CONFIGURATION/xUnitResults/#-nunit $(abs_top_builddir)/acceptance-tests/TestResult-#g' cibuild.sh; \
./cibuild.sh --mono-path $$PREFIX/bin || EXIT_CODE=1; \
sed -i -e 's/\\4.5"/\\4.5-api"/g' $$PREFIX/lib/mono/xbuild-frameworks/.NETFramework/v4.5/RedistList/FrameworkList.xml; \
exit $$EXIT_CODE

View File

@@ -1,127 +1,12 @@
.PHONY: validate-versions reset-versions
CONFIG=SUBMODULES.json
# usage $(call ValidateVersionTemplate (name,MAKEFILE VAR,repo name))
# usage $(call ValidateVersionTemplate (mono,MONO,mono))
define ValidateVersionTemplate
#$(eval REPOSITORY_$(2):=$(shell test -z $(3) && echo $(1) || echo "$(3)"))
#$(eval DIRECTORY_$(2):=$(shell python versions.py get-dir $(1)))
#$(eval DIRECTORY_$(2):=$(shell test -z $(DIRECTORY_$(2)) && echo $(1) || echo $(DIRECTORY_$(2))))
#$(eval MODULE_$(2):=$(shell python versions.py get-url $(1)))
#$(eval NEEDED_$(2)_VERSION:=$(shell python versions.py get-rev $(1)))
#$(eval $(2)_BRANCH_AND_REMOTE:=$(shell python versions.py get-remote-branch $(1)))
#$(eval $(2)_VERSION:=$$$$(shell cd $($(2)_PATH) 2>/dev/null && git rev-parse HEAD ))
#$(eval NEEDED_$(2)_BRANCH:=$(word 2, $(subst /, ,$($(2)_BRANCH_AND_REMOTE))))
#$(eval NEEDED_$(2)_REMOTE:=$(word 1, $(subst /, ,$($(2)_BRANCH_AND_REMOTE))))
#$(eval $(2)_BRANCH:=$$$$(shell cd $($(2)_PATH) 2>/dev/null && git symbolic-ref --short HEAD 2>/dev/null))
validate-$(1)::
@if test x$$(IGNORE_$(2)_VERSION) = "x"; then \
if test ! -d $($(2)_PATH); then \
if test x$$(RESET_VERSIONS) != "x"; then \
$(MAKE) reset-$(1) || exit 1; \
else \
echo "Your $(1) checkout is missing, please run 'make reset-$(1)'"; \
touch .validate-versions-failure; \
fi; \
else \
if test "x$($(2)_VERSION)" != "x$(NEEDED_$(2)_VERSION)" ; then \
if test x$$(RESET_VERSIONS) != "x"; then \
$(MAKE) reset-$(1) || exit 1; \
else \
echo "Your $(1) version is out of date, please run 'make reset-$(1)' (found $($(2)_VERSION), expected $(NEEDED_$(2)_VERSION))"; \
test -z "$(BUILD_REVISION)" || $(MAKE) test-$(1); \
touch .validate-versions-failure; \
fi; \
elif test "x$($(2)_BRANCH)" != "x$(NEEDED_$(2)_BRANCH)" ; then \
if test x$$(RESET_VERSIONS) != "x"; then \
test -z "$(BUILD_REVISION)" || $(MAKE) test-$(1); \
$(MAKE) reset-$(1) || exit 1; \
else \
echo "Your $(1) branch is out of date, please run 'make reset-$(1)' (found $($(2)_BRANCH), expected $(NEEDED_$(2)_BRANCH))"; \
touch .validate-versions-failure; \
fi; \
fi; \
fi; \
fi
test-$(1)::
@echo $(1)
@echo " REPOSITORY_$(2)=$(REPOSITORY_$(2))"
@echo " DIRECTORY_$(2)=$(DIRECTORY_$(2))"
@echo " MODULE_$(2)=$(MODULE_$(2))"
@echo " NEEDED_$(2)_VERSION=$(NEEDED_$(2)_VERSION)"
@echo " $(2)_VERSION=$($(2)_VERSION)"
@echo " $(2)_BRANCH_AND_REMOTE=$($(2)_BRANCH_AND_REMOTE)"
@echo " NEEDED_$(2)_BRANCH=$(NEEDED_$(2)_BRANCH)"
@echo " NEEDED_$(2)_REMOTE=$(NEEDED_$(2)_REMOTE)"
@echo " $(2)_BRANCH=$($(2)_BRANCH)"
@echo " $(2)_PATH=$($(2)_PATH) => $(abspath $($(2)_PATH))"
reset-$(1)::
@if test -d $($(2)_PATH); then \
if ! (cd $($(2)_PATH) && git show $(NEEDED_$(2)_VERSION) >/dev/null 2>&1 && git log -1 $(NEEDED_$(2)_REMOTE) >/dev/null 2>&1) ; then \
echo "*** git fetch `basename $$($(2)_PATH)`" && (cd $($(2)_PATH) && git fetch); \
fi; \
else \
echo "*** git clone $(MODULE_$(2)) --recursive $(DIRECTORY_$(2))" && (cd `dirname $($(2)_PATH)` && git clone $(MODULE_$(2)) --recursive $(DIRECTORY_$(2)) || exit 1 ); \
fi
@if test x$$(IGNORE_$(2)_VERSION) = "x"; then \
echo "*** [$(1)] git checkout -f" $(NEEDED_$(2)_BRANCH) && (cd $($(2)_PATH) ; git checkout -f $(NEEDED_$(2)_BRANCH) || git checkout -f -b $($(2)_BRANCH_AND_REMOTE)); \
echo "*** [$(1)] git reset --hard $(NEEDED_$(2)_VERSION)" && (cd $($(2)_PATH) && git reset --hard $(NEEDED_$(2)_VERSION)); \
fi
@echo "*** [$(1)] git submodule update --init --recursive" && (cd $($(2)_PATH) && git submodule update --init --recursive)
print-$(1)::
@printf "*** %-16s %-45s %s (%s)\n" "$(DIRECTORY_$(2))" "$(MODULE_$(2))" "$(NEEDED_$(2)_VERSION)" "$(NEEDED_$(2)_BRANCH)"
.PHONY: validate-$(1) reset-$(1) print-$(1)
reset-versions:: reset-$(1)
validate-versions:: Validate-$(1)
print-versions:: print-$(1)
endef
SUBMODULES_CONFIG_FILE = $(top_srcdir)/acceptance-tests/SUBMODULES.json
include $(top_srcdir)/scripts/submodules/versions.mk
$(eval $(call ValidateVersionTemplate,roslyn,ROSLYN))
$(eval $(call ValidateVersionTemplate,coreclr,CORECLR))
$(eval $(call ValidateVersionTemplate,ms-test-suite,MSTESTSUITE))
reset-versions::
validate-versions::
@if test -e .validate-versions-failure; then \
rm .validate-versions-failure; \
echo One or more modules needs update; \
exit 1; \
else \
echo All dependent modules up to date; \
fi
reset:
@$(MAKE) validate-versions RESET_VERSIONS=1
__bump-version-%:
@if [ "$(REV)" = "" ]; then echo "Usage: make bump-version-$* REV=<ref>"; exit 1; fi
python versions.py set-rev $* $(REV)
@if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to pick up $(REV)." | git commit -F - $(CONFIG); fi
__bump-branch-%:
@if [ "$(BRANCH)" = "" ]; then echo "Usage: make bump-branch-$* BRANCH=<branch> REMOTE_BRANCH=<remote branch>"; exit 1; fi
@if [ "$(REMOTE_BRANCH)" == "" ]; then echo "Usage: make bump-branch-$* BRANCH=<branch> REMOTE_BRANCH=<remote branch>"; exit 1; fi
python versions.py set-branch $* $(BRANCH)
python versions.py set-remote-branch $* $(REMOTE_BRANCH)
@if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to switch to $(BRANCH) $(REMOTE BRANCH)." | git commit -F - $(CONFIG); fi
__bump-current-version-%:
REV=$(shell cd $(TOP)/../$* && git log -1 --pretty=format:%H); \
python versions.py set-rev $* $$REV; \
if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to pick up $$REV:" | git commit -F - $(CONFIG); fi
# Bump the given submodule to the revision given by the REV make variable
# If COMMIT is 1, commit the change
bump-roslyn: __bump-version-roslyn

View File

@@ -1,52 +0,0 @@
#!/usr/bin/env python
import sys
import json
def find_module(submodules, name):
for item in submodules:
if item["name"] == name:
return item
print "Not found"
sys.exit(1)
if len(sys.argv) < 2:
print "Usage: versions.py <command>"
sys.exit(1)
CONFIG_FILE = "SUBMODULES.json"
command = sys.argv[1]
submodules = json.load(open(CONFIG_FILE))
if command == "get-rev":
mod = find_module(submodules, sys.argv[2])
print mod["rev"]
elif command == "get-url":
mod = find_module(submodules, sys.argv[2])
print mod["url"]
elif command == "get-dir":
mod = find_module(submodules, sys.argv[2])
print mod["directory"]
elif command == "get-remote-branch":
mod = find_module(submodules, sys.argv[2])
print mod["remote-branch"]
elif command == "set-rev":
mod = find_module(submodules, sys.argv[2])
mod["rev"] = sys.argv[3]
json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2)
elif command == "set-branch":
mod = find_module(submodules, sys.argv[2])
mod["branch"] = sys.argv[3]
json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2)
elif command == "set-remote-branch":
mod = find_module(submodules, sys.argv[2])
mod["remote-branch"] = sys.argv[3]
json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2)
elif command == "cat":
print json.dumps(submodules, indent = 2)
else:
print "Unknown command "" + command + ""."
sys.exit(1)