-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On can now skip some tests in the file if some condition is true.
- Loading branch information
pascal
authored and
pascal
committed
Feb 20, 2024
1 parent
dabb535
commit 0ffe477
Showing
4 changed files
with
63 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
# This test demonstrates some test skipping logic that | ||
# one can implement with bash_unit | ||
|
||
todo_will_always_be_siped() { | ||
todo_will_always_be_skipped() { | ||
fail "This test is always skipped" | ||
} | ||
|
||
if uname | grep Linux | ||
then | ||
test_proc_exists() { | ||
assert "ls /proc/" "there should exist /proc on Linux" | ||
} | ||
test_another_test_to_run_only_on_linux() { | ||
assert "mkdir /tmp/foo/bar -p" | ||
} | ||
fi | ||
skip_if "uname | grep Darwin" linux | ||
skip_if "uname | grep Linux" darwin | ||
|
||
test_linux_proc_exists() { | ||
assert "ls /proc/" "there should exist /proc on Linux" | ||
} | ||
test_another_test_to_run_only_on_linux() { | ||
assert "mkdir /tmp/foo/bar -p" | ||
} | ||
|
||
test_that_always_run() { | ||
assert true | ||
} | ||
|
||
if uname | grep Darwin | ||
then | ||
test_proc_does_not_exist() { | ||
assert_fail "ls /proc/" "there should not exist /proc on Darwin" | ||
} | ||
test_another_test_to_run_only_on_darwin() { | ||
assert "mkdir -p /tmp/foo/bar" | ||
} | ||
fi | ||
test_darwin_proc_does_not_exist() { | ||
assert_fail "ls /proc/" "there should not exist /proc on Darwin" | ||
} | ||
test_another_test_to_run_only_on_darwin() { | ||
assert "mkdir -p /tmp/foo/bar" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters