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
Tests fail on Windows due to hard coded directory separators #26
Comments
Hi @nanis. Can you gist a test failure. I'm not seeing any conclusive failures here: http://cpantesters.org/distro/P/Pegex.html |
You would not see them on CPANTesters, because most Windows results are from Strawberry Perl which uses See, for example, http://blog.nu42.com/2014/11/how-can-invalid-assumptions-remain.html http://blog.nu42.com/2014/12/what-is-really-broken.html I am on a different machine right now, so posting test output will have to wait. But, regardless, trying to replace |
Here is the output: t\testml-compiler-checks.t ....... Can't open './testml/compiler-checks.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-compiler-checks.t ....... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t\testml-compiler-equivalence.t .. Can't open './testml/compiler-equivalence.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-compiler-equivalence.t .. Dubious, test returned 2 (wstat 512, 0x200) No subtests run t\testml-compiler.t .............. Can't open './testml/compiler.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-compiler.t .............. Dubious, test returned 2 (wstat 512, 0x200) No subtests run t\testml-error.t ................. Can't open './testml/error.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-error.t ................. Dubious, test returned 2 (wstat 512, 0x200) No subtests run t\testml-optimize.t .............. Can't open './testml/optimize.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-optimize.t .............. Dubious, test returned 2 (wstat 512, 0x200) No subtests run t\testml-tree-pegex.t ............ Can't open './testml/tree-pegex.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-tree-pegex.t ............ Dubious, test returned 2 (wstat 512, 0x200) No subtests run t\testml-tree.t .................. Can't open './testml/tree.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-tree.t .................. Dubious, test returned 2 (wstat 512, 0x200) This happens because when
assigns
results in the subsequent |
Also, I cannot figure out how to submit a pull request because I cannot find the See also ingydotnet/testml-pm#10 |
OK. I have a Win7 vm and looks like I can get compiler tools without cost here: http://www.visualstudio.com/en-US/products/visual-studio-express-vs I'll try to get to this soon. |
@nanis are you using ActivePerl? |
No, I am using With ActivePerl, one would probably use their MinGW package, and get the HTH. |
…ath manipulation
@nanis i have submitted a pull request for this issue. |
- Fix test for windows (issue #26) vicash++ - Share Pegex grammar for Pegex
@nanis, I applied PR/27 and released new version. Please test, and close this if fixed. |
@nanis, Can you test this now that TestML is fixed. I guess you can test installing Inline::C since that requires Pegex. |
Did you release a new Pegex? Because 0.58 from CPAN fails: C:\...> cpanm Pegex --> Working on Pegex Fetching http://www.cpan.org/authors/id/I/IN/INGY/Pegex-0.58.tar.gz ... OK Configuring Pegex-0.58 ... OK Building and testing Pegex-0.58 ... FAIL ! Installing Pegex failed. See C:\...\build.log for details. Retry with --force to force install it. t\sample.t ....................... ok Can't open './testml\compiler-checks.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-compiler-checks.t ....... Dubious, test returned 2 (wstat 512, 0x200) No subtests run Can't open './testml\compiler-equivalence.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-compiler-equivalence.t .. Dubious, test returned 2 (wstat 512, 0x200) No subtests run Can't open './testml\compiler.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-compiler.t .............. Dubious, test returned 2 (wstat 512, 0x200) No subtests run Can't open './testml\error.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-error.t ................. Dubious, test returned 2 (wstat 512, 0x200) No subtests run Can't open './testml\optimize.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-optimize.t .............. Dubious, test returned 2 (wstat 512, 0x200) No subtests run Can't open './testml\tree-pegex.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-tree-pegex.t ............ Dubious, test returned 2 (wstat 512, 0x200) No subtests run Can't open './testml\tree.tml' for input: No such file or directory at inc/TestML/Runtime.pm line 285. t\testml-tree.t .................. Dubious, test returned 2 (wstat 512, 0x200) No subtests run Test Summary Report ------------------- t\testml-compiler-checks.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t\testml-compiler-equivalence.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t\testml-compiler.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t\testml-error.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t\testml-optimize.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t\testml-tree-pegex.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t\testml-tree.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output Files=18, Tests=40, 8 wallclock secs ( 0.17 usr + 0.01 sys = 0.19 CPU) Result: FAIL Failed 7/18 test programs. 0/40 subtests failed. NMAKE : fatal error U1077: 'C:\opt\perl-5.20.1\bin\perl.exe' : return code '0x2' Stop |
Hi @nanis Please give the output of the following command in your Perl. Seems like Here is a one-liner that you can run and show us your output on your Perl. $ perl -MFile::Spec -e 'print File::Spec->catfile(qw{testml This is the exact code we are using in Pegex test so something is off --Vikas |
Hi Vikas: Nothing is off with my You are failing to notice that the The failed regex match is setting the base directory to be
which is where the The fix for this nonsense of using a regex match to extract the directory portion from a file path has finally made it to That's all. |
@nanis, I disagree. We have fixed that issue and Pegex 0.58 has been I just checked by installing Pegex 0.58 explicitly using cpanminus. The So the problem lies in your custom built Perl. Please run the one-liner $ perl -MFile::Spec -e 'print File::Spec->catfile(qw{testml --vikas |
Vikas, you can disagree all you want, except that you are not reading what I am writing, and you are missing the point. The hard-coded directory separator is in the regex pattern used to match the directory portion of a file path in inc/TestML/Runtime.pm $ wget http://search.cpan.org/CPAN/authors/id/I/IN/INGY/Pegex-0.58.tar.gz $ tar -xvf Pegex-0.58.tar.gz ... $ head -n 30 Pegex-0.58/inc/TestML/Runtime.pm package TestML::Runtime; use TestML::Base; has testml => (); has bridge => (); has library => (); has compiler => (); has skip => (); has function => (); has error => (); has global => (); has base => (); sub BUILD { my ($self) = @_; $TestML::Runtime::Singleton = $self; $self->{base} ||= $0 =~ m!(.*)/! ? $1 : "."; } That last line shown above is the root cause of the problem. This is fixed in the TestML distribution, but Pegex from CPAN still includes this stupid thing. You are probably testing with Strawberry Perl. Please read what I am saying before responding. Better yet, please stop responding and fix this if you care at all. |
@nanis, please test Pegex-0.59 and report back. |
Fixed. Thank you very much. C:\> cpanm Pegex --> Working on Pegex Fetching http://www.cpan.org/authors/id/I/IN/INGY/Pegex-0.59.tar.gz ... OK Configuring Pegex-0.59 ... OK Building and testing Pegex-0.59 ... OK Successfully installed Pegex-0.59 (upgraded from 0.58) 1 distribution installed C:\> cpanm-reporter sending: (http://www.cpan.org/authors/id/I/IN/INGY/Pegex-0.59.tar.gz, INGY, Pegex-0.59, PASS) |
In
inc/TestML/Runtime.pm
line 18, you should useFile::Basename::dirname
instead of a regex match.Joining path components using
'/'
instead of usingFile::Spec->catfile
is also unnecessarily unportable, but it does work on Windows.The text was updated successfully, but these errors were encountered: