Beispiel #1
0
        private static ProcessOutput ExecCommand(bool throwOnProcessError, string executable, string args, IReadOnlyDictionary <string, string> envVars = null, string workDir = null)
        {
            Trace.TraceInformation($"{executable} {args}");
            var output = CcmBridge.ExecuteProcess(executable, args, timeout: 300000, envVariables: envVars, workDir: workDir);

            if (!throwOnProcessError)
            {
                return(output);
            }

            if (output.ExitCode != 0)
            {
                throw new TestInfrastructureException($"Process exited in error {output}");
            }

            return(output);
        }