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

github.com/mono/NUnitLite.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Pouliot <sebastien@xamarin.com>2012-05-13 03:10:41 +0400
committerSebastien Pouliot <sebastien@xamarin.com>2012-05-13 03:10:41 +0400
commit93b22979746540800f4486d2fbb1e8e3d4fb4a10 (patch)
tree33702f89b1a119377978859da8d6d2d9a077908f
parentb4cef63b14841c9dce84400f6afcab9449e71a97 (diff)
Allow compilation on MonoTouch
-rwxr-xr-xNUnitLite-0.7.0/src/framework/Internal/RuntimeFramework.cs13
-rwxr-xr-xNUnitLite-0.7.0/src/framework/Internal/TestExecutionContext.cs4
2 files changed, 16 insertions, 1 deletions
diff --git a/NUnitLite-0.7.0/src/framework/Internal/RuntimeFramework.cs b/NUnitLite-0.7.0/src/framework/Internal/RuntimeFramework.cs
index 0882fec..32fb961 100755
--- a/NUnitLite-0.7.0/src/framework/Internal/RuntimeFramework.cs
+++ b/NUnitLite-0.7.0/src/framework/Internal/RuntimeFramework.cs
@@ -166,6 +166,10 @@ namespace NUnit.Framework.Internal
else /* It's windows */
if (major == 2)
{
+#if MONOTOUCH
+ major = 2;
+ minor = 0;
+#else
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework");
if (key != null)
{
@@ -184,6 +188,7 @@ namespace NUnit.Framework.Internal
}
}
}
+#endif
}
currentFramework = new RuntimeFramework(runtime, new Version(major, minor));
@@ -455,6 +460,7 @@ namespace NUnit.Framework.Internal
private static void AppendAllMonoFrameworks(FrameworkList frameworks)
{
+#if !MONOTOUCH
// TODO: Find multiple installed Mono versions under Linux
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
@@ -471,6 +477,7 @@ namespace NUnit.Framework.Internal
}
}
else
+#endif
AppendDefaultMonoFramework(frameworks);
}
@@ -481,7 +488,8 @@ namespace NUnit.Framework.Internal
string monoPrefix = null;
string version = null;
- if (Environment.OSVersion.Platform == PlatformID.Win32NT)
+ #if !MONOTOUCH
+ if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Novell\Mono");
if (key != null)
@@ -496,6 +504,7 @@ namespace NUnit.Framework.Internal
}
}
else // Assuming we're currently running Mono - change if more runtimes are added
+#endif
{
string libMonoDir = Path.GetDirectoryName(typeof(object).Assembly.Location);
monoPrefix = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(libMonoDir)));
@@ -538,6 +547,7 @@ namespace NUnit.Framework.Internal
private static void AppendDotNetFrameworks(FrameworkList frameworks)
{
+#if !MONOTOUCH
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\.NETFramework\policy");
@@ -554,6 +564,7 @@ namespace NUnit.Framework.Internal
}
}
}
+#endif
}
#if CLR_2_0 || CLR_4_0
diff --git a/NUnitLite-0.7.0/src/framework/Internal/TestExecutionContext.cs b/NUnitLite-0.7.0/src/framework/Internal/TestExecutionContext.cs
index 375d282..9585513 100755
--- a/NUnitLite-0.7.0/src/framework/Internal/TestExecutionContext.cs
+++ b/NUnitLite-0.7.0/src/framework/Internal/TestExecutionContext.cs
@@ -414,12 +414,16 @@ namespace NUnit.Framework.Internal
private void StopTracing()
{
traceWriter.Close();
+#if !MONOTOUCH
System.Diagnostics.Trace.Listeners.Remove( "NUnit" );
+#endif
}
private void StartTracing()
{
+#if !MONOTOUCH
System.Diagnostics.Trace.Listeners.Add( new TextWriterTraceListener( traceWriter, "NUnit" ) );
+#endif
}
/// <summary>