From 17cc553da9ff04c1bf992c751a08feec8bd335a9 Mon Sep 17 00:00:00 2001 From: Alexandr Ciornii Date: Mon, 14 Nov 2016 17:05:28 +0200 Subject: [PATCH 1/2] error in system modifies $? which in END block modifies exit value of program --- test/pegex-parser.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pegex-parser.t b/test/pegex-parser.t index 28e15cf..531ccb4 100644 --- a/test/pegex-parser.t +++ b/test/pegex-parser.t @@ -7,7 +7,7 @@ use IO::All; use YAML::XS; BEGIN { system "rm _Inline* -fr" } -END { system "rm _Inline* -fr" } +END { local $?; system "rm _Inline* -fr" } use Inline C => <<'END', USING => '::Parser::Pegex'; SV* JAxH(char* x) { From 8eac3a7ff671299572d7f0b655f7ffe693be5a40 Mon Sep 17 00:00:00 2001 From: Alexandr Ciornii Date: Mon, 14 Nov 2016 17:07:55 +0200 Subject: [PATCH 2/2] if test is skipped, BEGIN and END blocks are still executed and print warnings in case rm is not available --- test/pegex-parser.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/pegex-parser.t b/test/pegex-parser.t index 531ccb4..6266dec 100644 --- a/test/pegex-parser.t +++ b/test/pegex-parser.t @@ -6,8 +6,9 @@ plan tests => 2; use IO::All; use YAML::XS; -BEGIN { system "rm _Inline* -fr" } -END { local $?; system "rm _Inline* -fr" } +#even if test is skipped, BEGIN and END blocks are executed and print warnings in case rm is not available +BEGIN { if (defined $ENV{PERL_INLINE_DEVELOPER_TEST}) { system "rm _Inline* -fr" } } +END { if (defined $ENV{PERL_INLINE_DEVELOPER_TEST}) { local $?; system "rm _Inline* -fr" } } use Inline C => <<'END', USING => '::Parser::Pegex'; SV* JAxH(char* x) {