public AbstractTestRunner(TestSuite testSuite)
 {
     // <pex>
     Debug.Assert(testSuite != (TestSuite)null, "testSuite");
     // </pex>
     tests = testSuite;
 }
		static void Main(string[] args)
		{
			try
			{
				
				//String sln = @"D:\Documents and Settings\212059614\Desktop\PexFaultLocalization\SiemensSuite\TotInfo\TotInfo.sln";
				//string test_proj_name = "TotInfo.Tests";
				string sln = args[0];
				string test_proj_name = args[1];
				//String sln = @"D:\Documents and Settings\212059614\Desktop\PexFaultLocalization\SiemensSuite\Replace\Replace.sln";
				//String test_proj_name = @"Replace.Tests";
				CodeRewriter rewriter = new CodeRewriter(sln, test_proj_name);
				rewriter.Rewrite();

				TestSuite tests = new TestSuite(Path.GetDirectoryName(sln));
				ReflectionTestRunner runner = new ReflectionTestRunner(tests);
				RunFaultLocalization(runner);
			}
			catch(Exception e)
			{
				Console.WriteLine(e);
			}
		}
 public ReflectionTestRunner(TestSuite testSuite)
     : base(testSuite)
 {
     TestRunner = new UTCore.TestRunner();
     Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
 }
		public static void Main(string[] args)
		{
			if(args == (string[]) null || args.Length < 1)
			{
				Console.WriteLine("Usage: FaultLocalization.exe <SolutionDir>");
				Console.WriteLine("<SolutionDir> = full path to solution folder containing the .testconfig file");
				return;
			}

			String TestResultsPath = args[0];
           
			Console.WriteLine("Searching " + TestResultsPath + "...");

			String exePath = Path.Combine(TestResultsPath, "exes");

			foreach(String exe in Directory.GetFiles(exePath, "*.exe"))
			{
                TestSuite tests;
                try
                {
                    tests = new TestSuite(TestResultsPath);
                }
                catch (Exception ex)
                {
                    Die(ex);
                    return;
                }
                string pathCombine = Path.Combine(TestResultsPath, Path.GetFileNameWithoutExtension(exe));
				
                String projectName = Path.GetFileNameWithoutExtension(TestResultsPath);
				String solutionOutput = Path.Combine(TestResultsPath, projectName, "bin", "Debug", projectName);

                String exeName = Path.GetFileNameWithoutExtension(exe);
                String pdb = Path.Combine(exePath, exeName + ".pdb");

				Console.WriteLine("Copying " + Path.GetFullPath(exe) + " to " + Path.GetFullPath(solutionOutput + ".exe"));
				File.Copy(exe, solutionOutput + ".exe", true);
                File.Copy(pdb, solutionOutput + ".pdb", true);

				try
				{
					var testRunner = new CoverageTestRunner(tests);
					testRunner.RunTests();
				}
				catch(Exception ex)
				{
					Die(ex);
					return;
				}


				var testResults = tests.TestResults;
                try
                {
                    var ratedLines = BuildDiagnosisMatrix(testResults);

                    var dbbs = GetDynamicBasicBlocks(ratedLines);



                    foreach (Type SuspicousnessRaterType in typeof(ISuspiciousnessRater).TypesImplementingInterface(true))
                    {
                        ISuspiciousnessRater rater = (ISuspiciousnessRater)SuspicousnessRaterType.GetConstructor(Type.EmptyTypes).Invoke(new object[0]);
                        rater.RateLines(ratedLines, testResults);
                    }

                    OutputResults(ratedLines, pathCombine);
                }
                catch (Exception ex)
                {
                    Console.Out.WriteLine(ex);
                }
			}
			Console.Read();
		}
        public CoverageTestRunner(TestSuite testSuite)
            :base(testSuite)
        {

        }