diff options
| author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-07-04 00:13:29 +0200 |
|---|---|---|
| committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-07-15 12:28:56 +0200 |
| commit | 765af810baa604fd2cf99e0bf3d885ad7d2e5e52 (patch) | |
| tree | c6da98551a9842f921e2f6b7e8ab00ced3c5b102 /test | |
| parent | bf133a4636cb6d1513e0b1d88a4ebb2e0a56a4eb (diff) | |
| download | nbb-765af810baa604fd2cf99e0bf3d885ad7d2e5e52.tar.gz nbb-765af810baa604fd2cf99e0bf3d885ad7d2e5e52.tar.xz nbb-765af810baa604fd2cf99e0bf3d885ad7d2e5e52.zip | |
Add tests for run-* commands
The sh-* commands are so similar they don't need their
own but same tests, at least for now.
Diffstat (limited to 'test')
| -rw-r--r-- | test/Makefile.am | 1 | ||||
| -rw-r--r-- | test/nbb-runsh.at | 78 |
2 files changed, 79 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 551c7bb..acb26d8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -10,6 +10,7 @@ TESTCASES += nbb-detect.at TESTCASES += nbb-config.at TESTCASES += nbb-scons.at TESTCASES += nbb-automake.at +TESTCASES += nbb-runsh.at # Add more testcases here EXTRA_DIST += $(TESTCASES) diff --git a/test/nbb-runsh.at b/test/nbb-runsh.at new file mode 100644 index 0000000..67a4493 --- /dev/null +++ b/test/nbb-runsh.at @@ -0,0 +1,78 @@ +dnl =================================================================== + +AT_COPYRIGHT([Copyright (C) 2008 Hans Ulrich Niedermann]) +AT_TESTED([nbb]) + +dnl =================================================================== + +dnl Stuff to test: +dnl - (srcdir|builddir|installdir) (do|do not) exist +dnl - sh with simple shell script works +dnl - run with simple shell script works + +dnl =================================================================== + +AT_SETUP([nbb run-src]) +AT_KEYWORDS([nbb runsh run-src]) +AT_WRAP_GIT_AM([dnl +AT_CHECK([dnl +echo "$PWD/test.dir +RUN: @<:@'pwd'@:>@ + in $PWD/test.dir" > expout +cd test.dir && AT_NBB run-src pwd], [0], [expout]) +]) +AT_CLEANUP() + +dnl =================================================================== + +AT_SETUP([nbb run-build: non-existing builddir]) +AT_KEYWORDS([nbb runsh run-build]) +AT_WRAP_GIT_AM([dnl +AT_CHECK([dnl +echo "ERROR: The builddir directory '$PWD/test.dir/_build/master' does not exist" > experr +cd test.dir && AT_NBB run-build pwd], [1], [], [experr]) +]) +AT_CLEANUP() + +dnl =================================================================== + +AT_SETUP([nbb run-install: non-existing installdir]) +AT_KEYWORDS([nbb runsh run-install]) +AT_WRAP_GIT_AM([dnl +AT_CHECK([dnl +echo "ERROR: The installdir directory '$PWD/test.dir/_install/master' does not exist" > experr +cd test.dir && AT_NBB run-install pwd], [1], [], [experr]) +]) +AT_CLEANUP() + +dnl =================================================================== + +AT_SETUP([nbb run-build: after build]) +AT_KEYWORDS([nbb runsh run-build]) +AT_WRAP_GIT_AM([dnl +AT_CHECK([cd test.dir && AT_NBB build], [0], [ignore], [ignore]) +AT_CHECK([dnl +echo "$PWD/test.dir/_build/master +RUN: @<:@'pwd'@:>@ + in $PWD/test.dir/_build/master" > expout +cd test.dir && AT_NBB run-build pwd], [0], [expout]) +]) +AT_CLEANUP() + +dnl =================================================================== + +AT_SETUP([nbb run-install: after install]) +AT_KEYWORDS([nbb runsh run-install]) +AT_WRAP_GIT_AM([dnl +AT_CHECK([cd test.dir && AT_NBB install], [0], [ignore], [ignore]) +AT_CHECK([dnl +echo "$PWD/test.dir/_install/master +RUN: @<:@'pwd'@:>@ + in $PWD/test.dir/_install/master" > expout +cd test.dir && AT_NBB run-install pwd], [0], [expout]) +]) +AT_CLEANUP() + +dnl =================================================================== + + |
