Compare commits
5 Commits
master
...
single-fil
Author | SHA1 | Date | |
---|---|---|---|
|
a4d09016ab | ||
|
499b6ee131 | ||
|
fb2a8e72e6 | ||
|
e7d5a35409 | ||
|
5aba84246f |
15
HISTORY
15
HISTORY
@ -4,9 +4,11 @@ HISTORY
|
||||
Version 0.0.7
|
||||
---------------------
|
||||
|
||||
### Molly-guard
|
||||
The Molly-guard is now more accepting. For example, you no longer need to
|
||||
pass -f in this case: https://github.com/creationix/nvm/issues/357
|
||||
|
||||
### Skipping tests
|
||||
Previously, tests were run if they were executable and were otherwise marked
|
||||
as skipped. Now, an executable script can indicate that it is skipped by
|
||||
exiting with code 3. For example, if a test requires some dependancy, it
|
||||
@ -24,6 +26,19 @@ would the appropriate status code if these tests were Nagios plugins, as the
|
||||
concept of skipping a test is similar to the Nagios concept of unknown service
|
||||
status (https://nagios-plugins.org/doc/guidelines.html#AEN78).
|
||||
|
||||
### Run on a file
|
||||
It is now possible to run urchin on a single file.
|
||||
This occurred to me when I wanted to run
|
||||
|
||||
urchin test/fast/Unit\ tests/nvm_ls_current
|
||||
|
||||
on the nvm tests. I wound up running this instead.
|
||||
|
||||
urchin test/fast/Unit\ tests/ | grep nvm_ls_current
|
||||
|
||||
The Molly guard is assessed, and the corresponding setup, setup_dir,
|
||||
teardown, and teardown_dir files are run in the appropriate order.
|
||||
|
||||
Version 0.0.6
|
||||
---------------------
|
||||
|
||||
|
16
TODO
16
TODO
@ -123,22 +123,6 @@ cleanly create and teardown temporary files.
|
||||
On the other hand, this could just be sourced explicitly in the test file,
|
||||
without the special setup and teardown feature.
|
||||
|
||||
Run on a file
|
||||
----------------
|
||||
Presently you can run urchin only on a directory.
|
||||
It would be neat if you could run it on a file as well.
|
||||
|
||||
This occurred to me when I wanted to run
|
||||
|
||||
urchin test/fast/Unit\ tests/nvm_ls_current
|
||||
|
||||
on the nvm tests. I wound up running this instead.
|
||||
|
||||
urchin test/fast/Unit\ tests/ | grep nvm_ls_current
|
||||
|
||||
The Molly guard would be assessed, and the corresponding setup, setup_dir,
|
||||
teardown, and teardown_dir files would be run in the appropriate order.
|
||||
|
||||
Running automated tasks
|
||||
-------------------------
|
||||
Urchin might be appropriate for if you have lots of tasks that you want to run
|
||||
|
0
tests/Single file/.test
Executable file
0
tests/Single file/.test
Executable file
1
tests/Single file/.wrappers/setup
Executable file
1
tests/Single file/.wrappers/setup
Executable file
@ -0,0 +1 @@
|
||||
echo setup
|
1
tests/Single file/.wrappers/setup_dir
Executable file
1
tests/Single file/.wrappers/setup_dir
Executable file
@ -0,0 +1 @@
|
||||
echo setup_dir
|
1
tests/Single file/.wrappers/teardown
Executable file
1
tests/Single file/.wrappers/teardown
Executable file
@ -0,0 +1 @@
|
||||
echo teardown
|
1
tests/Single file/.wrappers/teardown_dir
Executable file
1
tests/Single file/.wrappers/teardown_dir
Executable file
@ -0,0 +1 @@
|
||||
echo teardown_dir
|
2
tests/Single file/.wrappers/thetest
Executable file
2
tests/Single file/.wrappers/thetest
Executable file
@ -0,0 +1,2 @@
|
||||
echo thetest
|
||||
exit 1
|
3
tests/Single file/Run on a single file.
Executable file
3
tests/Single file/Run on a single file.
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
../../urchin .test
|
||||
# This will exit 0 if it worked.
|
2
tests/Single file/The file must exist.
Executable file
2
tests/Single file/The file must exist.
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
! ../../urchin not-a-file
|
4
tests/Single file/The wrappers should be run.
Normal file
4
tests/Single file/The wrappers should be run.
Normal file
@ -0,0 +1,4 @@
|
||||
tmp=$(mktemp)
|
||||
echo "Using temp file $tmp"
|
||||
../../urchin .wrappers > $tmp
|
||||
diff $tmp .wrapper-expectation
|
31
urchin
31
urchin
@ -16,13 +16,6 @@ unset CDPATH
|
||||
# Urchin version number
|
||||
VERSION=0.0.6
|
||||
|
||||
fullpath() {
|
||||
(
|
||||
cd -- "$1"
|
||||
pwd
|
||||
)
|
||||
}
|
||||
|
||||
indent() {
|
||||
level="$1"
|
||||
if test "$level" -gt 0; then
|
||||
@ -298,21 +291,17 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
# Verify argument for main stuff
|
||||
if [ "$#" != '1' ] || [ ! -d "$1" ]
|
||||
then
|
||||
[ -n "$1" ] && [ ! -d "$1" ] && echo "Not a directory: '$1'" >&2
|
||||
echo "$USAGE" >&2
|
||||
exit 11
|
||||
fi
|
||||
|
||||
# Constants
|
||||
logfile=$(fullpath "$1")/.urchin.log
|
||||
stdout_file=$(fullpath "$1")/.urchin_stdout
|
||||
|
||||
# Run or present the Molly guard.
|
||||
if fullpath "$1" | grep -Fi 'test' > /dev/null || $force
|
||||
then
|
||||
thetest=$(readlink -f "$1")
|
||||
if echo "$thetest" | grep -Fi 'test' > /dev/null || $force; then
|
||||
if test -d "$1"; then
|
||||
d="$thetest"
|
||||
else
|
||||
d=$(echo "$thetest" | sed 's/\/[^\/]\{1,\}$//')
|
||||
cd "$d"
|
||||
fi
|
||||
logfile="$d/.urchin.log"
|
||||
stdout_file="$d/.urchin_stdout"
|
||||
urchin_go "$1" "$shell_for_sh_tests"
|
||||
else
|
||||
urchin_molly_guard
|
||||
|
Loading…
Reference in New Issue
Block a user