1. 13 Oct, 2009 4 commits
    • Add the git_oid_to_string() utility function · 960ca1d7
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Ramsay Jones committed
    • Add test-suite coverage testing using gcov · e4553584
      Add a new "coverage" Makefile target that re-builds the
      library and tests using the gcc compiler/linker flags
      required by gcov, runs the test suite to capture the
      runtime data, then compiles a coverage report.
      
      The report, which is saved in a file named "untested",
      consists of a list of untested files, followed by a list
      of untested functions. More detailed execution statistics
      are given in the gcov log files which are saved in the
      top-level directory (named like src#hash.c.gcov).
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Ramsay Jones committed
    • t0101-oid.c: Fix a memory leak reported by valgrind · d2ef83fc
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Ramsay Jones committed
    • Add support for running the tests via valgrind · cac5d927
      Add some makefile targets, which use valgrind's memcheck tool to
      run the tests, in order to help diagnose memory problems in the
      library.
      
      In addition, we enable the '--leak-check' option to report on any
      memory leaks. However, unlike the other memory problems reported
      by memcheck, memory leak reports do not result in an error exit
      from valgrind. (So memory leaks are reported on stderr, but don't
      halt the test run.)
      
      A suppressions file (tests.supp) is included since libz triggers
      some false positives.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Ramsay Jones committed
  2. 16 Jun, 2009 1 commit
    • Add noreturn declaration compatible with the MSVC compiler. · 73c4dd92
      MSVC provides a compiler declaration to declare that a function
      never returns. This declaration is required in front of the
      function definition rather than at the end, but fortunately gcc
      is compatible with this location as well.
      
      Explicit returns are no longer required after calls to test_die.
      
      Signed-off-by: Julio Espinoza-Sokal <julioes@gmail.com>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Julio Espinoza-Sokal committed
  3. 05 Jun, 2009 4 commits
  4. 30 Mar, 2009 2 commits
  5. 18 Mar, 2009 2 commits
  6. 11 Feb, 2009 1 commit
  7. 28 Jan, 2009 2 commits
  8. 31 Dec, 2008 5 commits
    • Rewrite git_foreach_dirent into gitfo_dirent · 5690f02e
      Our fileops API is currently private.  We aren't planning on supplying
      a cross-platform file API to applications that link to us.  If we did,
      we'd probably whole-sale publish fileops, not just the dirent code.
      
      By moving it to be private we can also change the call signature to
      permit the buffer to be passed down through the call chain.  This is
      very helpful when we are doing a recursive scan as we can reuse just
      one buffer in all stack frames, reducing the impact the recursion has
      on the stack frames in the data cache.
      
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Shawn O. Pearce committed
    • Add string utility functions for prefix and suffix compares · 9eb79764
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Shawn O. Pearce committed
    • Add a mutex and atomic counter abstraction and implementations · 028ef0de
      These abstractions can be used to implement an efficient resource
      reference counter and simple mutual exclusion.  On pthreads we use
      pthread_mutex_t, except when we are also on glibc and can directly
      use its asm/atomic.h definitions.
      
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Shawn O. Pearce committed
    • Rename the test cases to run in specific orders · 4260699b
      This way we can be fairly certain we run tests of lower-level
      parts of the library before we run tests of higher-level more
      complex parts.  If there is any problem in a lower-level part
      of the library, the earlier test will identify it and stop,
      making it easire to troubleshoot the failure.
      
      A rough naming guide has been added for the test suite to
      explain the current category structure.
      
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Shawn O. Pearce committed
    • Support building on Mac OS X by using pthread_getspecific for TLS · a1d34bc0
      The Mach-O format does not permit gcc to implement the __thread
      TLS specification, so we must instead emulate it using a single
      int cell allocated from memory and stored inside of the thread
      specific data associated with the current pthread.
      
      What makes this tricky is git_errno must be a valid lvalue, so
      we really need to return a pointer to the caller and deference it
      as part of the git_errno macro.
      
      The GCC-specific __attribute__((constructor)) extension is used
      to ensure the pthread_key_t is allocated before any Git functions
      are executed in the library, as this is necessary to access our
      thread specific storage.
      
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Shawn O. Pearce committed
  9. 30 Dec, 2008 2 commits
  10. 19 Dec, 2008 1 commit
  11. 10 Dec, 2008 1 commit
  12. 02 Dec, 2008 1 commit
  13. 04 Nov, 2008 5 commits
  14. 02 Nov, 2008 1 commit