protected override void OnCreate(Bundle bundle) { AddTestAssembly(typeof(SQLitePCL.pretty.tests.SQLiteDatabaseConnectionTests).Assembly); // or in any assembly that you load (since JIT is available) #if false // you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-) Writer = new TcpTextWriter ("10.0.1.2", 16384); // start running the test suites as soon as the application is loaded AutoStart = true; // crash the application (to ensure it's ended) and return to springboard TerminateAfterExecution = true; #endif // you cannot add more assemblies once calling base base.OnCreate(bundle); }
protected override void OnCreate(Bundle bundle) { this.AddTestAssembly(typeof(DispatcherServiceTests).Assembly); this.AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly); // or in any reference assemblies #if false // you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-) Writer = new TcpTextWriter ("10.0.1.2", 16384); // start running the test suites as soon as the application is loaded AutoStart = true; // crash the application (to ensure it's ended) and return to springboard TerminateAfterExecution = true; #endif // you cannot add more assemblies once calling base base.OnCreate(bundle); }
protected override void OnCreate(Bundle bundle) { // tests can be inside the main assembly AddTestAssembly(Assembly.GetExecutingAssembly()); AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly); // or in any reference assemblies AddTestAssembly(typeof(PortableTests).Assembly); // or in any assembly that you load (since JIT is available) #if false // you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-) Writer = new TcpTextWriter ("10.0.1.2", 16384); // start running the test suites as soon as the application is loaded AutoStart = true; // crash the application (to ensure it's ended) and return to springboard TerminateAfterExecution = true; #endif // you cannot add more assemblies once calling base base.OnCreate(bundle); }
private bool OpenWriter(string message) { var now = DateTime.Now; // let the application provide it's own TextWriter to ease automation with AutoStart property if (Writer == null) { if (RunnerOptions.Current.ShowUseNetworkLogger) { Console.WriteLine("[{0}] Sending '{1}' results to {2}:{3}", now, message, RunnerOptions.Current.HostName, RunnerOptions.Current.HostPort); try { Writer = new TcpTextWriter(RunnerOptions.Current.HostName, RunnerOptions.Current.HostPort); } catch (SocketException) { var msg = String.Format("Cannot connect to {0}:{1}. Start network service or disable network option", RunnerOptions.Current.HostName, RunnerOptions.Current.HostPort); Toast.MakeText(Android.App.Application.Context, msg, ToastLength.Long) .Show(); return false; } } else { Writer = Console.Out; } } Writer.WriteLine("[Runner executing:\t{0}]", message); // FIXME Writer.WriteLine("[M4A Version:\t{0}]", "???"); Writer.WriteLine("[Board:\t\t{0}]", Build.Board); Writer.WriteLine("[Bootloader:\t{0}]", Build.Bootloader); Writer.WriteLine("[Brand:\t\t{0}]", Build.Brand); Writer.WriteLine("[CpuAbi:\t{0} {1}]", Build.CpuAbi, Build.CpuAbi2); Writer.WriteLine("[Device:\t{0}]", Build.Device); Writer.WriteLine("[Display:\t{0}]", Build.Display); Writer.WriteLine("[Fingerprint:\t{0}]", Build.Fingerprint); Writer.WriteLine("[Hardware:\t{0}]", Build.Hardware); Writer.WriteLine("[Host:\t\t{0}]", Build.Host); Writer.WriteLine("[Id:\t\t{0}]", Build.Id); Writer.WriteLine("[Manufacturer:\t{0}]", Build.Manufacturer); Writer.WriteLine("[Model:\t\t{0}]", Build.Model); Writer.WriteLine("[Product:\t{0}]", Build.Product); Writer.WriteLine("[Radio:\t\t{0}]", Build.Radio); Writer.WriteLine("[Tags:\t\t{0}]", Build.Tags); Writer.WriteLine("[Time:\t\t{0}]", Build.Time); Writer.WriteLine("[Type:\t\t{0}]", Build.Type); Writer.WriteLine("[User:\t\t{0}]", Build.User); Writer.WriteLine("[VERSION.Codename:\t{0}]", Build.VERSION.Codename); Writer.WriteLine("[VERSION.Incremental:\t{0}]", Build.VERSION.Incremental); Writer.WriteLine("[VERSION.Release:\t{0}]", Build.VERSION.Release); Writer.WriteLine("[VERSION.Sdk:\t\t{0}]", Build.VERSION.Sdk); Writer.WriteLine("[VERSION.SdkInt:\t{0}]", Build.VERSION.SdkInt); Writer.WriteLine("[Device Date/Time:\t{0}]", now); // to match earlier C.WL output // FIXME: add data about how the app was compiled (e.g. ARMvX, LLVM, Linker options) return true; }
public bool OpenWriter(string message) { RunnerOptions options = RunnerOptions.Current; DateTime now = DateTime.Now; // let the application provide it's own TextWriter to ease automation with AutoStart property if (Writer == null) { if (options.ShowUseNetworkLogger) { var hostname = SelectHostName(options.HostName.Split(','), options.HostPort); if (hostname != null) { Console.WriteLine("[{0}] Sending '{1}' results to {2}:{3}", now, message, hostname, options.HostPort); try { Writer = new TcpTextWriter(hostname, options.HostPort); } catch (SocketException) { UIAlertView alert = new UIAlertView("Network Error", String.Format("Cannot connect to {0}:{1}. Continue on console ?", hostname, options.HostPort), null, "Cancel", "Continue"); int button = -1; alert.Clicked += delegate(object sender, UIButtonEventArgs e) { button = (int)e.ButtonIndex; }; alert.Show(); while (button == -1) NSRunLoop.Current.RunUntil(NSDate.FromTimeIntervalSinceNow(0.5)); Console.WriteLine(button); Console.WriteLine("[Host unreachable: {0}]", button == 0 ? "Execution cancelled" : "Switching to console output"); if (button == 0) return false; else Writer = Console.Out; } } } else { Writer = Console.Out; } } Writer.WriteLine("[Runner executing:\t{0}]", message); Writer.WriteLine("[MonoTouch Version:\t{0}]", Constants.Version); //Writer.WriteLine("[GC:\t{0}{1}]", GC.MaxGeneration == 0 ? "Boehm" : "sgen", // NSObject.IsNewRefcountEnabled() ? "+NewRefCount" : String.Empty); UIDevice device = UIDevice.CurrentDevice; Writer.WriteLine("[{0}:\t{1} v{2}]", device.Model, device.SystemName, device.SystemVersion); Writer.WriteLine("[Device Name:\t{0}]", device.Name); Writer.WriteLine("[Device UDID:\t{0}]", UniqueIdentifier); Writer.WriteLine("[Device Locale:\t{0}]", NSLocale.CurrentLocale.Identifier); Writer.WriteLine("[Device Date/Time:\t{0}]", now); // to match earlier C.WL output Writer.WriteLine("[Bundle:\t{0}]", NSBundle.MainBundle.BundleIdentifier); // FIXME: add data about how the app was compiled (e.g. ARMvX, LLVM, GC and Linker options) passed = 0; skipped = 0; failed = 0; return true; }