private void button5_Click(object sender, EventArgs e) { env = new CSLE.CLS_Environment(this);//如果要启用命名空间,第二个参数要打开 TestReg.Reg(env); int succ = 0; for (int i = 0; i < listItem.Items.Count; i++) { Item item = listItem.Items[i] as Item; try { builded = false; Build(item.path, false); Run(item.test, false); Log("Build Succ(" + i + "/" + listItem.Items.Count + ")" + item.path); succ++; } catch (Exception err) { Log("Build Fail(" + i + "/" + listItem.Items.Count + ")" + item.path); } } Log("Test Result:(" + succ + "/" + listItem.Items.Count + ")"); }
private void Form1_Load(object sender, EventArgs e) { Debug.Logger = this; //bool useNamespace = false; env = new CSLE.CLS_Environment(this);//如果要启用命名空间,第二个参数要打开 TestReg.Reg(env); //查找所有脚本文件 string[] dirs = System.IO.Directory.GetDirectories("script"); foreach (var d in dirs) { try { Item i = new Item(); i.path = d; i.test = System.IO.File.ReadAllText(d + "/test.txt"); listItem.Items.Add(i); } catch (Exception err) { } } }
private void button3_Click(object sender, EventArgs e) { //Build Only env = new CSLE.CLS_Environment(this); //如果要启用命名空间,第二个参数要打开 TestReg.Reg(env); Item i = listItem.SelectedItem as Item; if (i == null) { return; } Build(i.path, true); }