Skip to content

Instantly share code, notes, and snippets.

@ingydotnet
Created May 24, 2018 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ingydotnet/85ed90bbb17c89387f5c9e5c7d5a6d91 to your computer and use it in GitHub Desktop.
Save ingydotnet/85ed90bbb17c89387f5c9e5c7d5a6d91 to your computer and use it in GitHub Desktop.
 ~/src/TestML/testml master ↑·1|✚2 git diff lib/perl6/TestML/Run.pm
diff --git a/lib/perl6/TestML/Run.pm b/lib/perl6/TestML/Run.pm
index a786957..90d77e5 100644
--- a/lib/perl6/TestML/Run.pm
+++ b/lib/perl6/TestML/Run.pm
@@ -201,8 +201,16 @@ method initialize {
];
if not $!bridge {
- require ::(%*ENV<TESTML_BRIDGE>);
- $!bridge = ::(%*ENV<TESTML_BRIDGE>).new;
+ # Workaround for rakudo#1515. Don't require env var if value is the
+ # default one. Using the env var sometimes spews warnings.
+ if %*ENV<TESTML_BRIDGE> eq 'TestMLBridge' {
+ require TestMLBridge;
+ $!bridge = TestMLBridge.new;
+ }
+ else {
+ require ::(%*ENV<TESTML_BRIDGE>);
+ $!bridge = ::(%*ENV<TESTML_BRIDGE>).new;
+ }
}
if not $!stdlib {
 ~/src/TestML/testml master ↑·1|✚2 make test-perl6-tap test=test/010*
TESTML_RUN=perl6-tap prove -v test/010*
test/010-math.tml .. You cannot create an instance of this type (TestMLBridge)
in block at /Users/ingy/src/TestML/testml/lib/perl6/TestML/Run.pm (TestML::Run) line 208
in method initialize at /Users/ingy/src/TestML/testml/lib/perl6/TestML/Run.pm (TestML::Run) line 203
in method test at /Users/ingy/src/TestML/testml/lib/perl6/TestML/Run.pm (TestML::Run) line 57
in method run at /Users/ingy/src/TestML/testml/lib/perl6/TestML/Run/TAP.pm (TestML::Run::TAP) line 9
in block <unit> at -e line 1
No subtests run
Test Summary Report
-------------------
test/010-math.tml (Wstat: 0 Tests: 0 Failed: 0)
Parse errors: No plan found in TAP output
Files=1, Tests=0, 2 wallclock secs ( 0.02 usr 0.00 sys + 1.90 cusr 0.23 csys = 2.15 CPU)
Result: FAIL
make: *** [test-perl6-tap] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment