1. 17 1月, 2015 1 次提交
    • J
      t/lib-httpd: switch SANITY check for NOT_ROOT · 1767c517
      Jeff King 提交于
      The SANITY prerequisite is really about whether the
      filesystem will respect the permissions we set, and being
      root is only one part of that. But the httpd tests really
      just care about not being root, as they are trying to avoid
      weirdness in apache (see a1a30111 for details).
      
      Let's switch out SANITY for a new NOT_ROOT prerequisite,
      which will let us tweak SANITY more freely.
      
      We implement NOT_ROOT by checking `id -u`, which is in POSIX
      and seems to be available even on MSYS.  Note that we cannot
      just call this "ROOT" and ask for "!ROOT". The possible
      outcomes are:
      
        1. we know we are root
      
        2. we know we are not root
      
        3. we could not tell, because `id` was not available
      
      We should conservatively treat (3) as "does not have the
      prerequisite", which means that a naive negation would not
      work.
      Helped-by: NKyle J. McKay <mackyle@gmail.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1767c517
  2. 18 12月, 2014 1 次提交
    • J
      read-cache: optionally disallow HFS+ .git variants · a42643aa
      Jeff King 提交于
      The point of disallowing ".git" in the index is that we
      would never want to accidentally overwrite files in the
      repository directory. But this means we need to respect the
      filesystem's idea of when two paths are equal. The prior
      commit added a helper to make such a comparison for HFS+;
      let's use it in verify_path.
      
      We make this check optional for two reasons:
      
        1. It restricts the set of allowable filenames, which is
           unnecessary for people who are not on HFS+. In practice
           this probably doesn't matter, though, as the restricted
           names are rather obscure and almost certainly would
           never come up in practice.
      
        2. It has a minor performance penalty for every path we
           insert into the index.
      
      This patch ties the check to the core.protectHFS config
      option. Though this is expected to be most useful on OS X,
      we allow it to be set everywhere, as HFS+ may be mounted on
      other platforms. The variable does default to on for OS X,
      though.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a42643aa
  3. 14 7月, 2014 1 次提交
  4. 10 6月, 2014 2 次提交
  5. 07 6月, 2014 2 次提交
  6. 24 5月, 2014 1 次提交
  7. 22 3月, 2014 1 次提交
  8. 19 3月, 2014 1 次提交
  9. 25 2月, 2014 1 次提交
  10. 03 1月, 2014 1 次提交
    • J
      t0000: simplify HARNESS_ACTIVE hack · a63c12c9
      Jeff King 提交于
      Commit 517cd55f set HARNESS_ACTIVE unconditionally in
      sub-tests, because that value affects the output of
      "--verbose". t0000 needs stable output from its sub-tests,
      and we may or may not be running under a TAP harness.
      
      That commit made the decision to always set the variable,
      since it has another useful side effect, which is
      suppressing writes to t/test-results by the sub-tests (which
      would just pollute the real results).
      
      Since the last commit, though, the sub-tests have their own
      test-results directories, so this is no longer an issue. We
      can now update a few comments that are no longer accurate
      nor necessary.
      
      We can also revisit the choice of HARNESS_ACTIVE. Since we
      must choose one value for stability, it's probably saner to
      have it off. This means that future patches could test
      things like the test-results writing, or the "--quiet"
      option, which is currently ignored when run under a harness.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a63c12c9
  11. 27 11月, 2013 3 次提交
    • J
      remove #!interpreter line from shell libraries · 11d62145
      Jonathan Nieder 提交于
      In a shell snippet meant to be sourced by other shell scripts, an
      opening #! line does more harm than good.
      
      The harm:
      
       - When the shell library is sourced, the interpreter and options from
         the #! line are not used.  Specifying a particular shell can
         confuse the reader into thinking it is safe for the shell library
         to rely on idiosyncrasies of that shell.
      
       - Using #! instead of a plain comment drops a helpful visual clue
         that this is a shell library and not a self-contained script.
      
       - Tools such as lintian can use a #! line to tell when an
         installation script has failed by forgetting to set a script
         executable.  This check does not work if shell libraries also start
         with a #! line.
      
      The good:
      
       - Text editors notice the #! line and use it for syntax highlighting
         if you try to edit the installed scripts (without ".sh" suffix) in
         place.
      
      The use of the #! for file type detection is not needed because Git's
      shell libraries are meant to be edited in source form (with ".sh"
      suffix).  Replace the opening #! lines with comments.
      
      This involves tweaking the test harness's valgrind support to find
      shell libraries by looking for "# " in the first line instead of "#!"
      (see v1.7.6-rc3~7, 2011-06-17).
      
      Suggested by Russ Allbery through lintian.  Thanks to Jeff King and
      Clemens Buchacher for further analysis.
      
      Tested by searching for non-executable scripts with #! line:
      
      	find . -name .git -prune -o -type f -not -executable |
      	while read file
      	do
      		read line <"$file"
      		case $line in
      		'#!'*)
      			echo "$file"
      			;;
      		esac
      	done
      
      The only remaining scripts found are templates for shell scripts
      (unimplemented.sh, wrap-for-bin.sh) and sample input used in tests
      (t/t4034/perl/{pre,post}).
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      11d62145
    • J
      test: replace shebangs with descriptions in shell libraries · c74c7203
      Jonathan Nieder 提交于
      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: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c74c7203
    • J
      test: make FILEMODE a lazy prereq · b018c735
      Jonathan Nieder 提交于
      This way, test authors don't need to remember to source
      lib-prereq-FILEMODE.sh before using the FILEMODE prereq to guard tests
      that rely on the executable bit being honored when checking out files.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b018c735
  12. 19 11月, 2013 1 次提交
  13. 29 10月, 2013 2 次提交
  14. 23 10月, 2013 2 次提交
  15. 09 9月, 2013 1 次提交
  16. 19 7月, 2013 1 次提交
  17. 08 7月, 2013 1 次提交
  18. 05 7月, 2013 1 次提交
  19. 24 6月, 2013 5 次提交
    • T
      test-lib: support running tests under valgrind in parallel · ad0e6233
      Thomas Rast 提交于
      With the new --valgrind-parallel=<n> option, we support running the
      tests in a single test script under valgrind in parallel using 'n'
      processes.
      
      This really follows the dumbest approach possible, as follows:
      
      * We spawn the test script 'n' times, using a throw-away
        TEST_OUTPUT_DIRECTORY.  Each of the instances is given options that
        ensures that it only runs every n-th test under valgrind, but
        together they cover the entire range.
      
      * We add up the numbers from the individual tests, and provide the
        usual output.
      
      This is really a gross hack at this point, and should be improved.  In
      particular we should keep the actual outputs somewhere more easily
      discoverable, and summarize them to the user.
      
      Nevertheless, this is already workable and gives a speedup of more
      than 2 on a dual-core (hyperthreaded) machine, using n=4.  This is
      expected since the overhead of valgrind is so big (on the order of 20x
      under good conditions, and a large startup overhead at every git
      invocation) that redundantly running the non-valgrind tests in between
      is not that expensive.
      Helped-by: NJeff King <peff@peff.net>
      Signed-off-by: NThomas Rast <trast@inf.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ad0e6233
    • T
      test-lib: allow prefixing a custom string before "ok N" etc. · e939e15d
      Thomas Rast 提交于
      This is not really meant for external use, and thus not documented. It
      allows the next commit to neatly distinguish between sub-tests and the
      main run.
      
      The format is intentionally not valid TAP.  The use in the next commit
      would not result in anything valid either way, and it seems better to
      make it obvious.
      Signed-off-by: NThomas Rast <trast@inf.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e939e15d
    • T
      test-lib: valgrind for only tests matching a pattern · 5dfc368f
      Thomas Rast 提交于
      With the new --valgrind-only=<pattern> option, one can enable
      --valgrind at a per-test granularity, exactly analogous to
      --verbose-only from the previous commit.
      
      The options are wired such that --valgrind implies --verbose (as
      before), but --valgrind-only=<pattern> implies
      --verbose-only=<pattern> unless --verbose is also in effect.
      Signed-off-by: NThomas Rast <trast@inf.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5dfc368f
    • T
      test-lib: verbose mode for only tests matching a pattern · ff09af3f
      Thomas Rast 提交于
      With the new --verbose-only=<pattern> option, one can enable --verbose
      at a per-test granularity.  The pattern is matched against the test
      number, e.g.
      
        ./t0000-basic.sh --verbose-only='2[0-2]'
      
      to see only the full output of test 20-22, while showing the rest in the
      one-liner format.
      
      As suggested by Jeff King, this takes care to wrap the entire
      test_expect_* block, but nothing else, in the verbose toggling.  We
      can use the test_start/end functions from the previous commit for the
      purpose.
      
      This is arguably not *too* useful on its own, but makes the next patch
      easier to follow.
      Helped-by: NJeff King <peff@peff.net>
      Signed-off-by: NThomas Rast <trast@inf.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ff09af3f
    • T
      test-lib: self-test that --verbose works · 517cd55f
      Thomas Rast 提交于
      t0000 contains some light self-tests of test-lib.sh, but --verbose was
      not covered.  Add a test.
      
      The only catch is that the presence of a test harness influences the
      output (specifically, the presence of some empty lines).  So we need
      to unset TEST_HARNESS or set it to a known value.  Leaving it unset
      leads to spurious test failures in the final summary, which come from
      the subtest.  So we always set it.
      Signed-off-by: NThomas Rast <trast@inf.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      517cd55f
  20. 19 6月, 2013 2 次提交
  21. 18 6月, 2013 1 次提交
  22. 30 4月, 2013 1 次提交
    • J
      test output: respect $TEST_OUTPUT_DIRECTORY · 2d14e13c
      John Keeping 提交于
      Most test results go in $TEST_OUTPUT_DIRECTORY, but the output files for
      tests run with --tee or --valgrind just use bare "test-results".
      Changes these so that they do respect $TEST_OUTPUT_DIRECTORY.
      
      As a result of this, the valgrind/analyze.sh script may no longer
      inspect the correct files so it is also updated to respect
      $TEST_OUTPUT_DIRECTORY by adding it to GIT-BUILD-OPTIONS.  This may be a
      regression for people who have TEST_OUTPUT_DIRECTORY in their config.mak
      but want to override it in the environment, but this change merely
      brings it into line with GIT_TEST_OPTS which already cannot be
      overridden if it is specified in config.mak.
      Signed-off-by: NJohn Keeping <john@keeping.me.uk>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2d14e13c
  23. 15 4月, 2013 2 次提交
  24. 12 4月, 2013 1 次提交
  25. 01 4月, 2013 1 次提交
  26. 11 3月, 2013 1 次提交
  27. 27 1月, 2013 1 次提交
    • P
      git p4 test: translate windows paths for cygwin · cfa96496
      Pete Wyckoff 提交于
      Native windows binaries do not understand posix-like
      path mapping offered by cygwin.  Convert paths to native
      using "cygpath --windows" before presenting them to p4d.
      
      This is done using the AltRoots mechanism of p4.  Both the
      posix and windows forms are put in the client specification,
      allowing p4 to find its location by native path even though
      the environment reports a different PWD.
      
      Shell operations in tests will use the normal form of $cli,
      which will look like a posix path in cygwin, while p4 will
      use AltRoots to match against the windows form of the working
      directory.
      
      This mechanism also handles the symlink issue that was fixed in
      23bd0c99 (git p4 test: use real_path to resolve p4 client
      symlinks, 2012-06-27).  Now that every p4 client view has
      an AltRoots with the real_path in it, explicitly calculating
      the real_path elsewhere is not necessary.
      
      Thanks-to: Sebastian Schuberth <sschuberth@gmail.com>
      Thanks-to: Johannes Sixt <j6t@kdbg.org>
      
      fixup! git p4 test: translate windows paths for cygwin
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cfa96496
  28. 16 1月, 2013 1 次提交