4 # lyx_batch.pl testname
11 my $builddir = "@CMAKE_BINARY_DIR@";
12 my $userdir = "$builddir/Testing/.lyx";
13 my $workdir = "$builddir/autotests/out-home";
15 my $vsuffix = "@PROGRAM_SUFFIX@";
16 my $lyx_exe = "$builddir/bin/lyx$vsuffix";
18 my $lyxsource = "@LYX_ABS_TOP_SRCDIR@";
19 my $data = "$lyxsource/development/batchtests";
23 create => "beamer_test.tex",
24 commands => ["file-open beamer_test.lyx",
26 "repeat 150 outline-down",
27 "repeat 150 outline-up",
28 "buffer-export pdflatex",
29 "repeat 150 outline-down",
35 exit(1) if (! defined($ARGV[0]));
37 exit(2) if (! defined($Tests{$test}));
39 my $orig_lyx = "$data/$test.lyx";
40 my $work_lyx = "$workdir/$test.lyx";
41 my $expected = "$data/$test.tex.orig";
42 my $created = "$workdir/$Tests{$test}->{create}";
44 die("File \"$expected\" does not exist") if (! -e $expected);
45 # Create lyx-file to work with
46 copy($orig_lyx, $work_lyx) or die("Copy failed: $!");
50 $ENV{LANGUAGE} = "en_US";
53 system($lyx_exe, "-userdir", $userdir, "-x", "command-sequence " . join(';', @{$Tests{$test}->{commands}}));
54 die("Expected and created files differ") if (compare($expected, $created) != 0);