2 # Before 'make install' is performed this script should be runnable with
3 # 'make test'. After 'make install' it should work as 'perl test.pl'
5 #########################
9 BEGIN {$SIG{__WARN__} = sub { die "Terminating test due to warning: $_[0]" } };
12 BEGIN { plan tests => 3 };
14 my ($srcdir) = ($0 =~ m!(.*/)!);
15 chdir("${srcdir}symbol-test") or die $!;
17 system($^X, "Makefile.PL") == 0 or die $!;
20 # Building this module can fail for reasons such as Perl being built with a
21 # different compiler with incompatible flags. So treat this build failing
22 # as a reason to skip to avoid test failures in such cases.
23 system("make 2>&1") == 0 or skip "Failed to build symbol-test module", 3;
26 "blib/arch/auto/SymbolTest",
27 "blib/arch/auto/SymbolTest/.libs",
28 "blib/arch/auto/SymbolTest/_libs",
33 eval { SymbolTest::throw_from_libxapian() };
34 like( $@, qr/DatabaseOpeningError caught in SymbolTest/, 'Correct exception caught');
36 use Xapian qw( :all );
38 eval { SymbolTest::throw_from_libxapian() };
39 like( $@, qr/DatabaseOpeningError caught in SymbolTest/, 'Correct exception caught');