diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2017-10-17 01:07:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-17 01:07:35 +0300 |
commit | c89a3e55b74c4c5d1af1b1402871c8540f6a5cd8 (patch) | |
tree | 6f6b53335cb1a3f4ae7860d2aec612e9b3a175c0 /mcs/class/Mono.Posix | |
parent | a1cc4dfedb2daf1eaa638076330710a08da798ee (diff) |
[Mono.Posix] Use TestHelper code from monodroid repo (#5793)
We need this because XA is now starting to use the test assemblies
we build in the Mono repo instead of using the .cs source directly
and this would conflict.
Diffstat (limited to 'mcs/class/Mono.Posix')
-rw-r--r-- | mcs/class/Mono.Posix/Test/Mono.Unix.Android/TestHelper.cs | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/mcs/class/Mono.Posix/Test/Mono.Unix.Android/TestHelper.cs b/mcs/class/Mono.Posix/Test/Mono.Unix.Android/TestHelper.cs index a7a56a48c69..42a3e34a780 100644 --- a/mcs/class/Mono.Posix/Test/Mono.Unix.Android/TestHelper.cs +++ b/mcs/class/Mono.Posix/Test/Mono.Unix.Android/TestHelper.cs @@ -1,12 +1,32 @@ +using System; +using System.Reflection; + +using NUnit.Framework; + namespace Mono.Unix.Android { - // Another version of this class is used by the Xamarin.Android test suite - // It is here to keep the test code #ifdef free as much as possible public class TestHelper { + static bool areRealTimeSignalsSafe; + + static TestHelper () + { +#if MONODROID + var method = typeof (Mono.Unix.Native.NativeConvert).Assembly.GetType ("Mono.Unix.Android.AndroidUtils").GetMethod ("AreRealTimeSignalsSafe", BindingFlags.Public | BindingFlags.Static); + areRealTimeSignalsSafe = (bool)method.Invoke (null, null); +#else + areRealTimeSignalsSafe = true; +#endif + } + public static bool CanUseRealTimeSignals () { + if (!areRealTimeSignalsSafe) { + Assert.Ignore ("Real-time signals aren't supported on this Android architecture"); + return false; + } + return true; } } -}
\ No newline at end of file +} |