示例#1
0
    public static int Main(String[] args)
    {
        if (args.Length == 0)
        {
            ArgInput.DisplayUsage();
            return(FailureExitCode);
        }

        ArgInput   input  = new ArgInput(args);
        TestRunner runner = new TestRunner(input);

        AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

        int retVal = FailureExitCode;

        try
        {
            if (!input.StressMode)
            {
                retVal = runner.DoWorkNonStress();
            }
            else
            {
                retVal = runner.DoWorkStress();
            }
        }
        catch (UnloadFailedException)
        {
            Console.WriteLine($"FAILURE: Unload failed");
        }
        catch (Exception ex)
        {
            if (input.Verbose)
            {
                Console.WriteLine($"FAILURE: Exception: {ex.ToString()}");
            }
            else
            {
                Console.WriteLine($"FAILURE: Exception: {ex.Message}");
            }
        }

        string status = (retVal == FailureExitCode) ? "FAIL" : "PASS";

        Console.WriteLine();
        Console.WriteLine($"RunInContext {status}! Exiting with code {retVal}");

        return(retVal);
    }
示例#2
0
 public TestRunner(ArgInput input)
 {
     _input = input;
 }