|
Packit |
26a39e |
#!/bin/sh
|
|
Packit |
26a39e |
#
|
|
Packit |
26a39e |
# Simple script to make a "shadow" test directory, using symbolic links.
|
|
Packit |
26a39e |
# Typically you'd put the shadow in /tmp or another local disk
|
|
Packit |
26a39e |
#
|
|
Packit |
26a39e |
# Copyright (C) 1992-2016 Free Software Foundation, Inc.
|
|
Packit |
26a39e |
# This file is part of GNU Make.
|
|
Packit |
26a39e |
#
|
|
Packit |
26a39e |
# GNU Make is free software; you can redistribute it and/or modify it under
|
|
Packit |
26a39e |
# the terms of the GNU General Public License as published by the Free Software
|
|
Packit |
26a39e |
# Foundation; either version 3 of the License, or (at your option) any later
|
|
Packit |
26a39e |
# version.
|
|
Packit |
26a39e |
#
|
|
Packit |
26a39e |
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
Packit |
26a39e |
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
Packit |
26a39e |
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
Packit |
26a39e |
# details.
|
|
Packit |
26a39e |
#
|
|
Packit |
26a39e |
# You should have received a copy of the GNU General Public License along with
|
|
Packit |
26a39e |
# this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
case "$1" in
|
|
Packit |
26a39e |
"") echo 'Usage: mkshadow <destdir>'; exit 1 ;;
|
|
Packit |
26a39e |
esac
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
dest="$1"
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
if [ ! -d "$dest" ]; then
|
|
Packit |
26a39e |
echo "Destination directory '$dest' must exist!"
|
|
Packit |
26a39e |
exit 1
|
|
Packit |
26a39e |
fi
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
if [ ! -f run_make_tests ]; then
|
|
Packit |
26a39e |
echo "The current directory doesn't appear to contain the test suite!"
|
|
Packit |
26a39e |
exit 1
|
|
Packit |
26a39e |
fi
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
suite=`pwd | sed 's%^/tmp_mnt%%'`
|
|
Packit |
26a39e |
name=`basename "$suite"`
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
files=`echo *`
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
set -e
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
mkdir "$dest/$name"
|
|
Packit |
26a39e |
cd "$dest/$name"
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
ln -s "$suite" .testdir
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
for f in $files; do
|
|
Packit |
26a39e |
ln -s .testdir/$f .
|
|
Packit |
26a39e |
done
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
rm -rf work
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
echo "Shadow test suite created in '$dest/$name'."
|
|
Packit |
26a39e |
exit 0
|