Esempio n. 1
0
        private void Uplink(TestDirector director, UplinkOptions options)
        {
            Console.WriteLine($"Uplink {options.Source}");

            var result = director.UplinkTestAssembly(options.Source);

            Console.WriteLine($"  {result}");
        }
Esempio n. 2
0
        private void ProcessTestCommand(TestDirector director, TestOptions options)
        {
            if (options.List)
            {
                Console.WriteLine($"List of Tests:");

                var result = director.GetTestNames();

                if ((result == null) || (result.Length == 0))
                {
                    Console.WriteLine($"  <none>");
                }
                else
                {
                    foreach (var t in result)
                    {
                        Console.WriteLine($"  {t}");
                    }
                }
            }
            else if (!string.IsNullOrEmpty(options.Execute))
            {
                // allow a few delimiters
                var names = options.Execute.Split(new char[] { ';', ',', '|' }, StringSplitOptions.RemoveEmptyEntries);

                TestResult[] results;

                try
                {
                    results = director.ExecuteTests(names);
                }
                catch (System.IO.FileNotFoundException fe)
                {
                    Console.WriteLine($"Unable to open the serial port: {fe.Message}");
                    return;
                }

                if (results != null)
                {
                    Console.WriteLine("Executing tests:");

                    // TODO: support verbose
                    foreach (var r in results)
                    {
                        Console.WriteLine($"  {r.TestID} as {r.ResultID}");
                    }
                }
                else
                {
                    Console.WriteLine("No results received.");
                }
            }
        }
Esempio n. 3
0
 private void ProcessAssemblyCommand(TestDirector director, AssemblyOptions options)
 {
     if (options.List)
     {
         Console.WriteLine($"List of Assemblies:");
         var result = director.GetAssemblies();
         if ((result == null) || (result.Length == 0))
         {
             Console.WriteLine($"  <none>");
         }
         else
         {
             foreach (var a in result)
             {
                 Console.WriteLine($"  {a}");
             }
         }
     }
     else if (options.Clear)
     {
         Console.WriteLine($"Delete all Test Assemblies...");
         var result = director.DeleteAssemblies();
     }
 }