예제 #1
0
        internal override void InternalExecute()
        {
            if (String.IsNullOrEmpty(pathToConsoleRunner))
            {
                throw new FileNotFoundException("Could not automatically find mstest.exe. Please specify it manually using PathToConsoleRunner");
            }

            BuildArgs();
            IExecutable executable = _executable.ExecutablePath(pathToConsoleRunner).UseArgumentBuilder(_argumentBuilder);

            if (!String.IsNullOrEmpty(workingDirectory))
            {
                executable = executable.InWorkingDirectory(workingDirectory);
            }

            //don't throw any errors
            //.WithMessageProcessor()
            int returnCode = executable.Execute();

            //if it returned non-zero then just exit (as a test failed)
            if (returnCode != 0 && base.OnError == OnError.Fail)
            {
                BuildFile.SetErrorState();
                Defaults.Logger.WriteError("ERROR", "MSTest returned non-zero error code");
            }
        }