mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Cmake tests: Adapted BATCH tests to ignore the stored LyX-version
This commit is contained in:
parent
05469a053f
commit
f2f49674be
45
development/batchtests/bin/compare_exported_tex.pl
Normal file
45
development/batchtests/bin/compare_exported_tex.pl
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#! /usr/bin/env perl
|
||||||
|
# -*- mode: perl; -*-
|
||||||
|
|
||||||
|
# This script does a line by line comparison of two tex files. Ignore LyX-version info
|
||||||
|
|
||||||
|
use File::Slurp qw(read_file);
|
||||||
|
|
||||||
|
my $file1_name = shift;
|
||||||
|
my $file2_name = shift;
|
||||||
|
|
||||||
|
my @file1 = read_file($file1_name);
|
||||||
|
my @file2 = read_file($file2_name);
|
||||||
|
chomp @file1;
|
||||||
|
chomp @file2;
|
||||||
|
|
||||||
|
my $line_count = 0;
|
||||||
|
|
||||||
|
|
||||||
|
my @diffs;
|
||||||
|
|
||||||
|
foreach my $file1_line (@file1) {
|
||||||
|
$line_count++;
|
||||||
|
next if ($line_count == 1); # Skip the first line with the version
|
||||||
|
|
||||||
|
my $file2_line = $file2[$line_count-1];
|
||||||
|
|
||||||
|
if ($file1_line ne $file2_line) {
|
||||||
|
push @diffs, {
|
||||||
|
line => $line_count,
|
||||||
|
file1 => $file1_line,
|
||||||
|
file2 => $file2_line,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
my $diff_output = '';
|
||||||
|
foreach $diff (@diffs) {
|
||||||
|
$diff_output .= $diff->{line} . ' - ' . $diff->{file1} . ' | ' . $diff->{file2} . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($diff_output) {
|
||||||
|
die "Differences found!\n$diff_output\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
exit(0);
|
File diff suppressed because it is too large
Load Diff
@ -54,6 +54,8 @@ my %Tests = (
|
|||||||
},
|
},
|
||||||
beamer_test => {
|
beamer_test => {
|
||||||
src_files => ["beamer_test.lyx"],
|
src_files => ["beamer_test.lyx"],
|
||||||
|
check_type => 'custom',
|
||||||
|
check_script => ["$perl","$test_bin/compare_exported_tex.pl"],
|
||||||
check => [["beamer_test.tex", "beamer_test.tex.orig"]],
|
check => [["beamer_test.tex", "beamer_test.tex.orig"]],
|
||||||
commands => ["file-open beamer_test.lyx",
|
commands => ["file-open beamer_test.lyx",
|
||||||
"buffer-begin",
|
"buffer-begin",
|
||||||
@ -69,6 +71,8 @@ my %Tests = (
|
|||||||
workdir => "$data",
|
workdir => "$data",
|
||||||
},
|
},
|
||||||
src_files => ["vcs_info_export.lyx"],
|
src_files => ["vcs_info_export.lyx"],
|
||||||
|
check_type => 'custom',
|
||||||
|
check_script => ["$perl","$test_bin/compare_exported_tex.pl"],
|
||||||
check => [["vcs_info_export.tex", "vcs_info_export.tex.orig"]],
|
check => [["vcs_info_export.tex", "vcs_info_export.tex.orig"]],
|
||||||
command_line => ["-E", "pdflatex", "vcs_info_export.tex", "$data/vcs_info_export.lyx"],
|
command_line => ["-E", "pdflatex", "vcs_info_export.tex", "$data/vcs_info_export.lyx"],
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user