]> granicus.if.org Git - git/commitdiff
test: replace shebangs with descriptions in shell libraries
authorJonathan Nieder <jrnieder@gmail.com>
Mon, 25 Nov 2013 21:03:06 +0000 (13:03 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Nov 2013 22:23:52 +0000 (14:23 -0800)
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>
15 files changed:
t/gitweb-lib.sh
t/lib-bash.sh
t/lib-cvs.sh
t/lib-diff-alternative.sh
t/lib-gettext.sh
t/lib-git-daemon.sh
t/lib-httpd.sh
t/lib-pack.sh
t/lib-pager.sh
t/lib-read-tree.sh
t/lib-rebase.sh
t/lib-terminal.sh
t/perf/perf-lib.sh
t/test-lib-functions.sh
t/test-lib.sh

index 8cf909a6c5521729b24064c8273209ec2338d29c..d5dab5a94f1d881b8b103f6290ba91e4ec596ec6 100644 (file)
@@ -1,4 +1,5 @@
-#!/bin/sh
+# Initialization and helpers for Gitweb tests, which source this
+# shell library instead of test-lib.sh.
 #
 # Copyright (c) 2007 Jakub Narebski
 #
index 11397f747b9658146a133f5fa65923cc4edfb11f..2be955fafba60e9dbf30a3ab7f0bc1dfae270140 100644 (file)
@@ -1,7 +1,6 @@
-#!/bin/sh
-#
-# Ensures that tests are run under Bash; primarily intended for running tests
-# of the completion script.
+# Shell library sourced instead of ./test-lib.sh by tests that need
+# to run under Bash; primarily intended for tests of the completion
+# script.
 
 if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then
        # we are in full-on bash mode
index 44263ade2533b848220c234441ab67813ca2b0b4..5076718916388d6abf483220cd35f9f61394abc4 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+# Shell library sourced instead of ./test-lib.sh by cvsimport tests.
 
 . ./test-lib.sh
 
index 75ffd9174fbfb7fc6b14d4777f6613d9f052d64f..8b4dbf22d2d140bef7ca0e106a389cb0ca1d4681 100644 (file)
@@ -1,4 +1,5 @@
-#!/bin/sh
+# Helpers shared by the test scripts for diff algorithms (patience,
+# histogram, etc).
 
 test_diff_frobnitz() {
        cat >file1 <<\EOF
index ae8883a07514c47b0568c9323698e879b38703e5..eec757f104708df3a00935cef89dd7dad537afb9 100644 (file)
@@ -1,4 +1,5 @@
-#!/bin/sh
+# Initialization and Icelandic locale for basic git i18n tests,
+# which source this scriptlet instead of ./test-lib.sh.
 #
 # Copyright (c) 2010 Ævar Arnfjörð Bjarmason
 #
index 87f0ad8f4182b13903b9649308e36e34a6122494..394b06b32f838463221e9c2f49380fd9eb08bb9d 100644 (file)
@@ -1,4 +1,20 @@
-#!/bin/sh
+# Shell library to run git-daemon in tests.  Ends the test early if
+# GIT_TEST_GIT_DAEMON is not set.
+#
+# Usage:
+#
+#      . ./test-lib.sh
+#      . "$TEST_DIRECTORY"/lib-git-daemon.sh
+#      start_git_daemon
+#
+#      test_expect_success '...' '
+#              ...
+#      '
+#
+#      test_expect_success ...
+#
+#      stop_git_daemon
+#      test_done
 
 if test -z "$GIT_TEST_GIT_DAEMON"
 then
index ad8f1ef71efcd7e449d2cad8edd3cf80c98ca188..c4707843c4ca5d91d34c86185b3b16bd37d27e36 100644 (file)
@@ -1,4 +1,31 @@
-#!/bin/sh
+# Shell library to run an HTTP server for use in tests.
+# Ends the test early if httpd tests should not be run,
+# for example because the user has not enabled them.
+#
+# Usage:
+#
+#      . ./test-lib.sh
+#      . "$TEST_DIRECTORY"/lib-httpd.sh
+#      start_httpd
+#
+#      test_expect_success '...' '
+#              ...
+#      '
+#
+#      test_expect_success ...
+#
+#      stop_httpd
+#      test_done
+#
+# Can be configured using the following variables.
+#
+#    GIT_TEST_HTTPD              enable HTTPD tests
+#    LIB_HTTPD_PATH              web server path
+#    LIB_HTTPD_MODULE_PATH       web server modules path
+#    LIB_HTTPD_PORT              listening port
+#    LIB_HTTPD_DAV               enable DAV
+#    LIB_HTTPD_SVN               enable SVN
+#    LIB_HTTPD_SSL               enable SSL
 #
 # Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>
 #
index b96e1254dd36821b4a390726c7aefb5286c243f3..75098465716512a3373e64d51a5cdf848e9f1101 100644 (file)
@@ -1,5 +1,3 @@
-#!/bin/sh
-#
 # Support routines for hand-crafting weird or malicious packs.
 #
 # You can make a complete pack like:
index ba03eab14fc29934f095673fa82af658b06bf865..3aa7a3ffd8b0103752987872c84e75ea2b299b9e 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+# Helpers for tests of git's choice of pager.
 
 test_expect_success 'determine default pager' '
        test_might_fail git config --unset core.pager &&
index abc2c6f57fe29d124455227a16e241c49ae40c5c..6442ae337590956bdde988ff51f596909ba8159a 100644 (file)
@@ -1,5 +1,3 @@
-#!/bin/sh
-#
 # Helper functions to check if read-tree would succeed/fail as expected with
 # and without the dry-run option. They also test that the dry-run does not
 # write the index and that together with -u it doesn't touch the work tree.
index 8ff87fb3f9bee1c6955f84b66027037100ebbbd3..6bd252212a7eb901dded2a460eebe92aa3b6212b 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+# Helper functions used by interactive rebase tests.
 
 # After setting the fake editor with this function, you can
 #
index 737df289a1450b80aed58b52a59cf00eb2d77da3..9a2dca506a8d6c15f52e6ded3aa22a0f08f507a1 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+# Helpers for terminal output tests.
 
 test_expect_success PERL 'set up terminal for tests' '
        # Reading from the pty master seems to get stuck _sometimes_
index f4eecaa17110c2974cfdedab90db4604b6923443..a8c9574291b87d9bb1906a9d61faa9b157178b76 100644 (file)
@@ -1,4 +1,6 @@
-#!/bin/sh
+# Performance testing framework.  Each perf script starts much like
+# a normal test script, except it sources this library instead of
+# test-lib.sh.  See t/perf/README for documentation.
 #
 # Copyright (c) 2011 Thomas Rast
 #
index 2f79146e6ce0c5df32845f7c9c0927cea133ad5f..aeae3ca7699b4c828f8ebe50624b5179fb5098b8 100644 (file)
@@ -1,4 +1,5 @@
-#!/bin/sh
+# Library of functions shared by all tests scripts, included by
+# test-lib.sh.
 #
 # Copyright (c) 2005 Junio C Hamano
 #
index 596815704a0a10f5de11bb88d15927e6136fe43c..c306bd0668f1a58c0986f5fede278447b1ab5b88 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+# Test framework for git.  See t/README for usage.
 #
 # Copyright (c) 2005 Junio C Hamano
 #