[xharness] Automatically enable tests on older simulators if we're using a beta Xcode. (#6334)

Usually it's when working on beta Xcodes we make mistakes that only show up
when running on older simulators (and devices):

* Missing/wrong availability attributes.
* Tests for new API that don't check the OS if that API is available.

So automatically enable the tests on older simulators for PR builds when using
a beta Xcode.
This commit is contained in:
Rolf Bjarne Kvinge 2019-06-17 19:15:41 +02:00 коммит произвёл GitHub
Родитель 2f877cfe8b
Коммит 9be8fdeb7b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -116,6 +116,13 @@ namespace xharness
LaunchTimeout = InWrench ? 3 : 120;
}
public bool IsBetaXcode {
get {
// There's no string.Contains (string, StringComparison) overload, so use IndexOf instead.
return XcodeRoot.IndexOf ("beta", StringComparison.OrdinalIgnoreCase) >= 0;
}
}
static string FindXcode (string path)
{
var p = path;

Просмотреть файл

@ -764,7 +764,6 @@ namespace xharness
SetEnabled (labels, "ios-extensions", ref IncludeiOSExtensions);
SetEnabled (labels, "device", ref IncludeDevice);
SetEnabled (labels, "xtro", ref IncludeXtro);
SetEnabled (labels, "old-simulator", ref IncludeOldSimulatorTests);
SetEnabled (labels, "all", ref IncludeAll);
// enabled by default
@ -802,6 +801,14 @@ namespace xharness
MainLog.WriteLine ("Disabled 'docs' tests because the Xamarin-specific parts of the build are not enabled.");
}
}
// old simulator tests is also a bit special:
// - enabled by default if using a beta Xcode, otherwise disabled by default
changed = SetEnabled (labels, "old-simulator", ref IncludeOldSimulatorTests);
if (!changed && Harness.IsBetaXcode) {
IncludeOldSimulatorTests = true;
MainLog.WriteLine ("Enabled 'old-simulator' tests because we're using a beta Xcode.");
}
}
// Returns true if the value was changed.