preaction / Log-Any

Simple, fast Perl logging API compatible with any logging system
Other
13 stars 19 forks source link

t/proxy-with-stack-trace.t tests fail on Windows due to path separator #107

Open shawnlaffan opened 9 months ago

shawnlaffan commented 9 months ago

Tested with Strawberry Perl 5.38.2.2.

One option is to change test regexp to allow for the windows path separator.

(?^:^Help! at t[/\\]proxy-with-stack-trace\.t

Alternately the path separator could be normalised to a forward slash before comparison. s{\\}{/}

Test errors:

t/proxy-with-stack-trace.t .. 1/241
#   Failed test 'default log with Moose::Exception message - message stringifies correctly'
#   at t/proxy-with-stack-trace.t line 358.
#                   'Help! at t\proxy-with-stack-trace.t line 122
#       main::bar('quux') called at t\proxy-with-stack-trace.t line 136
#       main::foo('bar', 'baz') called at t\proxy-with-stack-trace.t line 140
# '
#     doesn't match '(?^:^Help! at t/proxy-with-stack-trace\.t line \d+\n)'

#   Failed test 'proxy log with Moose::Exception message - message stringifies correctly'
#   at t/proxy-with-stack-trace.t line 358.
#                   'Help! at t\proxy-with-stack-trace.t line 122
#       main::bar at t\proxy-with-stack-trace.t line 136
#       main::foo at t\proxy-with-stack-trace.t line 140
# '
#     doesn't match '(?^:^Help! at t/proxy-with-stack-trace\.t line \d+\n)'

#   Failed test 'proxy log show args with Moose::Exception message - message stringifies correctly'
#   at t/proxy-with-stack-trace.t line 358.
#                   'Help! at t\proxy-with-stack-trace.t line 122
#       main::bar('quux') called at t\proxy-with-stack-trace.t line 136
#       main::foo('bar', 'baz') called at t\proxy-with-stack-trace.t line 140
# '
#     doesn't match '(?^:^Help! at t/proxy-with-stack-trace\.t line \d+\n)'

#   Failed test 'default log with Throwable::Error message - message stringifies correctly'
#   at t/proxy-with-stack-trace.t line 358.
#                   'Help!
#
# Trace begun at t\proxy-with-stack-trace.t line 128
# eval {...} at t\proxy-with-stack-trace.t line 128
# main::bar('quux') called at t\proxy-with-stack-trace.t line 136
# main::foo('bar', 'baz') called at t\proxy-with-stack-trace.t line 140
# '
#     doesn't match '(?^:^Help!\n\nTrace begun at t/proxy-with-stack-trace\.t line \d+\n)'

#   Failed test 'proxy log with Throwable::Error message - message stringifies correctly'
#   at t/proxy-with-stack-trace.t line 358.
#                   'Help!
#
# Trace begun at t\proxy-with-stack-trace.t line 128
# eval {...} at t\proxy-with-stack-trace.t line 128
# main::bar at t\proxy-with-stack-trace.t line 136
# main::foo at t\proxy-with-stack-trace.t line 140
# '
#     doesn't match '(?^:^Help!\n\nTrace begun at t/proxy-with-stack-trace\.t line \d+\n)'

#   Failed test 'proxy log show args with Throwable::Error message - message stringifies correctly'
#   at t/proxy-with-stack-trace.t line 358.
#                   'Help!
#
# Trace begun at t\proxy-with-stack-trace.t line 128
# eval {...} at t\proxy-with-stack-trace.t line 128
# main::bar('quux') called at t\proxy-with-stack-trace.t line 136
# main::foo('bar', 'baz') called at t\proxy-with-stack-trace.t line 140
# '
#     doesn't match '(?^:^Help!\n\nTrace begun at t/proxy-with-stack-trace\.t line \d+\n)'
# Looks like you failed 6 tests of 241.
t/proxy-with-stack-trace.t .. Dubious, test returned 6 (wstat 1536, 0x600)
Failed 6/241 subtests
MMNOnZeNet commented 8 months ago

Confirmed when trying to install Log::Any on windows 10 with Strawberry Perl 5.38.2.2 Workaround ? build.log

shawnlaffan commented 8 months ago

Now I look, PR #104 provides fixes that should work.

@MMNOnZeNet - if this is the only failure you are seeing then one option is to skip tests when installing. e.g. cpanm --notests Log::Any.

MMNOnZeNet commented 8 months ago

Thanks to you, Modified proxy-with-stack-trace and it went OK