Exemplo n.º 1
0
        /// <summary>
        /// Prevents a default instance of the <see cref="EngineCore" /> class from being created.
        /// </summary>
        private EngineCore()
        {
            this.Processes     = ProcessAdapterFactory.GetProcessAdapter();
            this.VirtualMemory = VirtualMemoryAdapterFactory.GetVirtualMemoryAdapter();
            this.Network       = new Network();
            this.Architecture  = ArchitectureFactory.GetArchitecture();
            this.Input         = new InputManager();

            this.StartBackgroundServices();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Prevents a default instance of the <see cref="EngineCore" /> class from being created.
        /// </summary>
        private EngineCore()
        {
            this.Processes     = ProcessAdapterFactory.GetProcessAdapter();
            this.VirtualMemory = VirtualMemoryAdapterFactory.GetVirtualMemoryAdapter();
            this.Debugger      = DebuggerFactory.GetDebugger();
            this.Graphics      = new GraphicsAdapter();
            this.Network       = new Network();
            this.Architecture  = ArchitectureFactory.GetArchitecture();
            this.Input         = new InputManager();

            if (this.Architecture.HasVectorSupport())
            {
                OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Info, "Hardware acceleration enabled");
                OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Info, "Vector size: " + System.Numerics.Vector <Byte> .Count);
            }

            this.StartBackgroundServices();
        }
Exemplo n.º 3
0
        /// <summary>
        /// executes the run of the test by using the Init and RunProcss routines
        /// </summary>
        /// <param name="fileName">the prcess file name</param>
        /// <param name="arguments">the arguments for the process</param>
        /// <param name="failureReason"> the reason why the process failed </param>
        /// <returns> the exit code of the process </returns>
        private int ExecuteProcess(string fileName, string arguments, ref string failureReason)
        {
            IProcessAdapter processAdapter = ProcessAdapterFactory.CreateAdapter(GetProcessTypeForCurrentSession(fileName, arguments));

            if (processAdapter == null)
            {
                failureReason = "Could not create ProcessAdapter instance!";
                return((int)ParallelRunResult.Error);
            }

            try
            {
                int exitCode = RunProcess(processAdapter);

                if (_runCancelled())
                {
                    if (!processAdapter.HasExited)
                    {
                        processAdapter.Kill();
                        return((int)ParallelRunResult.Canceled);
                    }
                }

                return(exitCode);
            }
            catch (Exception e)
            {
                failureReason = e.Message;
                return((int)ParallelRunResult.Error);
            }
            finally
            {
                if (processAdapter != null)
                {
                    processAdapter.Close();
                }
            }
        }