1. 26 Oct, 2018 2 commits
    • tests: simplify cmake test configuration · 5c4b7472
      Simplify the names for the tests, removing the unnecessary
      "libgit2-clar" prefix.  Make "all" the new default test run, and include
      the online tests by default (since HTTPS should always be enabled).
      
      For the CI tests, create an offline-only test, then the various online
      tests.
      
      (cherry picked from commit ce798b25)
      Patrick Steinhardt committed
    • tests: create new test target for all SSH-based tests · 637412cc
      Some tests shall be run against our own SSH server we spin up in Travis.
      As those need to be run separate from our previous tests which run
      against git-daemon, we have to do this in a separate step. Instead of
      bundling all that knowledge in the CI script, move it into the test
      build instructions by creating a new test target.
      
      (cherry picked from commit 5874e151)
      Patrick Steinhardt committed
  2. 19 Oct, 2018 3 commits
    • tests: online::clone: inline creds-test with nonexistent URL · 2362ce6c
      Right now, we test our credential callback code twice, once via SSH on
      localhost and once via a non-existent GitHub repository. While the first
      URL makes sense to be configurable, it does not make sense to hard-code
      the non-existing repository, which requires us to call tests multiple
      times. Instead, we can just inline the URL into another set of tests.
      
      (cherry picked from commit 54a1bf05)
      Patrick Steinhardt committed
    • tests: online::clone: construct credential-URL from environment · a1a495f2
      We support two types of passing credentials to the proxy, either via the
      URL or explicitly by specifying user and password. We test these types
      by modifying the proxy URL and executing the tests twice, which is
      in fact unnecessary and requires us to maintain the list of environment
      variables and test executions across multiple CI infrastructures.
      
      To fix the situation, we can just always pass the host, port, user and
      password to the tests. The tests can then assemble the complete URL
      either with or without included credentials, allowing us to test both
      cases in-process.
      
      (cherry picked from commit fea60920)
      Patrick Steinhardt committed
    • tests: perf: build but exclude performance tests by default · 89641431
      Our performance tests (or to be more concrete, our single performance
      test) are not built by default, as they are always #ifdef'd out. While
      it is true that we don't want to run performance tests by default, not
      compiling them at all may cause code rot and is thus an unfavorable
      approach to handle this.
      
      We can easily improve this situation: this commit removes the #ifdef,
      causing the code to always be compiled. Furthermore, we add `-xperf` to
      the default command line parameters of `generate.py`, thus causing the
      tests to be excluded by default.
      
      Due to this approach, we are now able to execute the performance tests
      by passing `-sperf` to `libgit2_clar`. Unfortunately, we cannot execute
      the performance tests on Travis or AppVeyor as they rely on history
      being available for the libgit2 repository. As both do a shallow clone
      only, though, this is not given.
      
      (cherry picked from commit 543ec149)
      Patrick Steinhardt committed
  3. 07 Mar, 2018 1 commit
    • cmake: fix linker error with dbghelper library · f05f90d8
      When the MSVC_CRTDBG option is set by the developer, we will link in the
      dbghelper library to enable memory lead detection in MSVC projects. We
      are doing so by adding it to the variable `CMAKE_C_STANDARD_LIBRARIES`,
      so that it is linked for every library and executable built by CMake.
      But this causes our builds to fail with a linker error:
      
      ```
          LINK: fatal error LNK1104: cannot open file 'advapi32.lib;Dbghelp.lib'
      ```
      
      The issue here is that we are treating the variable as if it were an
      array of libraries by setting it via the following command:
      
      ```
          SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}"
              "Dbghelp.lib")
      ```
      
      The generated build commands will then simply stringify the variable,
      concatenating all the contained libraries with a ";". This causes the
      observed linking failure.
      
      To fix the issue, we should just treat the variabable as a simple
      string. So instead of adding multiple members, we just add the
      "Dbghelp.lib" library to the existing string, separated by a space
      character.
      Patrick Steinhardt committed
  4. 13 Jun, 2017 3 commits
    • cmake: disable optimization on debug builds · a64532e1
      While our debug builds on MSVC platforms already tune the code optimizer
      to aid debugging code, all the other platforms still use the default
      optimization level. This makes it hard for developers on these platforms
      to actually debug code while maintaining his sanity due to optimizations
      like inlined code, elided variables etc.
      
      To help this common use case, we can simply follow the MSVC example and
      turn off code optimization with "-O0" for debug builds. While it would
      be preferable to instead use "-Og" supported by more modern compilers,
      we cannot guarantee that this level is available on all supported
      platforms.
      Patrick Steinhardt committed
    • cmake: set "-D_DEBUG" on non-Windows platforms · 61399953
      In our code base, we have some occasions where we use the "_DEBUG"
      preprocessor macro to enable additional code which should not be part of
      release builds. While we define this flag on MSVC platforms, it is
      guarded by the conditional `WIN32 AND NOT CYGWIN` on other platforms
      since 19be3f9e (Improve MSVC compiler, linker flags, 2013-02-13). While
      this condition can be fulfilled by the MSVC platform, it is never
      encountered due to being part of the `ELSE` part of `IF (MSVC)`.
      
      The intention of the conditional was most likely to avoid the
      preprocessor macro on Cygwin platforms, but to include it on everthing
      else. As such, the correct condition here would be `IF (NOT CYGWIN)`
      instead. But digging a bit further, the condition is only ever used in
      two places:
      
      1. To skip the test in "core::structinit", which should also work on
         Cygwin.
      2. In "src/win32/git2.rc", where it is used to set additional file
         flags. As this file is included in MSVC builds only, it cannot cause
         any harm to set "_DEBUG" on Cygwin here.
      
      As such, we can simply drop the conditional and always set "-D_DEBUG" on
      all platforms.
      Patrick Steinhardt committed
    • cmake: remove stale comment on precompiled headers · e94be4c0
      In commit 9f75a9ce (Turning on runtime checks when building debug under
      MSVC., 2012-03-30), we introduced a comment "Precompiled headers", which
      actually refers to no related commands. Seeing that the comment never
      had anything to refer to, we can simply remove it here.
      Patrick Steinhardt committed
  5. 07 Jun, 2017 2 commits
    • sha1dc: do not use standard includes · db1abffa
      The updated SHA1DC library allows us to use custom includes instead of
      using standard includes. Due to requirements with cross-platform, we
      provide some custom system includes files like for example the
      "stdint.h" file on Win32. Because of this, we want to make sure to avoid
      breaking cross-platform compatibility when SHA1DC is enabled.
      
      To use the new mechanism, we can simply define
      `SHA1DC_NO_STANDARD_INCLUDES`. Furthermore, we can specify custom
      include files via two defines, which we now use to include our
      "common.h" header.
      Patrick Steinhardt committed
    • ctest: temporarily disable UNC path tests · f218508f
      (Temporarily) disable UNC path tests to work around AppVeyor issues.
      Edward Thomson committed
  6. 25 Apr, 2017 1 commit
  7. 03 Mar, 2017 3 commits
  8. 01 Mar, 2017 1 commit
    • cmake: only enable supported compiler warning flags · a02e8a38
      We currently unconditionally enable the "-Wall" and "-Wextra" flags.
      Some platforms rely on compilers which do not support these flags,
      though. One of these platforms is Haiku, which does not support
      "-Wextra" due to being stuck on GCC version 2.
      
      Fix builds on such platforms by adding these flags only if supported by
      the compiler.
      Patrick Steinhardt committed
  9. 31 Dec, 2016 1 commit
  10. 21 Nov, 2016 1 commit
  11. 07 Oct, 2016 1 commit
  12. 06 Oct, 2016 1 commit
  13. 05 Sep, 2016 1 commit
    • cmake: add curl library path · 528b2f7d
      The `PKG_CHECK_MODULES` function searches a pkg-config module and
      then proceeds to set various variables containing information on
      how to link to the library. In contrast to the `FIND_PACKAGE`
      function, the library path set by `PKG_CHECK_MODULES` will not
      necessarily contain linking instructions with a complete path to
      the library, though. So when a library is not installed in a
      standard location, the linker might later fail due to being
      unable to locate it.
      
      While we already honor this when configuring libssh2 by adding
      `LIBSSH2_LIBRARY_DIRS` to the link directories, we fail to do so
      for libcurl, preventing us to build libgit2 on e.g. FreeBSD. Fix
      the issue by adding the curl library directory to the linker
      search path.
      Patrick Steinhardt committed
  14. 21 Jun, 2016 1 commit
    • cmake: do not use -fPIC for MSYS2 · b6a2fd0e
      The MSYS2 build system automatically compiles all code with position-independent
      code. When we manually add the -fPIC flag to the compiler flags, MSYS2 will
      loudly complain about PIC being the default and thus not required.
      
      Fix the annoyance by stripping -fPIC in MSYS2 enviroments like it is already
      done for MinGW.
      Patrick Steinhardt committed
  15. 27 May, 2016 1 commit
  16. 22 May, 2016 1 commit
  17. 29 Apr, 2016 1 commit
  18. 19 Apr, 2016 1 commit
  19. 24 Mar, 2016 1 commit
  20. 23 Mar, 2016 1 commit
  21. 15 Mar, 2016 2 commits
  22. 03 Mar, 2016 2 commits
  23. 25 Feb, 2016 1 commit
    • nsec: support NDK's crazy nanoseconds · 3d6a42d1
      Android NDK does not have a `struct timespec` in its `struct stat`
      for nanosecond support, instead it has a single nanosecond member inside
      the struct stat itself.  We will use that and use a macro to expand to
      the `st_mtim` / `st_mtimespec` definition on other systems (much like
      the existing `st_mtime` backcompat definition).
      Edward Thomson committed
  24. 12 Jan, 2016 1 commit
  25. 09 Jan, 2016 1 commit
  26. 02 Dec, 2015 1 commit
  27. 20 Nov, 2015 1 commit
  28. 23 Oct, 2015 1 commit
  29. 06 Oct, 2015 1 commit
  30. 30 Sep, 2015 1 commit