test: replace shebangs with descriptions in shell libraries
A #! line in these files is misleading, since these scriptlets are meant to be sourced with '.' (using whatever shell sources them) instead of run directly using the interpreter named on the #! line. Removing the #! line shouldn't hurt syntax highlighting since these files have filenames ending with '.sh'. For documentation, add a brief description of how the files are meant to be used in place of the shebang line. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Nov 25, 2013 at 13:03 UTC
c74c72034f061d1d9d5b8b1fba20ce0138d423b4
15 files changed
+64
-20
t/gitweb-lib.sh
+2
-1
@@ -1,4 +1,5 @@
1
-#!/bin/sh
1
+# Initialization and helpers for Gitweb tests, which source this
2
+# shell library instead of test-lib.sh.
3
#
4
# Copyright (c) 2007 Jakub Narebski
5
#
t/lib-bash.sh
+3
-4
@@ -1,7 +1,6 @@
1
-#!/bin/sh
2
-#
3
-# Ensures that tests are run under Bash; primarily intended for running tests
4
-# of the completion script.
1
+# Shell library sourced instead of ./test-lib.sh by tests that need
2
+# to run under Bash; primarily intended for tests of the completion
3
+# script.
4
5
if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then
6
# we are in full-on bash mode
t/lib-cvs.sh
+1
-1
@@ -1,4 +1,4 @@
1
-#!/bin/sh
1
+# Shell library sourced instead of ./test-lib.sh by cvsimport tests.
2
3
. ./test-lib.sh
4
t/lib-diff-alternative.sh
+2
-1
@@ -1,4 +1,5 @@
1
-#!/bin/sh
1
+# Helpers shared by the test scripts for diff algorithms (patience,
2
+# histogram, etc).
3
4
test_diff_frobnitz() {
5
cat >file1 <<\EOF
t/lib-gettext.sh
+2
-1
@@ -1,4 +1,5 @@
1
-#!/bin/sh
1
+# Initialization and Icelandic locale for basic git i18n tests,
2
+# which source this scriptlet instead of ./test-lib.sh.
3
#
4
# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
5
#
t/lib-git-daemon.sh
+17
-1
@@ -1,4 +1,20 @@
1
-#!/bin/sh
1
+# Shell library to run git-daemon in tests. Ends the test early if
2
+# GIT_TEST_GIT_DAEMON is not set.
3
+#
4
+# Usage:
5
+#
6
+# . ./test-lib.sh
7
+# . "$TEST_DIRECTORY"/lib-git-daemon.sh
8
+# start_git_daemon
9
+#
10
+# test_expect_success '...' '
11
+# ...
12
+# '
13
+#
14
+# test_expect_success ...
15
+#
16
+# stop_git_daemon
17
+# test_done
18
19
if test -z "$GIT_TEST_GIT_DAEMON"
20
then
t/lib-httpd.sh
+28
-1
@@ -1,4 +1,31 @@
1
-#!/bin/sh
1
+# Shell library to run an HTTP server for use in tests.
2
+# Ends the test early if httpd tests should not be run,
3
+# for example because the user has not enabled them.
4
+#
5
+# Usage:
6
+#
7
+# . ./test-lib.sh
8
+# . "$TEST_DIRECTORY"/lib-httpd.sh
9
+# start_httpd
10
+#
11
+# test_expect_success '...' '
12
+# ...
13
+# '
14
+#
15
+# test_expect_success ...
16
+#
17
+# stop_httpd
18
+# test_done
19
+#
20
+# Can be configured using the following variables.
21
+#
22
+# GIT_TEST_HTTPD enable HTTPD tests
23
+# LIB_HTTPD_PATH web server path
24
+# LIB_HTTPD_MODULE_PATH web server modules path
25
+# LIB_HTTPD_PORT listening port
26
+# LIB_HTTPD_DAV enable DAV
27
+# LIB_HTTPD_SVN enable SVN
28
+# LIB_HTTPD_SSL enable SSL
29
#
30
# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>
31
#
t/lib-pack.sh
-2
@@ -1,5 +1,3 @@
1
-#!/bin/sh
2
-#
1
# Support routines for hand-crafting weird or malicious packs.
2
#
3
# You can make a complete pack like:
t/lib-pager.sh
+1
-1
@@ -1,4 +1,4 @@
1
-#!/bin/sh
1
+# Helpers for tests of git's choice of pager.
2
3
test_expect_success 'determine default pager' '
4
test_might_fail git config --unset core.pager &&
t/lib-read-tree.sh
-2
@@ -1,5 +1,3 @@
1
-#!/bin/sh
2
-#
1
# Helper functions to check if read-tree would succeed/fail as expected with
2
# and without the dry-run option. They also test that the dry-run does not
3
# write the index and that together with -u it doesn't touch the work tree.
t/lib-rebase.sh
+1
-1
@@ -1,4 +1,4 @@
1
-#!/bin/sh
1
+# Helper functions used by interactive rebase tests.
2
3
# After setting the fake editor with this function, you can
4
#
t/lib-terminal.sh
+1
-1
@@ -1,4 +1,4 @@
1
-#!/bin/sh
1
+# Helpers for terminal output tests.
2
3
test_expect_success PERL 'set up terminal for tests' '
4
# Reading from the pty master seems to get stuck _sometimes_
t/perf/perf-lib.sh
+3
-1
@@ -1,4 +1,6 @@
1
-#!/bin/sh
1
+# Performance testing framework. Each perf script starts much like
2
+# a normal test script, except it sources this library instead of
3
+# test-lib.sh. See t/perf/README for documentation.
4
#
5
# Copyright (c) 2011 Thomas Rast
6
#
t/test-lib-functions.sh
+2
-1
@@ -1,4 +1,5 @@
1
-#!/bin/sh
1
+# Library of functions shared by all tests scripts, included by
2
+# test-lib.sh.
3
#
4
# Copyright (c) 2005 Junio C Hamano
5
#
t/test-lib.sh
+1
-1
@@ -1,4 +1,4 @@
1
-#!/bin/sh
1
+# Test framework for git. See t/README for usage.
2
#
3
# Copyright (c) 2005 Junio C Hamano
4
#