Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it necessary to open console windows in run-tests? #558

Closed
4 tasks done
jongleur1983 opened this issue May 6, 2018 · 6 comments
Closed
4 tasks done

Is it necessary to open console windows in run-tests? #558

jongleur1983 opened this issue May 6, 2018 · 6 comments

Comments

@jongleur1983
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

the run-tests.ps1 script is used to run the unit tests.
When I run it from a powershell console window (on Windows10) repeatingly other windows pop up for some fraction of a second. These windows look like cmd console windows or similar, but I'm not sure as they close immediately.

My issue with that is: While tests are running I often would like to do other stuff in parallel, but those flashing windows not only are visually disturbing, they steal the keyboard input focus as well.

I'm not sure where they're originating, but it would be great if we could either hide them or get them opening in background instead.

Steps to Reproduce

  • open PowerShell
  • build ImageSharp
  • run tests (I used net471 as framework)

System Configuration

  • ImageSharp version: current master branch
  • Other ImageSharp packages and versions:
  • Environment (Operating system, version and so on): Windows10, fresh April Update
  • .NET Framework version:
  • Additional information:
@antonfirsov
Copy link
Member

antonfirsov commented May 6, 2018

It is dump-jpeg-coeffs.exe being executed by Process.Start(). Do you know a better way of executing a command line utility from managed code?

@jongleur1983
Copy link
Contributor Author

thanks.
according to https://stackoverflow.com/questions/5377423/hide-console-window-from-process-start-c-sharp it's possible to customize the ProcessStartInfo.
Not that clear from the text itself, but might be a good starting point. Perhaps I'll have a look at it, if no one else takes it.

@jongleur1983
Copy link
Contributor Author

works.
I'm on another branch currently, but the following is working for me:
I replaced

var process = Process.Start(DumpToolFullPath, args); process.WaitForExit();

by

var process = new Process
  {
    StartInfo =
      {
        UseShellExecute = true,
        CreateNoWindow = true,
        WindowStyle = ProcessWindowStyle.Hidden,
        FileName = DumpToolFullPath,
        Arguments = args,
        RedirectStandardOutput = false
      }
  };
process.Start();
process.WaitForExit();`

@antonfirsov
Copy link
Member

@jongleur1983 great, thanks for the investigation!

Do you want to PR it, or would you rather leave it to us?

@jongleur1983
Copy link
Contributor Author

as you like. I didn't want to change branches yesterday to commit that change on a separate PR, but if nobody else takes this before I'll do a PR within this week, I think.

jongleur1983 added a commit to jongleur1983/ImageSharp that referenced this issue May 7, 2018
antonfirsov added a commit that referenced this issue May 7, 2018
@antonfirsov
Copy link
Member

antonfirsov commented May 7, 2018

Fixed in #561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants