Commit Graph

130 Commits

Author SHA1 Message Date
Thomas Levine
e81b120a11 update counting tests for multi-shell testing 2016-02-28 22:51:28 +00:00
Thomas Levine
3e90e83237 use mktemp 2016-02-28 22:43:35 +00:00
Thomas Levine
9d60edae83 use mktemp 2016-02-28 22:43:17 +00:00
Thomas Levine
90494385e2 rm 2016-02-28 22:41:27 +00:00
Thomas Levine
06952c7761 work on setup teardown 2016-02-28 22:36:45 +00:00
Thomas Levine
58f2f754b5 move some setup teardown tests 2016-02-28 22:33:47 +00:00
Thomas Levine
7267239313 start moving cross-shell testing tests
and also make them more cross-shell test style
2016-02-28 22:23:47 +00:00
Thomas Levine
6846876448 better name 2016-02-28 22:03:42 +00:00
Thomas Levine
c93456f6e5 CDPATH test 2016-02-28 22:03:11 +00:00
Thomas Levine
348a5a3a29 move more tests 2016-02-28 21:48:22 +00:00
Thomas Levine
f29cf2cc86 add .urchin for exit codes testsuite 2016-02-28 21:10:59 +00:00
Thomas Levine
5aa081f1df test exit codes 2016-02-28 20:56:21 +00:00
Thomas Levine
0d0c7aa0f3 use TEST_SHELL 2016-02-28 20:11:34 +00:00
Thomas Levine
008d8a2829 test tap format
and find new cross-shell bugs in urchin!
2016-02-28 20:03:49 +00:00
Thomas Levine
e0fc0356a9 move --version test 2016-02-28 19:47:07 +00:00
Thomas Levine
4e2ba32e98 add documented flags 2016-02-28 19:45:18 +00:00
Thomas Levine
22e4ff4cc3 tests for -e, --exit-on-fail 2016-02-28 19:43:32 +00:00
Thomas Levine
5b353b9734 fix regex more 2016-02-28 19:34:47 +00:00
Thomas Levine
968b539d15 empty testsuite test 2016-02-28 19:33:00 +00:00
Thomas Levine
fe9daae67b allow skipping 2016-02-28 19:26:18 +00:00
Thomas Levine
77da4ce194 generating tests 2016-02-28 19:18:54 +00:00
Thomas Levine
87d5aec23c change test generation 2016-02-28 19:01:59 +00:00
Thomas Levine
fa402bd42d doesn't quite work 2016-02-28 18:54:18 +00:00
Thomas Levine
32b32d0aa2 start test generator 2016-02-28 18:43:27 +00:00
Thomas Levine
287e54a4fe move tests out temporarily 2016-02-28 18:24:14 +00:00
Thomas Levine
0fdd14494c tests with nested directories 2016-02-28 12:53:26 +00:00
Thomas Levine
f42a5a2489 fix empty directories 2016-02-28 12:35:27 +00:00
Thomas Levine
2e01fd43f2 success test 2016-02-28 12:23:21 +00:00
Thomas Levine
921c450fb2 set urchin root 2016-02-28 12:14:27 +00:00
Thomas Levine
dce0adc768 test skip on exit code 3 2016-02-26 17:37:12 +00:00
Thomas Levine
43674f12e2 more accepting molly-guard 2016-02-26 16:23:41 +00:00
Thomas Levine
9bb1366549 simpler truth test 2016-02-26 16:19:32 +00:00
Thomas Levine
643a1bf576 test a more accepting molly-guard 2016-02-26 16:18:49 +00:00
Thomas Levine
d7c8549206 urchin -v test 2016-01-29 17:14:34 +00:00
Thomas Levine
3ea035d188 rename test to be more clear 2016-01-28 15:24:24 +00:00
Thomas Levine
66c010b694 fix fixture to not expect stderr 2016-01-28 15:23:14 +00:00
Thomas Levine
7339e84d7c test stdout stderr for TAP 2016-01-28 15:23:14 +00:00
Thomas Levine
e364d40f3a TAP test 2016-01-28 15:23:14 +00:00
Thomas Levine
13e748d684 remove awk dependency in test suite
I'm on NixOS, so awk isn't in /usr/bin. I can search for it with
/usr/bin/env, but then I can't use -f in the shebang line.
2016-01-28 15:23:14 +00:00
Thomas Levine
72fa30e787 Test die on fail. 2016-01-28 15:23:13 +00:00
Thomas Levine
df80586d79 remove "urchin -x" test 2016-01-28 15:23:12 +00:00
Michael Klement
2847b020b4 Make sure that CDPATH isn't set, as it causes cd to behave unpredictably - notably, it can produce output, which breaks fullpath().
Also: Improved CLI help, updated URLs in read-me, cleaned up package.json:

I've tried to clarify the intent of `-x` in the CLI help, but I haven't touched the read-me in that respect.

I don't see any benefit to `-x`:

* Just using `#/bin/sh` as the shebang line in combination with `-s <shell>` gives you the same functionality,
* When it comes to invoking scripts from _within_ test scripts, nothing can do the work for you: you consciously have to mark the invocation with _something_ to indicate that it should be controlled from the outside; it won't get any easier than `$TEST_SHELL ...`
* Finally, using a shebang line such as `#!/usr/bin/env urchin -x` is problematic for two reasons:
  * Some platforms can handle only *1* argument in a shebang line.
  * In a _package-local_ installation, `#!/usr/bin/env` may not find the Urchin executable.

I'm also not sure how the following (from `readme.md`) fits in the picture:

> It might make sense if you do this.

    export TEST_SHELL=zsh && urchin -x
    export TEST_SHELL=bash && urchin -x

(As an aside: To achieve the same thing, you don't need `export`; `TEST_SHELL=zsh urchin -x`  and `TEST_SHELL=bash urchin -x`  is the better choice.)
How does this relate to use in a  _shebang line_?

`urchin_help()` now uses a here-doc: easier to maintain, and should work in all Bourne-like shells.

`readmeFilename` removed from `package.json`:

> "The readmeFilename does not need to ever be in your actual package.json file" - npm/npm#3573
2014-12-03 09:54:15 -05:00
Thomas Levine
bf8c404784 fix -sh 2014-11-05 17:46:19 +00:00
Thomas Levine
ed09351df6 fix a test 2014-11-05 17:28:54 +00:00
Thomas Levine
1f115df222 urchin -sh 2014-11-05 17:18:31 +00:00
Michael Klement
1e9611e732 Support for cross-shell testing added, via option -s <shell> and env. variable TEST_SHELL.
* For **tests that _source_ shell scripts**: **option `-s <shell>`** now tells urchin to invoke test scripts with the specified shell (only shebang-less and `#!/bin/sh` tests scripts).
* For **tests that _invoke_ schell scripts**: instruct users to write their tests to always **invoke via environment variable `TEST_SHELL` (e.g., `$TEST_SHELL ../foo`)**, and invoke urchin with that variable defined as needed, e.g., `TEST_SHELL=ksh urchin ./tests`; urchin defaults `TEST_SHELL` to `/bin/sh`.

See updated `readme.md` for details.
2014-10-17 17:16:12 -04:00
Michael Klement
deb77cb5de Various bug fixes and cleanup.
* bug fixes:
  * fixed directory-existence argument check
  * fixed how `.urchin_stdout` files are cleaned up
  * fixed instances of error/warning messages outputting to stdout instead of stderr
* documentation, help and error-message improvements:
  * added specific error message if the (non-option) argument is not a directory
  * improved wording of CLI help
  * readme.md: replaced obsolete URL http://www.urchin.sh with https://github.com/scraperwiki/urchin
  * readme.md: made the fact clearer that `./cross-shell-tests` only tests urchin's _own_ cross-shell compatibility
  * HISTORY: fixed typo
* formatting and logging improvements:
  * added timestamp to the beginning of log files (`.urchin.log`)
  * captured output from failed tests is now printed in *red* to draw attention
  * test summary now prints the number of failed tests in the appropriate color for instant feedback (green, if none failed; red, otherwise)
* cleanup
  * removed unused test files, simplified some tests
2014-10-16 16:37:51 -04:00
David Jones
0587a615f3 Document the non zero exit code case. 2014-03-17 14:00:30 +00:00
David Jones
b95b010c0d Set the exit status to reflect pass/fail.
For Travis compatibility, we set the exit code to non-zero when
any tests fail.

Fixes #5.
2014-03-17 13:43:13 +00:00
David Jones
8d53676743 Ensure we can cd into directories starting with a hyphen. Fixes #3. 2013-07-26 12:51:01 +01:00
David Jones
153b04b462 Merge branch 'master' of github.com:scraperwiki/urchin 2013-07-02 09:25:49 +01:00
David Jones
c2f4d92704 Hide fixtures directory. 2013-06-28 10:58:25 +01:00
Thomas Levine
a749c8dae3 fix urchin call in XSD test 2013-06-27 11:45:05 -07:00
David Jones
222ba59d69 Test for singular. 2013-06-20 18:43:11 +01:00
Thomas Levine
0c6837cfbd blah 2012-10-11 15:47:08 -04:00
Thomas Levine
b0a0821124 rename tests 2012-10-11 15:32:07 -04:00
Thomas Levine
9beaa250df remove mac test 2012-10-11 14:52:39 -04:00
Thomas Levine
a9558acec0 fullpath 2012-10-11 14:50:03 -04:00
Thomas Levine
60b0c12697 rm wrong thing 2012-10-11 14:34:57 -04:00
Thomas Levine
2da1544152 tests 2012-10-11 14:34:17 -04:00
Thomas Levine
f85970e7a8 improve readlink degredation 2012-10-11 14:25:40 -04:00
Thomas Levine
f0e034b91f rename files because of the new molly guard 2012-10-11 02:03:52 -04:00
Thomas Levine
fb0cde3f21 change test 2012-10-11 01:46:38 -04:00
Thomas Levine
a6d223d0e8 start xsd tests 2012-10-11 01:25:10 -04:00
Thomas Levine
99ae54e992 counting 2012-10-11 01:10:43 -04:00
Thomas Levine
43055117df count successes and failures 2012-10-11 00:56:18 -04:00
Thomas Levine
51e1e54bcf flag documentation 2012-10-11 00:49:05 -04:00
Thomas Levine
f776f4174b fix the 2 thing 2012-10-11 00:46:52 -04:00
Thomas Levine
c89dbb09cb aoeu 2012-10-11 00:43:23 -04:00
Thomas Levine
fb1956880b more counting 2012-10-11 00:40:54 -04:00
Thomas Levine
662a6efb2f examples 2012-10-11 00:21:43 -04:00
Thomas Levine
878f29cecb check failureness 2012-10-11 00:17:44 -04:00
Thomas Levine
91615b6b39 exit codes 2012-10-11 00:05:02 -04:00
Thomas Levine
74f4702282 more on exit code 2012-10-11 00:01:07 -04:00
Thomas Levine
04c49b08db testing flags 2012-10-10 23:58:58 -04:00
Thomas Levine
45df979ec5 setup sourcing test 2012-10-08 10:29:15 -04:00
Thomas Levine
8353a54df4 chmod +x setup teardown 2012-10-08 10:18:59 -04:00
Thomas Levine
f57ee0d217 print name of failing test 2012-10-08 09:26:44 -04:00
Thomas Levine
6685bc6182 run executable stuff 2012-10-08 08:59:14 -04:00
Thomas Levine
05c478baa9 meta-tests 2012-10-08 08:50:48 -04:00