Nelo Wallus
cb434296c5
Add test harness for various library loading methods
2017-10-09 19:51:25 +02:00
Mike Bland
1ed87ecb7f
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.
2017-10-03 13:24:06 -07:00
Mike Bland
6ce148b9d2
Merge pull request #19 from agent-0028/harschware-tap_skip_test_fix
...
Transfer bats#142 - This commit corrects the problem of incorrect TAP format for skipped tests
2017-10-03 14:54:31 -04:00
Jason Grosz
eed991303b
Add double quotes around $FIXTURE_ROOT
2017-10-03 13:30:35 -05:00
Jason Grosz
d1f9165ba0
Reword skipped test fixtures for clarity
...
Separate "skip" from the test name (description) to be distinct from "skip" as part of the TAP Directive.
2017-10-02 15:40:07 -05:00
Mike Bland
ebb192e036
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.
2017-09-30 15:12:38 -04:00
Mike Bland
6beea07a0b
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.
2017-09-30 15:12:38 -04:00
Mike Bland
3ab495fda2
preprocess: Add tests for vars, quotes in names
...
This is in anticipation of refactoring away the `$(eval echo
"$quoted_name")` command substitution.
2017-09-30 15:12:38 -04:00
Mike Bland
eaa151fb69
exec-test: Use printf -v in bats_trim_filename
2017-09-30 15:12:37 -04:00
Mike Bland
918714dd4d
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
2017-09-30 14:51:45 -04:00
Tim Harsch
6cd61bf9da
This commit corrects the problem of incorrect TAP
...
format for skipped tests.
2016-01-20 17:14:51 -08:00
Sylvain
5fe46a0893
pull #90 quote every string compare
...
test are all successful.
2015-01-30 13:08:27 +01:00
Sylvain
1735a4fcd2
saving $IFS in run() not altered for code using it
...
IFS was modified by run() becoming '\n' and so relying to its bash default
was failing tests.
Also some wrong tests corrected because was relying on this behavior to pass.
Fix #89
2015-01-29 20:51:49 +01:00
Henrique Moody
3be82466a7
Add skipped count tests in the summary
...
This also update the behaviour of the summary, now it only display the
number of failures, and skipped tests also, if the numbers are greater
than zero.
2014-08-13 14:32:35 +01:00
Sam Stephenson
2c6fed1838
Print the outermost, not innermost, failed command
...
The outermost command—i.e. the line that failed inside the test case function itself—is more likely to be meaningful at a glance than the innermost command, which might be e.g. the implementation of a helper assertion.
2014-08-12 17:28:03 -05:00
Sam Stephenson
a715fff30a
Print filenames relative to the working directory
2014-08-12 16:56:52 -05:00
Sam Stephenson
716d2d62ed
Print the failing status code, if it's significant
2014-08-12 16:45:51 -05:00
Andrey Mazo
bbaf0f50df
Print failed statement in backtrace
...
Update tests accordingly.
2014-06-29 00:30:49 +04:00
Sam Stephenson
34b65bb904
Safeguard test teardown ( #45 )
2014-06-01 20:21:14 -05:00
Andrey Mazo
35f963010d
Make load
handle absolute paths too
...
Add 2 simple tests on this.
2014-05-21 18:30:51 -04:00
Sam Stephenson
1041e46f39
Support single-line test definitions
2013-11-17 13:04:57 -06:00
Sam Stephenson
4a187385d2
Simplify test names
2013-11-04 13:34:37 -06:00
Sam Stephenson
c8d63dd7e0
Correctly log errors in setup
and teardown
functions
...
Fixes #30
2013-11-04 12:20:55 -06:00
Sam Stephenson
417acfff66
Revert "Revert "Merge pull request #25 from sstephenson/stack-trace""
...
This reverts commit cb658ba91f
.
2013-10-28 20:13:45 -05:00
Sam Stephenson
cb658ba91f
Revert "Merge pull request #25 from sstephenson/stack-trace"
...
This reverts commit 07bdee33a1
, reversing
changes made to c36ad10d8c
.
2013-10-28 20:10:42 -05:00
Sam Stephenson
de1970fb8f
Log the full stack trace when a test fails
2013-10-28 15:10:48 -05:00
Sam Stephenson
25505bd143
Skip pretty formatting if the first line isn't a TAP plan
...
Closes #21
2013-10-28 14:47:52 -05:00
Sam Stephenson
8930e4e0d1
Fix for test files without trailing newlines ( closes #12 )
2013-10-21 12:45:49 -05:00
Sam Stephenson
a3229efbfa
Pretty test output for terminals
2013-10-21 12:03:45 -05:00
Sam Stephenson
b0606bc8cd
Don't need duplicate tests for skip
2013-10-21 11:32:36 -05:00
Sam Stephenson
8873aab79f
Extended syntax: "begin" line before each test is run
2013-10-21 11:32:09 -05:00
Sam Stephenson
a773171777
Don't indent the output of failed tests
2013-10-21 10:58:21 -05:00
Sam Stephenson
c8c56a987c
More descriptive message for failing line and file
2013-10-21 10:57:53 -05:00
Sam Stephenson
f4e09aaa2a
Merge pull request #19 from duggan/internal-skips
...
Support for TAP compliant skip directive inside test blocks.
2013-10-18 14:14:35 -07:00
Ross Duggan
f78324dfec
Support for TAP compliant skip directive inside test blocks.
2013-10-18 22:05:20 +01:00
Sam Stephenson
672f6e4be2
Invoke bats
with multiple files to run an ad-hoc suite
2013-10-18 14:13:00 -05:00
Sam Stephenson
bc72b85871
Print test file path and line number after a failing test
2013-05-23 12:47:17 -05:00
Adam Jacob
9c8425d005
Supporting DOS line endings in BATS tests
2013-05-22 21:20:39 -04:00
Mislav Marohnić
7cec3d6259
fix preprocessing tests that have lines beginning with -e
2013-04-06 14:01:03 +02:00
Sam Stephenson
04be7dc717
Abort when load is invoked with a nonexistent script
2012-11-16 14:35:48 -06:00
Sam Stephenson
a75495b9dd
.gitkeep the empty suite fixture
2012-11-16 14:29:58 -06:00
Sam Stephenson
19a05cc77d
Suite support for aggregating multiple tests under a single run
2012-11-16 14:25:45 -06:00
Sam Stephenson
6b965e18c4
bats -c filename
prints the number of tests in the file
2012-04-08 23:25:38 -05:00
Sam Stephenson
d591867b35
Add -v/--version
2011-12-30 14:12:15 -06:00
Sam Stephenson
e9d3143fdb
Capture stdout/stderr during tests and display it for failures
2011-12-28 23:50:49 -06:00
Sam Stephenson
a4c16fecef
Test load
2011-12-28 21:41:23 -06:00
Sam Stephenson
43d1972b0e
Test (and fix) that teardown runs once after each test
2011-12-28 21:20:43 -06:00
Sam Stephenson
6e65ef449b
Share $TMP with fixtures
2011-12-28 20:58:16 -06:00
Sam Stephenson
aecc6b55dc
Test that setup runs once before each test
2011-12-28 20:46:24 -06:00
Sam Stephenson
098d993eb4
Test that each test's environment is isolated
2011-12-28 20:23:52 -06:00