bliako has asked for the wisdom of the Perl Monks concerning the following question:
I have a test which must fail as it tests passing bogus CFLAGS to Inline::C. e.g.
use Inline C => Config => ccflagsex => '-test-bliako-A', ; ... use Inline C => <<'EOC'; #include <stdio.h> ... EOC
The problem is that passing bogus CFLAGS to use Inline C => Config ... dies and my test fails without getting the chance to recognise that actually the test was passed as the die was expected.
I tried to enclose said codeblock in eval { }; but I see no difference. Test fails.
I find Inline::C using the use Inline C ... impractical and unecessary (perhaps it comes from Inline). So, is there a way to separate use Inline C; from its Config and Code sections? Ideally:
use Inline C; Inline::C::config(...); Inline::C::embed_C_code(... c code ...);
Alternatively, how can I catch the croak's and die's from when use'ing a module with Test::More.
Or perhaps using require ... ?
ps. I also tried to enclose it in a try{}catch{}; with same result: death
bw, bliako
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: catch "use Inline::C" death
by Corion (Patriarch) on Jun 14, 2024 at 10:41 UTC | |
by bliako (Abbot) on Jun 14, 2024 at 11:14 UTC | |
by bliako (Abbot) on Jun 14, 2024 at 23:42 UTC | |
by NERDVANA (Priest) on Jun 17, 2024 at 23:34 UTC | |
by bliako (Abbot) on Jun 20, 2024 at 18:21 UTC | |
|
Re: catch "use Inline::C" death
by hippo (Archbishop) on Jun 14, 2024 at 10:29 UTC | |
by bliako (Abbot) on Jun 14, 2024 at 10:40 UTC | |
|
Re: catch "use Inline::C" death
by syphilis (Archbishop) on Jun 14, 2024 at 10:18 UTC |