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 => 4 };
13 use Xapian qw(:standard);
15 ok(1); # If we made it this far, we're ok.
17 #########################
19 my $db_dir = 'testdb';
21 # Delete contents of database dir, if it exists.
22 if (opendir( DB_DIR, $db_dir )) {
23 while( defined( my $file = readdir( DB_DIR ) ) ) {
24 next if $file =~ /^\.+$/;
25 unlink( "$db_dir/$file" ) or die "Could not delete '$db_dir/$file': $!";
30 is( $Xapian::DB_NAMES[Xapian::DB_CREATE], "DB_CREATE" );
33 ok( $database = Xapian::WritableDatabase->new( $db_dir, Xapian::DB_CREATE ) );
34 ok( $database = Xapian::WritableDatabase->new() );