• Show log

    Commit

  • Hash : 0a513a94
    Author : Patrick Steinhardt
    Date : 2017-05-10T11:46:00

    generate.py: disallow generating test suites for multiple paths
    
    Our generate.py script is used to extract and write test suite
    declarations into the clar.suite file. As is, the script accepts
    multiple directories on the command line and will generate this file for
    each of these directories.
    
    The generate.py script will always write the clar.suite file into the
    directory which is about to be scanned. This actually breaks
    out-of-tree builds with libgit2, as the file will be generated in the
    source tree instead of in the build tree. This is noticed especially in
    the case where the source tree is mounted read-only, rendering us unable
    to build unit tests.
    
    Due to us accepting multiple paths which are to be scanned, it is not
    trivial to fix though. The first solution which comes into mind would be
    to re-create the directory hierarchy at a given output path or use
    unique names for the clar.suite files, but this is rather cumbersome and
    magical. The second and cleaner solution would be to fold all
    directories into a single clar.suite file, but this would probably break
    some use-cases.
    
    Seeing that we do not ever pass multiple directories to generate.py, we
    will now simply retire support for this. This allows us to later on
    introduce an additional option to specify the path where the clar.suite
    file will be generated at, defaulting to "clar.suite" inside of the
    scanned directory.
    

  • 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.