• Show log

    Commit

  • Hash : f2cab0a6
    Author : Patrick Steinhardt
    Date : 2016-08-04T11:49:39

    clar: fix parsing of test suite prefixes
    
    When passing in a specific suite which should be executed by clar
    via `-stest::suite`, we try to parse this string and then include
    all tests contained in this suite. This also includes all tests
    in sub-suites, e.g. 'test::suite::foo'.
    
    In the case where multiple suites start with the same _string_,
    for example 'test::foo' and 'test::foobar', we fail to
    distinguish this correctly. When passing in `-stest::foobar`,
    we wrongly determine that 'test::foo' is a prefix and try to
    execute all of its matching functions. But as no function
    will now match 'test::foobar', we simply execute nothing.
    
    To fix this, we instead have to check if the prefix is an actual
    suite prefix as opposed to a simple string prefix. We do so by by
    inspecting if the first two characters trailing the prefix are
    our suite delimiters '::', and only consider the filter as
    matching in this case.
    

  • README.md

  • Writing Clar tests for libgit2

    For information on the Clar testing framework and a detailed introduction please visit:

    https://github.com/vmg/clar

    • Write your modules and tests. Use good, meaningful names.

    • Make sure you actually build the tests by setting:

        cmake -DBUILD_CLAR=ON build/
    • Test:

        ./build/libgit2_clar
    • Make sure everything is fine.

    • Send your pull request. That’s it.