Example #1
0
 public Form1()
 {
     //for running processe/tests
     testrunnernostop = new TestrunnerNOstop();
     storedvalues = new List<string>();
     status = "unknown";
     error = ".";
     //test = ".";
     Serverreporter = new Report();
     CmdReader = new Readcmd();
     InitializeComponent();
     //tests = new Parameter();//I do not need this
     report1 = new Report();
     keepreporting = true;
     xmltestmanager = new XmlManager<Parameter>();
     // the the xmlfile the start off serialization
     //a instance of Parameter will be assigned to tests
     tests = xmltestmanager.Load("Content/rackparameterv2.xml");
     //Add the tests that does not have a quick test parameter in xml
     foreach (Parameter.Test t in tests.Tests())
     {
         /*saves all test name here so that it can be filtered later
         when the product selection is done*/
         storedvalues.Add(t.id);
     }
     textBox1.Focus();
 }
        //private int totaltime;

        public void Load(Parameter.Test testparameters, string serialno = "")
        {
            this.testparameters = testparameters;
            /*Get all the paramters to run the test
            and  add then to a long string*/
            if (testparameters != null)
            {
                string parsaruments = "";
                foreach (string s in testparameters.Parsstring)
                {
                    if (s.Contains("SERIAL_NUMBER"))
                        parsaruments += (" " + serialno);
                    else
                        parsaruments += (" " + s);
                }
                //add the path of the .py file to the parsedarguments
                string commandarguments = testparameters.arguments + parsaruments;
                //After loading parameters run it
                Runtest(commandarguments, testparameters.filename, testparameters.workingdirectory);
            }
        }
Example #3
0
 public Form1()
 {
     valuereport = "default";
     storedvalues = new List<string>();
     status = "unknown";
     error = ".";
     test = ".";
     Serverreporter = new Report();
     CmdReader = new Readcmd();
     InitializeComponent();
     xmltestmanager = new XmlManager<Parameter>();
     tests = new Parameter();
     report1 = new Report();
     keepreporting = true;
     tests = xmltestmanager.Load("Content/parameters.xml");// the the xmlfile the start off serialization
     foreach (Parameter.Test t in tests.tests)
     {
         //listBox1.Items.Add(t.id);
         storedvalues.Add(t.id);
     }
     textBox1.Focus();
 }