Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

tests: move code to run tests under bash into a helper library

The following patch will add tests for the bash prompt functions as a
new test script, which also has to be run under bash.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information...
commit f8891cfa2a16d040d799f281684851fa7b2a0c2b 1 parent a3935e6
Gábor Szeder authored May 09, 2012 gitster committed May 09, 2012
18  t/lib-bash.sh
... ...
@@ -0,0 +1,18 @@
  1
+#!/bin/sh
  2
+#
  3
+# Ensures that tests are run under Bash; primarily intended for running tests
  4
+# of the completion script.
  5
+
  6
+if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then
  7
+	# we are in full-on bash mode
  8
+	true
  9
+elif type bash >/dev/null 2>&1; then
  10
+	# execute in full-on bash mode
  11
+	unset POSIXLY_CORRECT
  12
+	exec bash "$0" "$@"
  13
+else
  14
+	echo '1..0 #SKIP skipping bash completion tests; bash not available'
  15
+	exit 0
  16
+fi
  17
+
  18
+. ./test-lib.sh
14  t/t9902-completion.sh
@@ -3,21 +3,9 @@
3 3
 # Copyright (c) 2012 Felipe Contreras
4 4
 #
5 5
 
6  
-if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then
7  
-	# we are in full-on bash mode
8  
-	true
9  
-elif type bash >/dev/null 2>&1; then
10  
-	# execute in full-on bash mode
11  
-	unset POSIXLY_CORRECT
12  
-	exec bash "$0" "$@"
13  
-else
14  
-	echo '1..0 #SKIP skipping bash completion tests; bash not available'
15  
-	exit 0
16  
-fi
17  
-
18 6
 test_description='test bash completion'
19 7
 
20  
-. ./test-lib.sh
  8
+. ./lib-bash.sh
21 9
 
22 10
 complete ()
23 11
 {

0 notes on commit f8891cf

Please sign in to comment.
Something went wrong with that request. Please try again.