-
Notifications
You must be signed in to change notification settings - Fork 29
/
test.sh
executable file
·42 lines (28 loc) · 906 Bytes
/
test.sh
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
#!/bin/bash
# This test script makes a number of assumptions about its environment
# and therefore is not meant to be portable or even to be run from
# outside Autorevision's repository.
# Prep
set -e
export VCS_EXTRA="test"
make tarball
# Configure
testPath="$(cd "$(dirname "$0")"; pwd -P)"
vers="$(./autorevision -fo ./autorevision.cache -s VCS_TAG | sed -e 's:v/::')"
tdir="autorevision-${vers}"
tarball="${tdir}.tgz"
tmpdir="$(mktemp -dqt autorevision)"
# Copy the tarball to a temp directory
cp -a "${tarball}" "${tmpdir}"
cd "${tmpdir}"
# Decompress
tar -xf "${tarball}"
cd "${tdir}"
# Poke it to see it does anything
make clean
# Test out of repo results.
cmp "autorevision.cache" "${testPath}/autorevision.cache"
# Test cache pollution.
cd "${testPath}"
./autorevision.sh -o "./autorevision.cache" -t "swift" -e "TEST"
cmp "autorevision.cache" "${tmpdir}/${tdir}/autorevision.cache"