#!/bin/sh
# Test of fmtmsg function family.
# Copyright (C) 2000-2017 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, see
# .
set -e
common_objpfx=$1
test_program_prefix_before_env=$2
run_program_env=$3
test_program_prefix_after_env=$4
objpfx=$5
test_pre="${test_program_prefix_before_env} ${run_program_env}"
test="${test_program_prefix_after_env} ${objpfx}tst-fmtmsg"
out=${objpfx}tst-fmtmsg.out
($test_pre MSGVERB= $test || exit 1;
$test_pre MSGVERB=label $test || exit 1;
$test_pre MSGVERB=severity $test || exit 1;
$test_pre MSGVERB=severity:label $test || exit 1;
$test_pre MSGVERB=text $test || exit 1;
$test_pre MSGVERB=text:label $test || exit 1;
$test_pre MSGVERB=text:severity $test || exit 1;
$test_pre MSGVERB=text:severity:label $test || exit 1;
$test_pre MSGVERB=action $test || exit 1;
$test_pre MSGVERB=action:label $test || exit 1;
$test_pre MSGVERB=action:severity $test || exit 1;
$test_pre MSGVERB=action:severity:label $test || exit 1;
$test_pre MSGVERB=action:text $test || exit 1;
$test_pre MSGVERB=action:text:label $test || exit 1;
$test_pre MSGVERB=action:text:severity $test || exit 1;
$test_pre MSGVERB=action:text:severity:label $test || exit 1;
$test_pre MSGVERB=tag $test || exit 1;
$test_pre MSGVERB=tag:label $test || exit 1;
$test_pre MSGVERB=tag:severity $test || exit 1;
$test_pre MSGVERB=tag:severity:label $test || exit 1;
$test_pre MSGVERB=tag:text $test || exit 1;
$test_pre MSGVERB=tag:text:label $test || exit 1;
$test_pre MSGVERB=tag:text:severity $test || exit 1;
$test_pre MSGVERB=tag:text:severity:label $test || exit 1;
$test_pre MSGVERB=tag:action $test || exit 1;
$test_pre MSGVERB=tag:action:label $test || exit 1;
$test_pre MSGVERB=tag:action:severity $test || exit 1;
$test_pre MSGVERB=tag:action:severity:label $test || exit 1;
$test_pre MSGVERB=tag:action:text $test || exit 1;
$test_pre MSGVERB=tag:action:text:label $test || exit 1;
$test_pre MSGVERB=tag:action:text:severity $test || exit 1;
$test_pre MSGVERB=tag:action:text:severity:label $test || exit 1;) 2> $out
cmp $out <