Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Synopsis CPAN distribution.

Report information
The Basics
Id: 54731
Status: resolved
Priority: 0/
Queue: Test-Synopsis

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: suggest =for conditionalized synopsis check
Date: Thu, 18 Feb 2010 09:37:55 +1100
To: bug-Test-Synopsis [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
I've got a few modules where the synopsis code will only compile under certain conditions, such as when an optional extra module is available, or when an X windows display is available. As an idea for a feature, it'd be good if there was a way to express the condition in an "=for test_synopsis", so that checking of such modules could be skipped under certain conditions. I thought maybe something like =for test_synopsis BEGIN { if ('some condition') { die 'Test::Synopsis skip: my explanation here' } } and have Test::Synopsis watch for $@ starting like that to do a test skip() thingie, with the explanation, instead of an ok() check. I wondered alternatively if a BEGIN block could do a return() to stop the compile, but that doesn't work and I suppose wouldn't communicate a reason for the skipped test. (Of course files can be skipped in the .t script, but if the condition is in the .pm file it's just one place to maintain and will still work if the .pm is copied around etc.)
This is now implemented. To skip a test, die() within the BEGIN{} block, with sequence "SKIP:" at the start of the die message. Will release to CPAN shortly. -- Cheers, ZZ [ https://metacpan.org/author/ZOFFIX ]
Resolved in version 0.7 which is now on CPAN: https://metacpan.org/release/ZOFFIX/Test-Synopsis-0.07 -- Cheers, ZZ [ https://metacpan.org/author/ZOFFIX ]