Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Sharness as our shell test framework, version 3 #206

Merged
merged 5 commits into from
Oct 25, 2014

Commits on Oct 25, 2014

  1. Add test-lib.sh for our shell test framework

    Our test framework is based on Sharness.
    So the first thing to do is to source it.
    chriscool committed Oct 25, 2014
    Configuration menu
    Copy the full SHA
    449523e View commit details
    Browse the repository at this point in the history
  2. Add t0010-basic-commands.sh

    This checks a little bit the installation and some
    basic commands.
    
    You can run it like that:
    
    $ cd test
    $ ./t0010-basic-commands.sh
     ok 1 - current dir is writable
     ok 2 - ipfs version succeeds
     ok 3 - ipfs version output looks good
     ok 4 - ipfs help succeeds
     ok 5 - ipfs help output looks good
     # passed all 5 test(s)
     1..5
    chriscool committed Oct 25, 2014
    Configuration menu
    Copy the full SHA
    12490cb View commit details
    Browse the repository at this point in the history
  3. Move Sharness config checks into test-sharness-config.sh

    This way we can easily reuse the checks in
    test-sharness-config.sh.
    chriscool committed Oct 25, 2014
    Configuration menu
    Copy the full SHA
    1fb4192 View commit details
    Browse the repository at this point in the history
  4. Add test-aggregate-results.sh

    This script aggregates test results using Sharness.
    chriscool committed Oct 25, 2014
    Configuration menu
    Copy the full SHA
    0aebe75 View commit details
    Browse the repository at this point in the history
  5. Add test/Makefile to run the test scripts

    You can use it like this to launch all the
    test scripts in order:
    
    $ cd test
    $ make
     rm -r test-results
     *** t0010-basic-commands.sh ***
     ok 1 - current dir is writable
     ok 2 - ipfs version succeeds
     ok 3 - ipfs version output looks good
     ok 4 - ipfs help succeeds
     ok 5 - ipfs help output looks good
     # passed all 5 test(s)
     1..5
     ./test-aggregate-results.sh
     fixed   0
     success 5
     failed  0
     broken  0
     total   5
    
    Or you can just run one test like this:
    
    $ make t0010-basic-commands.sh
     *** t0010-basic-commands.sh ***
     ok 1 - current dir is writable
     ok 2 - ipfs version succeeds
     ok 3 - ipfs version output looks good
     ok 4 - ipfs help succeeds
     ok 5 - ipfs help output looks good
     # passed all 5 test(s)
     1..5
    chriscool committed Oct 25, 2014
    Configuration menu
    Copy the full SHA
    aeb019f View commit details
    Browse the repository at this point in the history