public void RunStandalone(string[] args) { ResourceDir = Path.Combine(Path.GetDirectoryName(typeof(TestRunner).GetTypeInfo().Assembly.Location), "res"); EcoreSynchronizationContext.Initialize(); var testCases = GetTestCases(); TestCaseBase theTest = null; if (args.Count() > 0) { theTest = testCases.Where((testCase) => testCase.TestName == args[0] || testCase.GetType().ToString() == args[0]).FirstOrDefault(); } if (theTest != null) { StartTC(theTest); EcoreMainloop.Begin(); } else { CreateFirstPage(testCases); EcoreMainloop.Begin(); } Elementary.Shutdown(); }
private void CreateFirstPage(IEnumerable <TestCaseBase> testCases) { _firstPageWindow = CreateWindow(); Console.WriteLine("Screen DPI : {0}", _firstPageWindow.ScreenDpi.X); Conformant conformant = new Conformant(_firstPageWindow); conformant.Show(); Box box = new Box(_firstPageWindow) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); var bg = new Background(_firstPageWindow); bg.Color = Color.White; bg.SetContent(box); conformant.SetContent(bg); GenList list = new GenList(_firstPageWindow) { Homogeneous = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; GenItemClass defaultClass = new GenItemClass("default") { GetTextHandler = (data, part) => { TestCaseBase tc = data as TestCaseBase; return(tc == null ? "" : tc.TestName); } }; foreach (var tc in testCases.Where <TestCaseBase>((tc) => tc.TargetProfile.HasFlag(GetTargetProfile()))) { list.Append(defaultClass, tc); } if (Profile == "wearable") { list.Prepend(defaultClass, null); list.Append(defaultClass, null); } list.ItemSelected += (s, e) => { TestCaseBase tc = e.Item.Data as TestCaseBase; StartTCFromList(tc); }; list.Show(); box.PackEnd(list); }
private void StartTCFromList(TestCaseBase tc) { Window window = CreateWindow(true); tc.Run(window); }
private void StartTC(TestCaseBase tc) { Window window = CreateWindow(); tc.Run(window); }