Run tests only if a module is available

--00000000000093d4c00577f705e3
Content-Type: text/plain; charset="UTF-8"

Hello,

I wish to run some tests on one module of mine only if there's a certain
third-party module available during installation.
Before I concocted something horrid using try/catch in the INIT phaser, is
there any gentle way to do this?

Thanks!

-- 
Fernando Santagata

--00000000000093d4c00577f705e3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"color:#000000">Hello=
,</div><div class=3D"gmail_default" style=3D"color:#000000"><br></div><div =
class=3D"gmail_default" style=3D"color:#000000">I wish to run some tests on=
 one module of mine only if there&#39;s a certain third-party module availa=
ble during installation.</div><div class=3D"gmail_default" style=3D"color:#=
000000">Before I concocted something horrid using try/catch in the INIT pha=
ser, is there any gentle way to do this?<br clear=3D"all"></div><div><br></=
div><div><div style=3D"color:rgb(0,0,0)" class=3D"gmail_default">Thanks!</d=
iv></div><div><br></div>-- <br><div dir=3D"ltr" class=3D"gmail_signature" d=
ata-smartmail=3D"gmail_signature">Fernando Santagata</div></div>

--00000000000093d4c00577f705e3--
0
nando
10/11/2018 5:08:25 PM
perl.perl6.users 1085 articles. 0 followers. Follow

3 Replies
8 Views

Similar Articles

[PageSpeed] 55

Hi,

So far, the only potential solution for you issue would be Test::When. =
But the needed functionality was declared as 'soon to be implemented' =
and is not there yet. Perhaps, if you convince Zoffix Znet to complete =
it...

> 11 =D0=B6=D0=BE=D0=B2=D1=82. 2018 =D1=80. =D0=BE 13:08 Fernando =
Santagata <nando.santagata@gmail.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=
=D0=B2(=D0=BB=D0=B0):
>=20
> Hello,
>=20
> I wish to run some tests on one module of mine only if there's a =
certain third-party module available during installation.
> Before I concocted something horrid using try/catch in the INIT =
phaser, is there any gentle way to do this?
>=20
> Thanks!
>=20
> --=20
> Fernando Santagata

Best regards,
Vadim Belman
0
vrurg
10/11/2018 9:45:36 PM
--------------B17BF24595A232E1B547389F
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

I'd go with run-time loading and if the module doesn't exist, just
"flunk" or "skip" or what Test.pm6 offers.

Here's a link that explains checking if a module is installed and
loading it if it is:

=C2=A0=C2=A0=C2=A0 https://rakudo.org/post/lexical-require-upgrade-info

Hope that helps!
=C2=A0 - Timo

On 11/10/2018 19:08, Fernando Santagata wrote:
> Hello,
>
> I wish to run some tests on one module of mine only if there's a
> certain third-party module available during installation.
> Before I concocted something horrid using try/catch in the INIT
> phaser, is there any gentle way to do this?
>
> Thanks!
>
> --=20
> Fernando Santagata

--------------B17BF24595A232E1B547389F
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF=
-8">
  </head>
  <body text=3D"#000000" bgcolor=3D"#FFFFFF">
    <p>I'd go with run-time loading and if the module doesn't exist,
      just "flunk" or "skip" or what Test.pm6 offers.</p>
    <p>Here's a link that explains checking if a module is installed and
      loading it if it is:</p>
    <p>=C2=A0=C2=A0=C2=A0 <a class=3D"moz-txt-link-freetext" href=3D"http=
s://rakudo.org/post/lexical-require-upgrade-info">https://rakudo.org/post=
/lexical-require-upgrade-info</a></p>
    <p>Hope that helps!<br>
      =C2=A0 - Timo<br>
    </p>
    <div class=3D"moz-cite-prefix">On 11/10/2018 19:08, Fernando Santagat=
a
      wrote:<br>
    </div>
    <blockquote type=3D"cite"
cite=3D"mid:CAJ+jyGi7Oe0HpOCzio8jLE+aLs8vrcDqaxfC5YbAoJaufP-fyw@mail.gmai=
l.com">
      <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DU=
TF-8">
      <div dir=3D"ltr">
        <div class=3D"gmail_default" style=3D"color:#000000">Hello,</div>
        <div class=3D"gmail_default" style=3D"color:#000000"><br>
        </div>
        <div class=3D"gmail_default" style=3D"color:#000000">I wish to ru=
n
          some tests on one module of mine only if there's a certain
          third-party module available during installation.</div>
        <div class=3D"gmail_default" style=3D"color:#000000">Before I
          concocted something horrid using try/catch in the INIT phaser,
          is there any gentle way to do this?<br clear=3D"all">
        </div>
        <div><br>
        </div>
        <div>
          <div style=3D"color:rgb(0,0,0)" class=3D"gmail_default">Thanks!=
</div>
        </div>
        <div><br>
        </div>
        -- <br>
        <div dir=3D"ltr" class=3D"gmail_signature"
          data-smartmail=3D"gmail_signature">Fernando Santagata</div>
      </div>
    </blockquote>
  </body>
</html>

--------------B17BF24595A232E1B547389F--
0
timo
10/11/2018 11:11:56 PM
--0000000000003c050d057803cbf7
Content-Type: text/plain; charset="UTF-8"

Thank you, it's what I needed!

On Fri, Oct 12, 2018 at 1:12 AM Timo Paulssen <timo@wakelift.de> wrote:

> I'd go with run-time loading and if the module doesn't exist, just "flunk"
> or "skip" or what Test.pm6 offers.
>
> Here's a link that explains checking if a module is installed and loading
> it if it is:
>
>     https://rakudo.org/post/lexical-require-upgrade-info
>
> Hope that helps!
>   - Timo
> On 11/10/2018 19:08, Fernando Santagata wrote:
>
> Hello,
>
> I wish to run some tests on one module of mine only if there's a certain
> third-party module available during installation.
> Before I concocted something horrid using try/catch in the INIT phaser, is
> there any gentle way to do this?
>
> Thanks!
>
> --
> Fernando Santagata
>
>

-- 
Fernando Santagata

--0000000000003c050d057803cbf7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"color:#000000">Thank=
 you, it&#39;s what I needed!<br></div></div><br><div class=3D"gmail_quote"=
><div dir=3D"ltr">On Fri, Oct 12, 2018 at 1:12 AM Timo Paulssen &lt;<a href=
=3D"mailto:timo@wakelift.de">timo@wakelift.de</a>&gt; wrote:<br></div><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex">
 =20
   =20
 =20
  <div text=3D"#000000" bgcolor=3D"#FFFFFF">
    <p>I&#39;d go with run-time loading and if the module doesn&#39;t exist=
,
      just &quot;flunk&quot; or &quot;skip&quot; or what Test.pm6 offers.</=
p>
    <p>Here&#39;s a link that explains checking if a module is installed an=
d
      loading it if it is:</p>
    <p>=C2=A0=C2=A0=C2=A0 <a class=3D"m_-7454001445391158860moz-txt-link-fr=
eetext" href=3D"https://rakudo.org/post/lexical-require-upgrade-info" targe=
t=3D"_blank">https://rakudo.org/post/lexical-require-upgrade-info</a></p>
    <p>Hope that helps!<br>
      =C2=A0 - Timo<br>
    </p>
    <div class=3D"m_-7454001445391158860moz-cite-prefix">On 11/10/2018 19:0=
8, Fernando Santagata
      wrote:<br>
    </div>
    <blockquote type=3D"cite">
     =20
      <div dir=3D"ltr">
        <div class=3D"gmail_default" style=3D"color:#000000">Hello,</div>
        <div class=3D"gmail_default" style=3D"color:#000000"><br>
        </div>
        <div class=3D"gmail_default" style=3D"color:#000000">I wish to run
          some tests on one module of mine only if there&#39;s a certain
          third-party module available during installation.</div>
        <div class=3D"gmail_default" style=3D"color:#000000">Before I
          concocted something horrid using try/catch in the INIT phaser,
          is there any gentle way to do this?<br clear=3D"all">
        </div>
        <div><br>
        </div>
        <div>
          <div style=3D"color:rgb(0,0,0)" class=3D"gmail_default">Thanks!</=
div>
        </div>
        <div><br>
        </div>
        -- <br>
        <div dir=3D"ltr" class=3D"m_-7454001445391158860gmail_signature" da=
ta-smartmail=3D"gmail_signature">Fernando Santagata</div>
      </div>
    </blockquote>
  </div>

</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature" data-smartmail=3D"gmail_signature">Fernando Santagata</div>

--0000000000003c050d057803cbf7--
0
nando
10/12/2018 8:22:40 AM
Reply: