Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

WIP: Allow sourcing of helper files from BATS_LIB_PATH #216

Open
wants to merge 47 commits into
base: master
Choose a base branch
from

Commits on Jan 21, 2016

  1. This commit corrects the problem of incorrect TAP

    format for skipped tests.
    Tim Harsch committed Jan 21, 2016
    Copy the full SHA
    6cd61bf View commit details
    Browse the repository at this point in the history

Commits on May 2, 2016

  1. Avoid undocumented usage of the head utility.

    Some implementations of head (e.g. the one in Busybox)
    can't handle options like "-1". Replace them with "-n1".
    
    Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
    Dmitry Rozhkov committed May 2, 2016
    Copy the full SHA
    adc7ecf View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2017

  1. Copy the full SHA
    d0f06d1 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2017

  1. Updated repo name in README

    btamayo committed Sep 20, 2017
    Copy the full SHA
    b72cd35 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2017

  1. Copy the full SHA
    e3b37da View commit details
    Browse the repository at this point in the history
  2. Updating paths sstephenson#5

    FullSemver: 0.4.1+9
    Branch: master
    btamayo committed Sep 24, 2017
    Copy the full SHA
    8ca0685 View commit details
    Browse the repository at this point in the history
  3. Added IRC channel info

    btamayo committed Sep 24, 2017
    Copy the full SHA
    c85f340 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2017

  1. Copy the full SHA
    3a6efc0 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2017

  1. Merge pull request sstephenson#6 from peteruhnak/patch-1

    Minor fix in the installation snippet
    btamayo committed Sep 26, 2017
    Copy the full SHA
    aaf62cd View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2017

  1. Add .appveyor.yml

    This follows the example from https://www.appveyor.com/docs/lang/ruby/
    except that it doesn't need `install` or `before_test` steps.
    mbland committed Sep 30, 2017
    Copy the full SHA
    d9ee416 View commit details
    Browse the repository at this point in the history
  2. .appveyor.yml: Prefix test command with time

    This enables us to get an idea of the performance impact of a change.
    mbland committed Sep 30, 2017
    Copy the full SHA
    5e752ee View commit details
    Browse the repository at this point in the history
  3. .travis.yml: Prefix test command with time

    As with the update to .appveyor.yml in the previous commit, this enables
    us to get an idea of the performance impact of a change.
    mbland committed Sep 30, 2017
    Copy the full SHA
    bbac787 View commit details
    Browse the repository at this point in the history
  4. .travis.yml: Enable macOS builds

    Also sets the `language` to `bash`.
    mbland committed Sep 30, 2017
    Copy the full SHA
    d310b25 View commit details
    Browse the repository at this point in the history
  5. test/bats: Add statements to debug Travis macOS

    The following build is demonstrating failures I can't reproduce on my
    own macOS system:
    
      https://travis-ci.org/bats-core/bats-core/jobs/281719290
    mbland committed Sep 30, 2017
    Copy the full SHA
    918714d View commit details
    Browse the repository at this point in the history
  6. exec-test: Work around Bash 3.2.57 ERR trap bug

    When running under Bash 3.2.57(1)-release on macOS, the following tests
    would fail because `BATS_ERROR_STACK_TRACE` would be empty, and hence no
    information about the actual error would get printed:
    
    - one failing test
    - failing test with significant status
    - failing test file outside of BATS_CWD
    
    This is because each of these cases use `FIXTURE_ROOT/failing.bats`, and
    the `ERR` trap would not fire for its `eval "( exit ${STATUS:-1} )"`
    line. Changing it to `exit ${STATUS:-1}` produced the same effect, and
    changing it to `return ${STATUS:-1}` would cause the output to point to
    the previous line, which executes `true`.
    
    However, the correct status would be reported to the `EXIT` trap, so now
    we call `bats_error_trap` at the very beginning of `bats_teardown_trap`.
    
    All the existing tests now pass under Bash 3.2.57(1)-release, Bash
    4.2.25(1)-release (the version from the default Ubuntu 12.04.5/Precise
    image on Travis CI), and Bash 4.4.12(1)-release.
    mbland committed Sep 30, 2017
    Copy the full SHA
    0f6dde5 View commit details
    Browse the repository at this point in the history
  7. Merge pull request sstephenson#10 from bats-core/ci-configs

    Add Appveyor configuration, update Travis CI configuration, fix macOS bug
    mbland committed Sep 30, 2017
    Copy the full SHA
    55bf719 View commit details
    Browse the repository at this point in the history
  8. exec-test: Refactor bats_frame_* functions

    Preserves existing behavior. Next step will be to take the target
    variable name as the second argument.
    mbland committed Sep 30, 2017
    Copy the full SHA
    a3396cb View commit details
    Browse the repository at this point in the history
  9. exec-test: Use printf -v in bats_frame_* functions

    This is part of the effort to improve performance by reducing the number
    of command substitutions/subshells spawned by `bats_debug_trap`.
    
    Under Bash 3.2.57(1)-release on a MacBook Pro with a 2.9GHz Intel Core
    i5 CPU and 8GB 1867MHz DDR3 RAM, this makes `bin/bats test/` go from:
    
      44 tests, 0 failures
    
      real    0m7.565s
      user    0m3.664s
      sys     0m3.368s
    
    to:
    
      real    0m6.449s
      user    0m3.290s
      sys     0m2.665s
    mbland committed Sep 30, 2017
    Copy the full SHA
    93d3cec View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    39440c5 View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    eaa151f View commit details
    Browse the repository at this point in the history
  12. Copy the full SHA
    3bc0379 View commit details
    Browse the repository at this point in the history
  13. exec-test: Replace type -t with command -F

    Also eliminates a subshell.
    mbland committed Sep 30, 2017
    Copy the full SHA
    698fa76 View commit details
    Browse the repository at this point in the history
  14. exec-test: Use printf -v in bats_extract_line

    Also replaces `sed` invocation with a `while` loop, saving a subprocess.
    mbland committed Sep 30, 2017
    Copy the full SHA
    d294689 View commit details
    Browse the repository at this point in the history
  15. exec-test: Invoke bats-preprocess directly

    Also, `bats-preprocess` now converts DOS/Windows CRLF line endings.
    mbland committed Sep 30, 2017
    Copy the full SHA
    cf9a3b8 View commit details
    Browse the repository at this point in the history
  16. Copy the full SHA
    741c414 View commit details
    Browse the repository at this point in the history
  17. exec-test: Replace || { } with if [[ ]]; then

    Somehow this is ever-so-slightly faster.
    mbland committed Sep 30, 2017
    Copy the full SHA
    e613b31 View commit details
    Browse the repository at this point in the history
  18. exec-test: Replace caller with FUNCNAME, etc.

    This is part of the effort to improve performance by reducing the number
    of command substitutions/subshells spawned by `bats_debug_trap`.
    
    Under Bash 3.2.57(1)-release on a MacBook Pro with a 2.9GHz Intel Core
    i5 CPU and 8GB 1867MHz DDR3 RAM, this makes `bin/bats test/` go from the
    following for the previous commit:
    
      44 tests, 0 failures
    
      real    0m5.293s
      user    0m2.853s
      sys     0m2.087s
    
    to:
    
      real    0m4.319s
      user    0m2.559s
      sys     0m1.454s
    mbland committed Sep 30, 2017
    Copy the full SHA
    fac51df View commit details
    Browse the repository at this point in the history
  19. preprocess: Add tests for vars, quotes in names

    This is in anticipation of refactoring away the `$(eval echo
    "$quoted_name")` command substitution.
    mbland committed Sep 30, 2017
    Copy the full SHA
    3ab495f View commit details
    Browse the repository at this point in the history
  20. preprocess: Eliminate eval in subshell

    This is part of the effort to improve performance by reducing the number
    of command substitutions/subshells.
    
    Under Bash 3.2.57(1)-release on a MacBook Pro with a 2.9GHz Intel Core
    i5 CPU and 8GB 1867MHz DDR3 RAM, this shaves off O(0.15s) from the test
    suite at the previous commit, but I anticipate this effect being
    magnified on Windows platforms.
    mbland committed Sep 30, 2017
    Copy the full SHA
    6beea07 View commit details
    Browse the repository at this point in the history
  21. bats: Refactor resolve_link, abs_dirname

    Under Bash 3.2.57(1)-release and 4.4.12(1)-release on a MacBook Pro with
    a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM, this shaves off
    O(0.4s) from the current test suite.
    
    Before the change:
    
      46 tests, 0 failures
    
      real    0m4.392s
      user    0m2.489s
      sys     0m1.467s
    
    After the change:
    
      real    0m3.980s
      user    0m2.312s
      sys     0m1.233s
    mbland committed Sep 30, 2017
    Copy the full SHA
    cdc55ad View commit details
    Browse the repository at this point in the history
  22. bats: Convert abs_dirname to use printf -v

    Under Bash 3.2.57(1)-release and 4.4.12(1)-release on a MacBook Pro with
    a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM, this shaves off
    O(0.1s) from the current test suite.
    
    Before the change:
    
      46 tests, 0 failures
    
      real    0m3.983s
      user    0m2.320s
      sys     0m1.241s
    
    After the change:
    
      real    0m3.861s
      user    0m2.276s
      sys     0m1.174s
    mbland committed Sep 30, 2017
    Copy the full SHA
    daf76c2 View commit details
    Browse the repository at this point in the history
  23. bash: Refactor expand_path

    Under Bash 3.2.57(1)-release and 4.4.12(1)-release on a MacBook Pro with
    a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM, this shaves off
    O(0.25s) from the current test suite.
    
    Before the change:
    
      46 tests, 0 failures
    
      real    0m3.851s
      user    0m2.273s
      sys     0m1.166s
    
    After the change:
    
      real    0m3.595s
      user    0m2.171s
      sys     0m1.048s
    mbland committed Sep 30, 2017
    Copy the full SHA
    d4443ad View commit details
    Browse the repository at this point in the history
  24. bats: Don't pipe to cat for nonpretty output

    Under Bash 3.2.57(1)-release and 4.4.12(1)-release on a MacBook Pro with
    a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM, this shaves off
    O(0.04-0.05s) from the current test suite. Very minor, but it's a
    straightforward change that may provide a minor-yet-noticeable effect on
    Windows.
    
    Before this change:
    
      46 tests, 0 failures
    
      real    0m3.588s
      user    0m2.171s
      sys     0m1.046s
    
    After this change:
    
      real    0m3.538s
      user    0m2.119s
      sys     0m0.941s
    mbland committed Sep 30, 2017
    Copy the full SHA
    7bcbb2f View commit details
    Browse the repository at this point in the history
  25. bats-exec-suite: Count tests w/ BATS_TEST_PATTERN

    Under Bash 3.2.57(1)-release and 4.4.12(1)-release on a MacBook Pro with
    a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM, this shaves off
    O(0.16s) from the current test suite.
    
    Before this change:
    
      46 tests, 0 failures
    
      real    0m3.541s
      user    0m2.125s
      sys     0m0.937s
    
    After this change:
    
      real    0m3.372s
      user    0m2.031s
      sys     0m0.894s
    mbland committed Sep 30, 2017
    Copy the full SHA
    f5acd28 View commit details
    Browse the repository at this point in the history
  26. format-tap: Refactor summary to remove subshells

    While the performance impact of these changes are in the noise under
    macOS 10.12.3 on a on a MacBook Pro with a 2.9GHz Intel Core i5 CPU and
    8GB 1867MHz DDR3 RAM, eliminating these subshells makes the code more
    consistent.
    
    I did try removing `buffer` to eliminate yet more subshells, but the
    flickering of the output did prove annoying, so I'm not removing it.
    mbland committed Sep 30, 2017
    Copy the full SHA
    8c4a86d View commit details
    Browse the repository at this point in the history
  27. Fix test failures due to unquoted variables

    The four test cases updated in this commit were failing on my Windows
    virtual machine because my username contains a space. Quoting the file
    paths containing "$FIXTURE_ROOT" solved the problem.
    mbland committed Sep 30, 2017
    Copy the full SHA
    ebb192e View commit details
    Browse the repository at this point in the history
  28. Merge pull request sstephenson#8 from bats-core/mbland-optimized

    Fix macOS/Bash 3.2 breakage; eliminate subshells from exec-test, preprocess
    mbland committed Sep 30, 2017
    Copy the full SHA
    8538868 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2017

  1. Copy the full SHA
    f953d77 View commit details
    Browse the repository at this point in the history
  2. Merge pull request sstephenson#17 from agent-0028/rojkov-fix-head-util

    Transfer bats#163 - Avoid undocumented usage of the head utility.
    mbland committed Oct 2, 2017
    Copy the full SHA
    b3e6191 View commit details
    Browse the repository at this point in the history
  3. Reword skipped test fixtures for clarity

    Separate "skip" from the test name (description) to be distinct from "skip" as part of the TAP Directive.
    agent-0028 committed Oct 2, 2017
    Copy the full SHA
    d1f9165 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    adf559e View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2017

  1. Copy the full SHA
    eed9913 View commit details
    Browse the repository at this point in the history
  2. Merge pull request sstephenson#19 from agent-0028/harschware-tap_skip…

    …_test_fix
    
    Transfer bats#142 - This commit corrects the problem of incorrect TAP format for skipped tests
    mbland committed Oct 3, 2017
    Copy the full SHA
    6ce148b View commit details
    Browse the repository at this point in the history
  3. test/bats: Add fake tput to fix Alpine tests

    The test cases that use the `-p` or `--pretty` flag would fail if `tput`
    wasn't available (installed as part of the `ncurses` package). On
    Alpine, `ncurses` isn't installed by default. This change ensures the
    tests validate the expected behavior regardless of whether `tput` is
    available.
    mbland authored and btamayo committed Oct 3, 2017
    Copy the full SHA
    1ed87ec View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2017

  1. Allow sourcing of helper files from BATS_LIB_PATH

    The existing functionality of load() is preserved:
        1. Load helper files in the same directory the current testfile
           resides in
        2. Load helper files by absolute path
    
    Additionally an environment variable BATS_LIB_PATH can be defined to
    be source helper files from.
    
    If BATS_LIB_PATH is empty the following locations are used:
        1. $HOME/.bats/lib
           Allows users to manage helper libraries themselves, similar to
           python/ruby/...
        2. /usr/lib/bats
           Allows to install helper libraries via a package manager.
    Nelo Wallus committed Oct 9, 2017
    Copy the full SHA
    617e086 View commit details
    Browse the repository at this point in the history
  2. Add test harness for various library loading methods

    Nelo Wallus committed Oct 9, 2017
    Copy the full SHA
    cb43429 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    e96502c View commit details
    Browse the repository at this point in the history