xamarin-macios/tests/mmptest/Makefile

46 строки
1.8 KiB
Makefile
Исходник Обычный вид История

2016-05-26 16:06:52 +03:00
TOP = ../..
include $(TOP)/Make.config
export TargetFrameworkFallbackSearchPaths=$(MAC_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild-frameworks
export MSBuildExtensionsPathFallbackPathsOverride=$(MAC_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild
export XAMMAC_FRAMEWORK_PATH=$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current
export XamarinMacFrameworkRoot=$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current
2016-05-26 16:06:52 +03:00
all-local:: regression run
regression::
ifneq ($(SKIP_REGRESSION), 1)
$(MAKE) -C ../mmp-regression/
2016-05-26 16:06:52 +03:00
endif
# example command to run a single test:
# make run TEST_FIXTURE=-test=Xamarin.MMP.Tests.MMPTests.AOT_SmokeTest
# or:
# make run XM_TEST_NAME=Xamarin.MMP.Tests.MMPTests.AOT_SmokeTest
# to run multiple tests:
# make run TEST_FIXTURE="-test=Xamarin.MMP.Tests.MMPTests.AOT_32Bit_SmokeTest,Xamarin.MMP.Tests.MMPTests.AOT_SmokeTest"
#
ifeq ($(TEST_FIXTURE),)
ifneq ($(XM_TEST_NAME),)
TEST_FIXTURE=-test=$(XM_TEST_NAME)
endif
endif
run: build
rm -f .failed-stamp
$(TOP)/tools/nunit3-console-3.11.1 $(abspath $(TOP)/tests/mmptest/bin/Debug/mmptest.dll) "--result=$(abspath $(CURDIR)/TestResult.xml);format=nunit2" $(TEST_FIXTURE) --labels=All || touch $(CURDIR)/.failed-stamp
@# Create an html file and tell MonkeyWrench to upload it (if we're running there)
@[[ -z "$$BUILD_REPOSITORY" ]] || \
( xsltproc $(TOP)/tests/HtmlTransform.xslt TestResult.xml > index.html && \
echo "@MonkeyWrench: AddFile: $$PWD/index.html")
@[[ ! -e .failed-stamp ]]
2016-05-26 16:06:52 +03:00
build:
Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279) * Bump VSMac to 8.1.0.2742 to fix msbuild issues This is required to get the support for the msbuild `ToolsVersion` change from `15.0` to `Current`. * [tests][msbuild] Fix Binding resources test with updated msbuild Test failure with updated msbuild and vsmac 8.1: ``` Xamarin.iOS.Tasks.NativeReferencesNoEmbedding("iPhone").ShouldNotUnnecessarilyRebuildBindingProject(True) Binding project build did not create package? Expected: True But was: False at Xamarin.iOS.Tasks.NativeReferencesNoEmbedding.ShouldNotUnnecessarilyRebuildBindingProject (System.Boolean framework) [0x000a0] in <74b8f7d8a53e40109916d305bb4d7403>:0 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cul ture) [0x0006a] in <0519fa732e8845b6a809ce9180f541db>:0 ``` The test builds the project multiple times. Before the 3rd build, the project file's timestamp is updated and expects that the binding package will be rebuilt. But it is not, because the target `_CreateBindingResourcePackage` doesn't depend on that project file. So, add that to the target inputs. * [nuget] Use xibuild to run nuget Fix errors seen during `nuget restore` for tests: ``` Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xammac_tests/xammac_tests.csproj(213,3): error MSB4024: The imported project file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" could not be loaded. Could not find file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" ```
2019-06-19 08:07:27 +03:00
$(Q_XBUILD) $(SYSTEM_XIBUILD) -t -- /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/nuget/NuGet.exe restore ../tests-mac.sln
Move tests to use new tool xibuild and thus fix msbuild tests (#5128) * xibuild: New wrapper tool to run msbuild or managed executables MSBuild supports fallback paths for projects imported using `$(MSBuildExtensionsPath)`, but these must be specified explicitly in the app.config of the main executable. There was a PR to allow use of properties for this in the app.config, but that was not accepted upstream. This is required for being able to: 1. build projects with msbuild against the in-tree XI/XM build output 2. and to run nunit tests against the same. For this we introduce a new tool, `xibuild`, based on XA's `xabuild`. This supports the fallback paths to be specified via the environment variable `MSBuildExtensionsPathFallbackPathsOverride`[1]. It essentially operates in 3 modes: 1. `xibuild -c /path/to/foo.exe` Generates /path/to/foo.exe.config with the fallback paths inserted into that. 2. `xibuild -- /v:diag /path/to/project.csproj` Runs msbuild with the arguments after `--` with a custom app.config based on `MSBuild.dll.config`, with the fallback paths correctly inserted. This is in a temporary file and the original config file is not touched. 3. `xibuild -t -- /path/to/managed_tool.exe args` Generates `/path/to/managed_tool.exe.config` based on `MSBuild.dll.config` with the fallback paths inserted, and runs `managed_tool.exe` with the arguments. The default is to overwrite the config file. But there is also a switch to merge it with an existing config file. -- 1. Value of the environment variable $MSBuildExtensionsPathFallbackPathsOverride is prepended to any existing list of search paths in `MSBuild.dll.config`, IOW, it takes precedence. So, the order of lookup becomes: - Value of the property `$(MSBuildExtensionsPath)` - Value of the environment variable `$MSBuildExtensionsPathFallbackPathsOverride` - /Library/Frameworks/Mono.framework/External/xbuild on macOS * Integrate use of `xibuild` with the tests Update all uses of `msbuild` and invocations of tools like nunit that might depend on using the in-tree builds to use `xibuild`. * xibuild: Move help descriptions to OptionSet itself.
2018-11-16 22:24:35 +03:00
$(SYSTEM_XIBUILD) -- mmptest.csproj $(XBUILD_VERBOSITY)
2016-05-26 16:06:52 +03:00
clean-local::
@rm -rf ./obj
@rm -rf ./bin