-
Notifications
You must be signed in to change notification settings - Fork 1
/
02-use.t
66 lines (49 loc) · 1.21 KB
/
02-use.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use strict;
use warnings;
use Test::More;
#use Config;
use Test::Alien;
use Alien::proj;
alien_ok 'Alien::proj';
# nasty hack
$ENV{LD_LIBRARY_PATH} = Alien::proj->dist_dir . '/lib';
$ENV{DYLD_LIBRARY_PATH} = Alien::proj->dist_dir . '/lib';
diag ('libs: ' . Alien::proj->libs);
diag ('cflags: ' . Alien::proj->cflags);
eval {
diag ('Dynamic libs: ' . join ':', Alien::proj->dynamic_libs);
};
warn $@ if $@;
diag ('bin dir: ' . join (' ', Alien::proj->bin_dir));
my @bin = Alien::proj->bin_dir;
warn "no proj bin dir found via bin_dir method\n" if not @bin;
TODO: {
local $TODO = 'leftover from gdal - might not need to be todo';
#if $^O =~ /darwin|bsd/i;
my $xs = do { local $/; <DATA> };
xs_ok {xs => $xs, verbose => 1}, with_subtest {
my($module) = @_;
ok $module->version;
};
}
done_testing();
__DATA__
// A very simple test. It really only tests that we can load proj4.
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "stdio.h"
#include <proj.h>
int main()
{
printf("Hello, World!");
return 0;
}
const char *
version(const char *class)
{
return "v1";
}
MODULE = TA_MODULE PACKAGE = TA_MODULE
const char *version(class);
const char *class;