#!/usr/bin/env perl
require 5.008;
use warnings;
use strict;

unshift(@INC, '.');
require qpdf_test_helpers;

chdir("qpdf") or die "chdir testdir failed: $!\n";

require TestDriver;

cleanup();

my $td = new TestDriver('c-api-check');

my @c_check_types = qw(warn clear);
my $n_tests = scalar(@c_check_types);

foreach my $i (@c_check_types)
{
    $td->runtest("C check $i",
                 {$td->COMMAND => "qpdf-ctest 23 c-check-$i-in.pdf '' -"},
                 {$td->FILE => "c-check-$i.out",
                      $td->EXIT_STATUS => 0},
                 $td->NORMALIZE_NEWLINES);
}

cleanup();
$td->report($n_tests);
