blob: 07448b66653336413f348b3c549f45e7783a837e [file] [log] [blame]
Nikos Mavrogiannopoulos57d95232019-07-16 15:12:24 +02001#!/bin/sh
2
3# Copyright (C) 2019 Red Hat, Inc.
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18PARSER="${PARSER:-../src/asn1Parser${EXEEXT}}"
19srcdir="${srcdir:-.}"
20TMPFILE=pkix.asn.$$.tmp
21
Nikos Mavrogiannopoulose3c67fc2019-07-27 23:26:50 +020022if ! test -z "${VALGRIND}"; then
23 VALGRIND="${LIBTOOL:-libtool} --mode=execute valgrind --leak-check=full"
24fi
25
26echo "Test: PKIX file generation"
27
28${VALGRIND} ${PARSER} ${srcdir}/pkix.asn -o ${TMPFILE}
Nikos Mavrogiannopoulos57d95232019-07-16 15:12:24 +020029
30if test $? != 0;then
31 echo "Cannot generate C file!"
32 exit 1
33fi
34
Nikos Mavrogiannopoulos61aba9d2019-07-17 21:00:54 +020035diff --strip-trailing-cr ${TMPFILE} ${srcdir}/pkix.asn.out
Nikos Mavrogiannopoulos57d95232019-07-16 15:12:24 +020036
37if test $? != 0;then
38 echo "Generated C file differs!"
39 exit 1
40fi
41
42rm -f ${TMPFILE}
43
44exit 0