-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunit.sh
executable file
·36 lines (32 loc) · 1015 Bytes
/
unit.sh
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
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Script for setting up the test environment and running the dock-init shpec
# tests. Note: this should be the only way that tests are run as it is
# responsible for exporting specific varibales that, if not set, will stop the
# tests from running.
#
# Finally you can pass a specific path to the test runner by passing the glob
# path as the first argument to the script, for example:
#
# $ bash unit.sh test/util/log.sh
#
# will only run the specific `test/util/log.sh` test. Another example:
#
# $ bash unit.sh test/util/*.sh
#
# will run all tests in the the `test/util` directory.
#
# @author Ryan Sandor Richards
export LOG_LEVEL=none
export DOCK_INIT_BASE=$(pwd)
export HOST_IP='127.0.0.1'
export USE_EXIT=true
# See if the user passed a spcific test path
test_path="$1"
if [[ "$test_path" == "" ]]; then
# TODO Flesh out tests and add test/*.sh
test_path1="test/*.sh"
test_path2="test/*/*.sh"
test_path="$test_path1 $test_path2"
fi
# Run the tests using shpec
shpec "$test_path"