From c7712dfd7bf2734e339096d3274f5b0bef2b4335 Mon Sep 17 00:00:00 2001 From: Tharre Date: Mon, 25 May 2015 16:20:27 +0200 Subject: 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. --- test/always.bats | 9 --------- test/always.do | 7 ------- test/always_test.do | 3 --- test/args.bats | 8 -------- test/args_test.ext.do | 3 --- test/fail.bats | 13 ------------- test/fail.do | 2 -- test/no-output.bats | 8 -------- test/no-output_result.do | 1 - test/test_helper.bash | 12 ------------ 10 files changed, 66 deletions(-) delete mode 100644 test/always.bats delete mode 100644 test/always.do delete mode 100644 test/always_test.do delete mode 100644 test/args.bats delete mode 100644 test/args_test.ext.do delete mode 100644 test/fail.bats delete mode 100644 test/fail.do delete mode 100644 test/no-output.bats delete mode 100644 test/no-output_result.do delete mode 100644 test/test_helper.bash (limited to 'test') 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" -} -- cgit v1.2.3-70-g09d2