Restructure handling of the test scratch-dir, move all activity
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / backcompat / 0.04006 / 10sqlite_common.t
1 use strict;
2 use lib qw(t/backcompat/0.04006/lib);
3 use dbixcsl_common_tests;
4 use dbixcsl_test_dir qw/$tdir/;
5
6 use Test::More;
7 plan skip_all => 'set SCHEMA_LOADER_TESTS_BACKCOMPAT to enable these tests'
8     unless $ENV{SCHEMA_LOADER_TESTS_BACKCOMPAT};
9
10 eval { require DBD::SQLite };
11 my $class = $@ ? 'SQLite2' : 'SQLite';
12
13 {
14     my $tester = dbixcsl_common_tests->new(
15         vendor          => 'SQLite',
16         auto_inc_pk     => 'INTEGER NOT NULL PRIMARY KEY',
17         dsn             => "dbi:$class:dbname=$tdir/sqlite_test",
18         user            => '',
19         password        => '',
20     );
21
22     $tester->run_tests();
23 }
24
25 END {
26     unlink "$tdir/sqlite_test" if $ENV{SCHEMA_LOADER_TESTS_BACKCOMPAT};
27 }