main.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. // using System.Collections.Generic;
  4. using System.IO;
  5. // using System.Linq;
  6. // using System.Reflection;
  7. using System.Text;
  8. using System.Threading;
  9. using System.Runtime.InteropServices;
  10. using NUnitLite.Runner;
  11. public class Driver
  12. {
  13. static TextUI Runner;
  14. public static void RunTests ()
  15. {
  16. string exclude = "NotOnMac,NotWorking,ValueAdd,CAS,InetAccess,MobileNotWorking,SatelliteAssembliesNotWorking,AndroidNotWorking";
  17. if (IntPtr.Size == 4)
  18. exclude += ",LargeFileSupport";
  19. string assembly = null;
  20. if (File.Exists($"{AppDomain.CurrentDomain.BaseDirectory}/testassembly.txt"))
  21. assembly = File.ReadAllText ($"{AppDomain.CurrentDomain.BaseDirectory}/testassembly.txt");
  22. if (assembly != null) {
  23. assembly = $"{AppDomain.CurrentDomain.BaseDirectory}/{assembly}";
  24. Console.WriteLine ($"Testing single assembly \"{assembly}\"");
  25. } else {
  26. Console.WriteLine($"Looking for assemblies in ${AppDomain.CurrentDomain.BaseDirectory}");
  27. assembly = "";
  28. foreach (var file in Directory.EnumerateFiles(AppDomain.CurrentDomain.BaseDirectory, "monodroid_*_test.dll", SearchOption.TopDirectoryOnly))
  29. assembly += $"{AppDomain.CurrentDomain.BaseDirectory}/{file} ";
  30. Console.WriteLine ($"Testing multiple assemblies \"{assembly}\"");
  31. }
  32. string[] args = new string [] {
  33. $"-labels",
  34. $"-exclude={exclude}",
  35. $"{assembly}",
  36. };
  37. Runner = new TextUI ();
  38. Runner.Execute (args);
  39. }
  40. public static void Main ()
  41. {
  42. Environment.Exit (1);
  43. }
  44. }