Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Info-*.plist
Makefile.inc
*.stamp
test.config
test-system.config
mac-test-package
dotnet-test-package
.nuget
Expand Down
34 changes: 2 additions & 32 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,36 +79,6 @@ test.config: Makefile $(TOP)/Make.config $(TOP)/eng/Version.Details.xml
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_OS_VERSION=$($(platform)_NUGET_OS_VERSION)\\n)" | sed 's/^ //' >> $@
@printf "NUGET_PRERELEASE_IDENTIFIER=$(NUGET_PRERELEASE_IDENTIFIER)\n" >> $@

test-system.config: Makefile $(TOP)/Make.config $(TOP)/eng/Version.Details.xml
@rm -f $@
@echo "JENKINS_RESULTS_DIRECTORY=$(abspath $(JENKINS_RESULTS_DIRECTORY))" >> $@
@echo "DOTNET=$(DOTNET)" >> $@
@echo "IOS_SDK_VERSION=$(IOS_SDK_VERSION)" >> $@
@echo "TVOS_SDK_VERSION=$(TVOS_SDK_VERSION)" >> $@
@echo "MACOS_SDK_VERSION=$(MACOS_SDK_VERSION)" >> $@
@echo "DOTNET_TFM=$(DOTNET_TFM)" >> $@
@echo "DOTNET_BCL_DIR=$(DOTNET_BCL_DIR)" >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),DOTNET_$(platform)_RUNTIME_IDENTIFIERS='$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS)'\\n)" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),DOTNET_$(rid)_ARCHITECTURES='$(DOTNET_$(rid)_ARCHITECTURES)'\\n))" | sed 's/^ //' >> $@
@echo "DOTNET_CSC_COMMAND='$(DOTNET_CSC)'" >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_VERSION_NO_METADATA=$($(platform)_NUGET_VERSION_NO_METADATA)\\n)" | sed 's/^ //' >> $@
@echo "DOTNET_DIR=$(DOTNET_DIR)" >> $@
@echo "INCLUDE_IOS=$(INCLUDE_IOS)" >> $@
@echo "INCLUDE_TVOS=$(INCLUDE_TVOS)" >> $@
@echo "INCLUDE_MAC=$(INCLUDE_MAC)" >> $@
@echo "INCLUDE_MACCATALYST=$(INCLUDE_MACCATALYST)" >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_SDK_NAME=$($(platform)_NUGET_SDK_NAME)\\n)" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_REF_NAME=$($(platform)_NUGET_REF_NAME)\\n)" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_RUNTIME_MANAGED_NAME=$($(platform)_NUGET_RUNTIME_MANAGED_NAME)\\n)" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(rid)_NUGET_RUNTIME_NAME=$($(rid)_NUGET_RUNTIME_NAME)\\n))" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),SUPPORTED_API_VERSIONS_$(platform)='$(SUPPORTED_API_VERSIONS_$(platform))'\\n)" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_TARGET_PLATFORM_VERSION_LIBRARY=$($(platform)_TARGET_PLATFORM_VERSION_LIBRARY)\\n)" | sed 's/^ //' >> $@
@printf "XCODE_IS_STABLE=$(XCODE_IS_STABLE)\n" >> $@
@printf "XCODE_VERSION=$(XCODE_VERSION)\n" >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),DOTNET_MIN_$(platform)_SDK_VERSION=$(DOTNET_MIN_$(platform)_SDK_VERSION)\\n)" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_OS_VERSION=$($(platform)_NUGET_OS_VERSION)\\n)" | sed 's/^ //' >> $@
@printf "NUGET_PRERELEASE_IDENTIFIER=$(NUGET_PRERELEASE_IDENTIFIER)\n" >> $@

## run targets = build + [install] + exec

run run-all run-tests run-test run-unit-tests:
Expand Down Expand Up @@ -146,7 +116,7 @@ $(TOP)/tools/common/SdkVersions.cs: $(TOP)/tools/common/SdkVersions.in.cs

-include xharness/xharness.csproj.inc
$(XHARNESS_EXECUTABLE): MSBUILD_EXE_PATH=
$(XHARNESS_EXECUTABLE): $(xharness_dependencies) test.config test-system.config $(TOP)/tools/common/SdkVersions.cs
$(XHARNESS_EXECUTABLE): $(xharness_dependencies) test.config $(TOP)/tools/common/SdkVersions.cs
$(Q_GEN) $(DOTNET) build "/bl:$@.binlog" $(MSBUILD_VERBOSITY_QUIET) xharness/xharness.csproj
xharness/xharness.csproj.inc: export BUILD_VERBOSITY=$(DOTNET_BUILD_VERBOSITY)
xharness/xharness.csproj.inc: export MSBUILD_EXE_PATH=
Expand Down Expand Up @@ -183,7 +153,7 @@ else
endif

jenkins: $(XHARNESS_EXECUTABLE)
$(Q) $(DOTNET) $< $(XHARNESS_VERBOSITY) --jenkins --rootdir $(CURDIR) --sdkroot $(XCODE_DEVELOPER_ROOT) --markdown-summary=$(abspath $(CURDIR))/TestSummary.md --use-system=true $(TESTS_EXTRA_ARGUMENTS) $(TESTS_PERIODIC_COMMAND)
$(Q) $(DOTNET) $< $(XHARNESS_VERBOSITY) --jenkins --rootdir $(CURDIR) --sdkroot $(XCODE_DEVELOPER_ROOT) --markdown-summary=$(abspath $(CURDIR))/TestSummary.md $(TESTS_EXTRA_ARGUMENTS) $(TESTS_PERIODIC_COMMAND)

# This will launch xharness' interactive test runner in the system's default browser
runner: $(XHARNESS_EXECUTABLE)
Expand Down
21 changes: 1 addition & 20 deletions tests/common/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,6 @@ public static Version DotNetVersion {
get => Version.Parse (DotNetTfm.Replace ("net", ""));
}

static bool? use_system; // if the system-installed XI/XM should be used instead of the local one.

public static bool UseSystem {
get {
if (!use_system.HasValue)
use_system = !string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("TESTS_USE_SYSTEM"));
return use_system.Value;
}
set {
use_system = value;
}
}

static bool? is_vsts; // if the system-installed XI/XM should be used instead of the local one.

public static bool IsVsts {
Expand Down Expand Up @@ -149,7 +136,7 @@ static IEnumerable<string> FindConfigFiles (string name)

static void ParseConfigFiles ()
{
var test_config = FindConfigFiles (UseSystem ? "test-system.config" : "test.config");
var test_config = FindConfigFiles ("test.config");
if (!test_config.Any () && Environment.OSVersion.Platform != PlatformID.Win32NT) {
// Run 'make test.config' in the tests/ directory
// First find the tests/ directory
Expand Down Expand Up @@ -439,8 +426,6 @@ public static string GetDotNetRoot ()
public static string GetRefDirectory (ApplePlatform platform)
{
var rv = Path.Combine (GetDotNetRoot (), GetRefNuGetName (platform));
if (UseSystem)
rv = Path.Combine (rv, GetNuGetVersionNoMetadata (platform));
rv = Path.Combine (rv, "ref", DotNetTfm);
return rv;
}
Expand Down Expand Up @@ -468,8 +453,6 @@ public static string GetNuGetVersionNoMetadata (ApplePlatform platform)
public static string GetRuntimeDirectory (ApplePlatform platform, string runtimeIdentifier, bool isManagedRuntimePack = false)
{
var rv = Path.Combine (GetDotNetRoot (), isManagedRuntimePack ? GetManagedRuntimeNuGetName (platform) : GetRuntimeNuGetName (platform, runtimeIdentifier));
if (UseSystem)
rv = Path.Combine (rv, GetNuGetVersionNoMetadata (platform));
return Path.Combine (rv, "runtimes", runtimeIdentifier);
}

Expand All @@ -482,8 +465,6 @@ public static string GetSdkRoot (TargetFramework targetFramework)
public static string GetSdkRoot (ApplePlatform platform)
{
var rv = Path.Combine (GetDotNetRoot (), GetSdkNuGetName (platform));
if (UseSystem)
rv = Path.Combine (rv, GetNuGetVersionNoMetadata (platform));
return Path.Combine (rv, "tools");
}

Expand Down
3 changes: 1 addition & 2 deletions tests/mmptest/mmptest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
<PackageReference Include="NUnit.Extension.NUnitV2ResultWriter" Version="3.6.0" />
<Reference Include="mmp">
<Aliases>global,mmp</Aliases>
<HintPath Condition="$(TESTS_USE_SYSTEM) == ''">..\..\_mac-build\Library\Frameworks\Xamarin.Mac.framework\Versions\git\lib\mmp\mmp.exe</HintPath>
<HintPath Condition="$(TESTS_USE_SYSTEM) != ''">\Library\Frameworks\Xamarin.Mac.framework\Versions\Current\lib\mmp\mmp.exe</HintPath>
<HintPath>..\..\_mac-build\Library\Frameworks\Xamarin.Mac.framework\Versions\git\lib\mmp\mmp.exe</HintPath>
</Reference>
<PackageReference Include="Mono.Cecil" Version="$(MonoCecilPackageVersion)" />
<PackageReference Include="MSBuild.StructuredLogger" Version="$(MSBuildStructuredLoggerPackageVersion)" />
Expand Down
8 changes: 1 addition & 7 deletions tests/xharness/Harness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class HarnessConfiguration {
public string? SdkRoot { get; set; }
public TestTarget Target { get; set; }
public double TimeoutInMinutes { get; set; } = 15;
public bool UseSystemXamarinIOSMac { get; set; }
public int Verbosity { get; set; }
public XmlResultJargon XmlJargon { get; set; } = XmlResultJargon.NUnitV3;

Expand Down Expand Up @@ -198,8 +197,6 @@ bool IsVariableSet (string variable)

public List<TestProject> TestProjects { get; } = new ();

readonly bool useSystemXamarinIOSMac; // if the system XI/XM should be used, or the locally build XI/XM.

public bool INCLUDE_IOS { get; }
public bool INCLUDE_TVOS { get; }
public bool INCLUDE_MAC { get; }
Expand Down Expand Up @@ -251,9 +248,6 @@ public Harness (IResultParser resultParser, HarnessAction action, HarnessConfigu
PeriodicCommandInterval = configuration.PeriodicCommandInterval;
target = configuration.Target;
Timeout = configuration.TimeoutInMinutes;
useSystemXamarinIOSMac = configuration.UseSystemXamarinIOSMac;
if (!string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("TESTS_USE_SYSTEM")))
useSystemXamarinIOSMac = true;
Verbosity = configuration.Verbosity;
XmlJargon = configuration.XmlJargon;

Expand Down Expand Up @@ -575,7 +569,7 @@ Dictionary<string, string> ParseConfigFiles ()

IEnumerable<string> GetConfigFiles ()
{
return FindConfigFiles (useSystemXamarinIOSMac ? "test-system.config" : "test.config")
return FindConfigFiles ("test.config")
.Concat (FindConfigFiles ("configure.inc"))
.Concat (FindConfigFiles ("Make.config"))
.Concat (FindConfigFiles ("Make.config.local"))
Expand Down
1 change: 0 additions & 1 deletion tests/xharness/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public static int Main (string [] args)
var os = new OptionSet () {
{ "h|?|help", "Displays the help", (v) => showHelp!.Invoke () },
{ "v|verbose", "Show verbose output", (v) => configuration.Verbosity++ },
{ "use-system:", "Use the system version of Xamarin.iOS/Xamarin.Mac or the locally build version. Default: the locally build version.", (v) => configuration.UseSystemXamarinIOSMac = v == "1" || v == "true" || string.IsNullOrEmpty (v) },
{ "rootdir=", "The root directory for the tests.", (v) => HarnessConfiguration.RootDirectory = v },
{ "sdkroot=", "Where Xcode is", (v) => configuration.SdkRoot = v },
{ "target=", "Where to run the project ([ios|tvos]-[device|simulator).", (v) => configuration.Target = v.ParseAsAppRunnerTarget () },
Expand Down
4 changes: 0 additions & 4 deletions tests/xtro-sharpie/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ $(XTRO_SANITY): $(wildcard xtro-sanity/*.cs) $(wildcard xtro-sanity/*.csproj) $(
$(Q_GEN) unset MSBUILD_EXE_PATH && $(DOTNET) build xtro-sanity/xtro-sanity.csproj /bl:xtro-sanity.binlog $(DOTNET_BUILD_VERBOSITY)

define DotNetAssemblyPath
ifdef TESTS_USE_SYSTEM
X$(2)_DOTNET ?= $(DOTNET_DIR)/packs/$($(2)_NUGET_RUNTIME_MANAGED_NAME)/$($(2)_WORKLOAD_VERSION)/runtimes/$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_NO_ARCH)/lib/$(DOTNET_TFM)/$(DOTNET_$(2)_ASSEMBLY_NAME).dll
else
X$(2)_DOTNET ?= $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_MANAGED_NAME)/runtimes/$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_NO_ARCH)/lib/$(DOTNET_TFM)/$(DOTNET_$(2)_ASSEMBLY_NAME).dll
endif
endef
$(foreach platform,$(XTRO_DOTNET_PLATFORMS),$(eval $(call DotNetAssemblyPath,$(platform),$(shell echo $(platform) | tr a-z A-Z))))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ if ($Env:SYSTEM_DEFAULTWORKINGDIRECTORY.EndsWith($Env:BUILD_REPOSITORY_TITLE)) {
# Set a few variables
$Env:DOTNET = "$Env:BUILD_SOURCESDIRECTORY\$Env:BUILD_REPOSITORY_TITLE\tests\dotnet\Windows\bin\dotnet\dotnet.exe"
$Env:DOTNET_DIR = "$Env:BUILD_SOURCESDIRECTORY\$Env:BUILD_REPOSITORY_TITLE\tests\dotnet\Windows\bin\dotnet\"
$Env:TESTS_USE_SYSTEM = "1"

# Set Xcode version info so BGen tests can determine preview API diagnostic suppression
$Env:XCODE_VERSION = $Env:CONFIGURATION_XCODE_VERSION
Expand Down
5 changes: 0 additions & 5 deletions tools/devops/automation/templates/tests/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ steps:
TESTS_PLATFORM: ${{ parameters.testPlatform }}
LABEL_WITH_PLATFORM: ${{ parameters.labelWithPlatform }}

- pwsh: |
Write-Host "##vso[task.setvariable variable=TESTS_USE_SYSTEM]true"
displayName: Set SDK destination dirs


# remove any old processes that might have been left behind.
- pwsh: |
Import-Module $Env:SYSTEM_DEFAULTWORKINGDIRECTORY/$Env:BUILD_REPOSITORY_TITLE/tools/devops/automation/scripts/MaciosCI.psd1
Expand Down
Loading