Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2017-10-17 01:07:35 +0300
committerGitHub <noreply@github.com>2017-10-17 01:07:35 +0300
commitc89a3e55b74c4c5d1af1b1402871c8540f6a5cd8 (patch)
tree6f6b53335cb1a3f4ae7860d2aec612e9b3a175c0 /mcs
parenta1cc4dfedb2daf1eaa638076330710a08da798ee (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')
-rw-r--r--mcs/class/Mono.Posix/Test/Mono.Unix.Android/TestHelper.cs26
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
+}