Lines 25-32
my @global_files = (
Link Here
|
25 |
); |
25 |
); |
26 |
my $kohastructure = $sample_dir . '/kohastructure.sql'; |
26 |
my $kohastructure = $sample_dir . '/kohastructure.sql'; |
27 |
|
27 |
|
28 |
#for my $lang ( qw ( de-DE en es-ES fr-CA fr-FR it-IT nb-NO pl-PL ru-RU uk-UA ) ) { |
28 |
my $failure = 0; |
29 |
for my $lang ( qw ( it-IT nb-NO ) ) { |
29 |
for my $lang ( qw ( de-DE en es-ES fr-CA fr-FR it-IT nb-NO pl-PL ru-RU uk-UA ) ) { |
30 |
for my $marcflavour ( qw( marc21 unimarc ) ) { |
30 |
for my $marcflavour ( qw( marc21 unimarc ) ) { |
31 |
say "loading kohastructure for $lang | not $marcflavour"; |
31 |
say "loading kohastructure for $lang | not $marcflavour"; |
32 |
recreate_db( $db_name ); |
32 |
recreate_db( $db_name ); |
Lines 37-54
for my $lang ( qw ( it-IT nb-NO ) ) {
Link Here
|
37 |
push @sample_files, $File::Find::name if $_ =~ m|\.sql$|; |
37 |
push @sample_files, $File::Find::name if $_ =~ m|\.sql$|; |
38 |
}, $sample_dir . $lang . '/' |
38 |
}, $sample_dir . $lang . '/' |
39 |
); |
39 |
); |
40 |
@sample_files = ( @global_files, sort @sample_files ); |
40 |
@sample_files = grep { $_ !~ $marcflavour } ( @global_files, sort @sample_files ); |
41 |
my $i = 1; |
41 |
my $i = 1; |
42 |
for my $sql_file ( @sample_files ) { |
42 |
for my $sql_file ( @sample_files ) { |
43 |
print $i++ . "/" . scalar @sample_files . "\r"; flush STDOUT; |
|
|
44 |
next if $sql_file =~ $marcflavour; |
45 |
#my $content = read_file( $sql_file ); |
43 |
#my $content = read_file( $sql_file ); |
46 |
#my @tables = uniq map { $_ =~ s/insert\s*(ignore)?\s*into\s*`?(\w+)`?.*/$2/xmsi; $_ } grep {/insert\s*(ignore)?\s*into/xmsi} split '\n', $content; |
44 |
#my @tables = uniq map { $_ =~ s/insert\s*(ignore)?\s*into\s*`?(\w+)`?.*/$2/xmsi; $_ } grep {/insert\s*(ignore)?\s*into/xmsi} split '\n', $content; |
47 |
my $error = C4::Installer->new->load_sql( $sql_file ); |
45 |
my $error = C4::Installer->new->load_sql( $sql_file ); |
48 |
warn $error if $error; |
46 |
if ($error) { |
|
|
47 |
$failure = 1; |
48 |
fail(sprintf("%s: %s",$sql_file,$error)); |
49 |
} |
50 |
note(sprintf("%02d/%02d: %s",$i,scalar @sample_files,$sql_file)); |
51 |
$i++; |
49 |
} |
52 |
} |
50 |
} |
53 |
} |
51 |
} |
54 |
} |
|
|
55 |
is(0,$failure,"No failures"); |
56 |
done_testing(); |
52 |
|
57 |
|
53 |
sub recreate_db { |
58 |
sub recreate_db { |
54 |
my $dbname = shift; |
59 |
my $dbname = shift; |
55 |
- |
|
|