Move Sharness config checks into test-sharness-config.sh
This way we can easily reuse the checks in test-sharness-config.sh.
Christian Couder committed
Oct 25, 2014 at 11:54 UTC
1fb419264280637fdf4c8542d355cc3712196dde
2 files changed
+24
-17
test/test-lib.sh
+1
-17
@@ -6,23 +6,7 @@
6
# We are using sharness (https://github.com/mlafeldt/sharness)
7
# which was extracted from the Git test framework.
8
9
-# You need either sharness to be installed system-wide
10
-# or to set SHARNESS_DIRECTORY properly
11
-
12
-if test -z "$SHARNESS_DIRECTORY"
13
-then
14
- SHARNESS_DIRECTORY=/usr/local/share/sharness
15
-fi
16
-
17
-SHARNESS_LIB="$SHARNESS_DIRECTORY/sharness.sh"
18
-
19
-test -f "$SHARNESS_LIB" || {
20
- echo >&2 "Cannot find sharness.sh in: $SHARNESS_DIRECTORY"
21
- echo >&2 "Please install Sharness system-wide or set the"
22
- echo >&2 "SHARNESS_DIRECTORY environment variable."
23
- echo >&2 "See: https://github.com/mlafeldt/sharness"
24
- exit 1
25
-}
9
+. ./test-sharness-config.sh
10
11
. "$SHARNESS_LIB" || {
12
echo >&2 "Cannot source: $SHARNESS_LIB"
test/test-sharness-config.sh
new
+23
@@ -0,0 +1,23 @@
1
+# Copyright (c) 2014 Christian Couder
2
+# MIT Licensed; see the LICENSE file in this repository.
3
+#
4
+# We are using sharness (https://github.com/mlafeldt/sharness)
5
+# which was extracted from the Git test framework.
6
+
7
+# You need either sharness to be installed system-wide or
8
+# to set the SHARNESS_DIRECTORY environment variable properly.
9
+
10
+if test -z "$SHARNESS_DIRECTORY"
11
+then
12
+ SHARNESS_DIRECTORY=/usr/local/share/sharness
13
+fi
14
+
15
+SHARNESS_LIB="$SHARNESS_DIRECTORY/sharness.sh"
16
+
17
+test -f "$SHARNESS_LIB" || {
18
+ echo >&2 "Cannot find sharness.sh in: $SHARNESS_DIRECTORY"
19
+ echo >&2 "Please install Sharness system-wide or set the"
20
+ echo >&2 "SHARNESS_DIRECTORY environment variable."
21
+ echo >&2 "See: https://github.com/mlafeldt/sharness"
22
+ exit 1
23
+}