2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-18 10:25:12 +00:00
qpdf/libtests/qtest/logger.test

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-06-05 01:15:40 +00:00
#!/usr/bin/env perl
require 5.008;
use warnings;
use strict;
chdir("logger") or die "chdir testdir failed: $!\n";
require TestDriver;
my $td = new TestDriver('logger');
cleanup();
$td->runtest("logger",
{$td->COMMAND => "logger >stdout 2>stderr"},
{$td->STRING => "", $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
$td->runtest("check stdout",
{$td->FILE => "stdout"},
{$td->FILE => "exp-stdout"},
$td->NORMALIZE_NEWLINES);
$td->runtest("check stderr",
{$td->FILE => "stderr"},
{$td->FILE => "exp-stderr"},
$td->NORMALIZE_NEWLINES);
2022-06-18 17:38:36 +00:00
$td->runtest("logger C API",
{$td->COMMAND => "logger_c >stdout 2>stderr"},
{$td->STRING => "", $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
foreach my $f (qw(stdout stderr info warn error save save2))
{
$td->runtest("check $f (C)",
{$td->FILE => "$f"},
{$td->FILE => "c-exp-$f"},
$td->NORMALIZE_NEWLINES);
}
2022-06-05 01:15:40 +00:00
cleanup();
2022-06-18 17:38:36 +00:00
$td->report(11);
2022-06-05 01:15:40 +00:00
sub cleanup
{
2022-06-18 17:38:36 +00:00
unlink "stdout", "stderr", "info", "warn", "error", "save", "save2";
2022-06-05 01:15:40 +00:00
}