1. 03 Jan, 2018 7 commits
    • tests: online::clone: inline creds-test with nonexistent URL · 54a1bf05
      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.
      Patrick Steinhardt committed
    • tests: online::clone: construct credential-URL from environment · fea60920
      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.
      Patrick Steinhardt committed
    • tests: perf: build but exclude performance tests by default · 543ec149
      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.
      Patrick Steinhardt committed
    • tests: iterator::workdir: fix reference count in stale test · b8c14499
      The test `iterator::workdir::filesystem_gunk` is usually not executed,
      as it is guarded by the environment variable "GITTEST_INVASIVE_SPEED"
      due to its effects on speed. As such, it has become stale and does not
      account for new references which have meanwhile been added to the
      testrepo, causing it to fail. Fix this by raising the number of expected
      references to 15.
      Patrick Steinhardt committed
    • tests: iterator_helpers: assert number of iterator items · 9aba7636
      When the function `expect_iterator_items` surpasses the number of
      expected items, we simply break the loop. This causes us to trigger an
      assert later on which has message attached, which is annoying when
      trying to locate the root error cause. Instead, directly assert that the
      current count is still smaller or equal to the expected count inside of
      the loop.
      Patrick Steinhardt committed
    • tests: status::worktree: indicate skipped tests on Win32 · 72c28ab0
      Some function bodies of tests which are not applicable to the Win32
      platform are completely #ifdef'd out instead of calling `cl_skip()`.
      This leaves us with no indication that these tests are not being
      executed at all and may thus cause decreased scrutiny when investigating
      skipped tests. Improve the situation by calling `cl_skip()` instead of
      just doing nothing.
      Patrick Steinhardt committed
    • travis: build sources with tracing enabled · 8999f6ac
      Our tracing architecture is not built by default, causing the Travis CI
      to not execute some code and skip several tests. As AppVeyor has already
      enabled the tracing architecture when building the code, we should do
      the same for Travis CI to have this code being tested on macOS and
      Linux.
      
      Add "-DENABLE_TRACE=ON" to our release-build options of Travis.
      Patrick Steinhardt committed
  2. 12 Nov, 2017 3 commits
  3. 11 Nov, 2017 12 commits
    • Merge pull request #4310 from pks-t/pks/common-parser · 1d7c15ad
      Common parser interface
      Edward Thomson committed
    • clar: verify command line arguments before execute · 32758631
      When executing `libgit2_clar -smerge -invalid_option`, it will first execute
      the merge test suite and afterwards output help because of the invalid option.
      
      With this changa, it verifies all options before execute. If there are any
      invalid options, it will output help and exit without actually executing
      the test suites.
      Yoney committed
    • Merge pull request #4403 from hkleynhans/select_bundled_zlib · 46e1dabb
      cmake: Allow user to select bundled zlib
      Edward Thomson committed
    • config_parse: use common parser interface · 9e66590b
      As the config parser is now cleanly separated from the config file code,
      we can easily refactor the code and make use of the common parser
      module. This removes quite a lot of duplicated functionality previously
      used for handling the actual parser state and replaces it with the
      generic interface provided by the parser context.
      Patrick Steinhardt committed
    • config_file: split out module to parse config files · 1953c68b
      The configuration file code grew quite big and intermingles both actual
      configuration logic as well as the parsing logic of the configuration
      syntax. This makes it hard to refactor the parsing logic on its own and
      convert it to make use of our new parsing context module.
      
      Refactor the code and split it up into two parts. The config file code
      will only handle actual handling of configuration files, includes and
      writing new files. The newly created config parser module is then only
      responsible for parsing the actual contents of a configuration file,
      leaving everything else to callbacks provided to its provided function
      `git_config_parse`.
      Patrick Steinhardt committed
    • parse: always initialize line pointer · 7bdfc0a6
      Upon initializing the parser context, we do not currently initialize the
      current line, line length and line number. Do so in order to make the
      interface easier to use and more obvious for future consumers of the
      parsing API.
      Patrick Steinhardt committed
    • parse: implement `git_parse_peek` · e72cb769
      Some code parts need to inspect the next few bytes without actually
      consuming it yet, for example to examine what content it has to expect
      next. Create a new function `git_parse_peek` which returns the next byte
      without modifying the parsing context and use it at multiple call sites.
      Patrick Steinhardt committed
    • parse: implement and use `git_parse_advance_digit` · 252f2eee
      The patch parsing code has multiple recurring patterns where we want to
      parse an actual number. Create a new function `git_parse_advance_digit`
      and use it to avoid code duplication.
      Patrick Steinhardt committed
    • patch_parse: use git_parse_contains_s · 65dcb645
      Instead of manually checking the parsing context's remaining length and
      comparing the leading bytes with a specific string, we can simply re-use
      the function `git_parse_ctx_contains_s`. Do so to avoid code duplication
      and to further decouple patch parsing from the parsing context's struct
      members.
      Patrick Steinhardt committed
    • parse: extract parse module · ef1395f3
      The `git_patch_parse_ctx` encapsulates both parser state as well as
      options specific to patch parsing. To advance this state and keep it
      consistent, we provide a few functions which handle advancing the
      current position and accessing bytes of the patch contents. In fact,
      these functions are quite generic and not related to patch-parsing by
      themselves. Seeing that we have similar logic inside of other modules,
      it becomes quite enticing to extract this functionality into its own
      parser module.
      
      To do so, we create a new module `parse` with a central struct called
      `git_parse_ctx`. It encapsulates both the content that is to be parsed
      as well as its lengths and the current position. `git_patch_parse_ctx`
      now only contains this `parse_ctx` only, which is then accessed whenever
      we need to touch the current parser. This is the first step towards
      re-using this functionality across other modules which require parsing
      functionality and remove code-duplication.
      Patrick Steinhardt committed
    • cmake: Allow user to select bundled zlib · a0b0b808
      Under some circumstances the installed / system version of zlib may not
      be desirable due to being too old or buggy.  This patch adds the option
      `USE_BUNDLED_ZLIB` that will cause the bundled version of zlib to be
      used.
      
      We may also want to add similar functionality to allow the user to
      select other bundled 3rd-party dependencies instead of using the system
      versions.
      
      /cc @pks-t @ethomson
      Henry Kleynhans committed
    • Merge pull request #4308 from pks-t/pks/header-state-machine · 0393ecc6
      patch_parse: implement state machine for parsing patch headers
      Edward Thomson committed
  4. 10 Nov, 2017 2 commits
  5. 09 Nov, 2017 1 commit
  6. 06 Nov, 2017 4 commits
  7. 04 Nov, 2017 5 commits
  8. 31 Oct, 2017 3 commits
  9. 30 Oct, 2017 3 commits