File: config-sub.sh

package info (click to toggle)
autotools-dev 20180224.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 352 kB
  • sloc: sh: 2,978; makefile: 51; perl: 20
file content (34 lines) | stat: -rw-r--r-- 805 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# Copyright 2004, 2005, 2009, 2014 Free Software Foundation, Inc.
# Contributed by Ben Elliston <bje@gnu.org>.
#
# This test reads pairs from config-sub.data: an alias and its
# canonical triplet.  config.sub is invoked and the test checks that
# the alias expands to the expected canonical triplet.

verbose=false

run_config_sub()
{
    rc=0
    while read -r alias canonical ; do
	output=$(../config.sub "$alias")
	if test "$output" != "$canonical" ; then
	    echo "FAIL: $alias -> $output, but expected $canonical"
	    rc=1
	else
	    $verbose && echo "PASS: $alias"
	fi
    done < config-sub.data
    return $rc
}

if run_config_sub ; then
    numtests=$(wc -l config-sub.data | cut -d' ' -f1)
    $verbose || echo "PASS: config.sub checks ($numtests tests)"
else
    exit 1
fi

exit 0