-
-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Bugfix/windows bin #195
Bugfix/windows bin #195
Conversation
Due to limitations of PHP, it's impossible to read from STDIN without blocking. If STDIN is empty, no help will be shown - it'll just hang on us.
eb1fade
to
494cf58
Compare
Of course I just realized the stdin tests are going to fail on Windows. Let me see how I can best disable those. |
Alright, that test should be skipped now :) |
It no longer hangs when you run it with no STDIN (or with any STDIN for that matter). However... Tests are failing still. A little debugging suggests it's because of this method below - there is no actual .bat file in the bin folder so it's returning false. protected function getPathToCommonmark()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
return realpath(__DIR__ . '/../../bin/commonmark.bat');
}
return realpath(__DIR__ . '/../../bin/commonmark');
} |
Hmm... according to the Composer documentation, a corresponding |
My understanding of that documentation is that composer would only create the I'll just test that theory now... |
Confimed: C:\inetpub\test>composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing league/commonmark (dev-bugfix/windows-bin 4af8bfa)
Cloning 4af8bfaacd198f008fc3954e368a09f2849c1298
Writing lock file
Generating autoload files
C:\inetpub\test>ls
composer.json composer.lock vendor
C:\inetpub\test>cd vendor/bin
C:\inetpub\test\vendor\bin>ls
commonmark commonmark.bat If you change the 1) League\CommonMark\Tests\Functional\BinTest::testNoArgsOrStdin
Failed asserting that 'Failed without error message: php C:\inetpub\commonmark\bin\commonmark' contains "Usage:".
C:\inetpub\commonmark\tests\functional\BinTest.php:19
2) League\CommonMark\Tests\Functional\BinTest::testUnknownOption
Failed asserting that 'Failed without error message: php C:\inetpub\commonmark\bin\commonmark --foo' contains "Unknown option".
C:\inetpub\commonmark\tests\functional\BinTest.php:58 This appears to be because the Some tests in |
2067089
to
33e488e
Compare
@garethellis36 Thank you for the detailed feedback! I have corrected the remaining issues and also added automated Windows testing via AppVeyor to ensure everything works properly. |
Fix Windows binary bug and failing tests
Fixes #189