File: 02assert.t

package info (click to toggle)
libextutils-cchecker-perl 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 180 kB
  • sloc: perl: 343; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 463 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl

use v5.14;
use warnings;

use Test2::V0;

use ExtUtils::CChecker;

my $cc = ExtUtils::CChecker->new;

ok( !dies { $cc->assert_compile_run( source => "int main(void) { return 0; }\n", diag => "OK source" ); },
   'Trivial C program'
);

like(
   dies { $cc->assert_compile_run( source => "int foo bar splot\n", diag => "broken source" ); },
   qr/^OS unsupported - broken source$/,
   'Broken C program does not compile and run'
);

done_testing;