File: test_skipping

package info (click to toggle)
bash-unit 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 1,304 kB
  • sloc: sh: 1,134; makefile: 10
file content (27 lines) | stat: -rw-r--r-- 627 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# This test demonstrates some test skipping logic that
# one can implement with bash_unit

todo_will_always_be_skipped() {
  fail "This test is always skipped"
}

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
}

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"
}