aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2015-05-25 16:20:27 +0200
committerTharre <tharre3@gmail.com>2015-05-25 16:20:27 +0200
commitc7712dfd7bf2734e339096d3274f5b0bef2b4335 (patch)
tree3b4ce149869e4b3273c1c53dd7194a2ad8b5760e /test
parent91e31ebf711d38830b0b53dc848aa90223f9be1d (diff)
downloadredo-c7712dfd7bf2734e339096d3274f5b0bef2b4335.tar.gz
redo-c7712dfd7bf2734e339096d3274f5b0bef2b4335.tar.xz
redo-c7712dfd7bf2734e339096d3274f5b0bef2b4335.zip
Replace current tests with a hole new test suite
This new test suite is based on just on do scripts, much like apenwarr's redo implementation has done it. This makes tests both simpler and free from any additional dependencies. The naming was also improved a lot. There are also a lot of new tests, and many more to be implemeted later.
Diffstat (limited to 'test')
-rw-r--r--test/always.bats9
-rw-r--r--test/always.do7
-rw-r--r--test/always_test.do3
-rw-r--r--test/args.bats8
-rw-r--r--test/args_test.ext.do3
-rw-r--r--test/fail.bats13
-rw-r--r--test/fail.do2
-rw-r--r--test/no-output.bats8
-rw-r--r--test/no-output_result.do1
-rw-r--r--test/test_helper.bash12
10 files changed, 0 insertions, 66 deletions
diff --git a/test/always.bats b/test/always.bats
deleted file mode 100644
index b6dab37..0000000
--- a/test/always.bats
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bats
-
-load test_helper
-
-@test "check if do-files marked with always really do execute always" {
- skip "Not yet implemented"
- run redo always
- [ $status -eq 0 ] && [ -e always_result ]
-}
diff --git a/test/always.do b/test/always.do
deleted file mode 100644
index 12e16ba..0000000
--- a/test/always.do
+++ /dev/null
@@ -1,7 +0,0 @@
-redo-ifchange always_test
-
-rm always_result
-
-redo-ifchange always_test
-
-rm always_test # TODO: move this to test-helper.bash somehow
diff --git a/test/always_test.do b/test/always_test.do
deleted file mode 100644
index 425ab6d..0000000
--- a/test/always_test.do
+++ /dev/null
@@ -1,3 +0,0 @@
-redo-always
-touch always_result
-echo "Content" > $3
diff --git a/test/args.bats b/test/args.bats
deleted file mode 100644
index 4115b66..0000000
--- a/test/args.bats
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bats
-
-load test_helper
-
-@test "check arguments supplied to .do files" {
- run redo args_test.ext
- [ $status -eq 0 ]
-}
diff --git a/test/args_test.ext.do b/test/args_test.ext.do
deleted file mode 100644
index 588192a..0000000
--- a/test/args_test.ext.do
+++ /dev/null
@@ -1,3 +0,0 @@
-[ "$1" = "args_test.ext" ] &&
-[ "$2" = "args_test" ] &&
-[ "$3" != "args_test.ext" ]
diff --git a/test/fail.bats b/test/fail.bats
deleted file mode 100644
index 1a77ced..0000000
--- a/test/fail.bats
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env bats
-
-load test_helper
-
-@test "invoke with target without do-file" {
- run redo this-does-not-exist
- [ $status -ne 0 ]
-}
-
-@test "invoke with failing do-file" {
- run redo fail
- [ $status -ne 0 ] && [ ! -e fail_result ]
-}
diff --git a/test/fail.do b/test/fail.do
deleted file mode 100644
index f87b607..0000000
--- a/test/fail.do
+++ /dev/null
@@ -1,2 +0,0 @@
-this-shall-fail
-touch fail_result
diff --git a/test/no-output.bats b/test/no-output.bats
deleted file mode 100644
index c492e4f..0000000
--- a/test/no-output.bats
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bats
-
-load test_helper
-
-@test "produce empty result" {
- run redo no-output_result
- [ $status -eq 0 ] && [ ! -e no-output_result ]
-}
diff --git a/test/no-output_result.do b/test/no-output_result.do
deleted file mode 100644
index b58ff30..0000000
--- a/test/no-output_result.do
+++ /dev/null
@@ -1 +0,0 @@
-touch $3
diff --git a/test/test_helper.bash b/test/test_helper.bash
deleted file mode 100644
index 2c26399..0000000
--- a/test/test_helper.bash
+++ /dev/null
@@ -1,12 +0,0 @@
-teardown() {
- rm -rf .redo/
-
- # remove all helper files
- for i in *.bats; do
- rm -f "${i%%.*}_result"
- done
-}
-
-setup() {
- cd "$BATS_TEST_DIRNAME"
-}