Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
__ _
__ ____________/ /_ (_)___
/ / / / ___/ ___/ __ \/ / __ \
/ /_/ / / / /__/ / / / / / / /
\__,_/_/ \___/_/ /_/_/_/ /_/
Urchin is a test framework for shell. It is implemented in portable /bin/sh and should work on GNU/Linux, Mac OS X, and other Unix platforms.
Urchin's tests are written in Urchin, so you can run them to see what Urchin is like. Clone the repository
git clone git://github.com/scraperwiki/urchin.git
Run the tests
cd urchin
./urchin tests
The above command will run the tests in your systems default shell, /bin/sh (on recent Ubuntu this is dash, but it could be ksh or bash on other systems); to test cross-shell compatibility, run this:
cd urchin
./cross-shell-tests
Download Urchin like so (as root) (or use npm, below):
cd /usr/local/bin
wget https://raw.github.com/scraperwiki/urchin/master/urchin
chmod +x urchin
Can be installed with npm too:
npm install -g urchin
Now you can run it.
urchin <test directory>
Make a root directory for your tests. Inside it, put executable files that
exit 0
on success and something else on fail. Non-executable files and hidden
files (dotfiles) are ignored, so you can store fixtures right next to your
tests. Run urchin from inside the tests directory.
Urchin only cares about the exit status, so you can actually write your tests in any language, not just shell.
Tests are organized recursively in directories, where the names of the files and directories have special meanings.
tests/
setup
setup_dir
bar/
setup
test_that_something_works
teardown
baz/
jack-in-the-box/
setup
test_that_something_works
teardown
cat-in-the-box/
fixtures/
thingy.pdf
test_thingy
teardown
Directories are processed in a depth-first order. When a particular directory
is processed, setup_dir
is run before everything else in the directory, including
subdirectories. teardown_dir
is run after everything else in the directory.
A directory's setup
file, if it exists, is run right before each test file
within the particular directory, and the teardown
file is run right after.
Files are only run if they are executable, and files beginning with .
are
ignored. Thus, fixtures and libraries can be included sloppily within the test
directory tree. The test passes if the file exits 0; otherwise, it fails.
FAQs
Test framework for shell
The npm package urchin receives a total of 1,934 weekly downloads. As such, urchin popularity was classified as popular.
We found that urchin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.