summaryrefslogtreecommitdiff
path: root/tests/mkshadow
blob: 58280ea64ae2dd9664ddd5f88e7a4aa91513d0ce (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
#
# Simple script to make a "shadow" test directory, using symbolic links.
# Typically you'd put the shadow in /tmp or another local disk
#
# Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
# 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2, or (at your option) any later version.
#
# GNU Make 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# GNU Make; see the file COPYING.  If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

case "$1" in
  "") echo 'Usage: mkshadow <destdir>'; exit 1 ;;
esac

dest="$1"

if [ ! -d "$dest" ]; then
  echo "Destination directory \`$dest' must exist!"
  exit 1
fi

if [ ! -f run_make_tests ]; then
  echo "The current directory doesn't appear to contain the test suite!"
  exit 1
fi

suite=`pwd | sed 's%^/tmp_mnt%%'`
name=`basename "$suite"`

files=`echo *`

set -e

mkdir "$dest/$name"
cd "$dest/$name"

ln -s "$suite" .testdir

for f in $files; do
  ln -s .testdir/$f .
done

rm -rf work

echo "Shadow test suite created in \`$dest/$name'."
exit 0