TEST_DEVS=(/dev/nvme0n1 /dev/sdb)
```
-### Test Timeout
+### Excluding Tests
+
+
+The `EXCLUDE` variable is an array of tests or test groups to exclude. This
+corresponds to the `-x` command line option.
+
+```sh
+EXCLUDE=(loop block/001)
+```
+
+Tests specified explicitly on the command line will always run even if they are
+in `EXCLUDE`.
+
+### Quick Runs and Test Timeouts
Many tests can take a long time to run. By setting the `TIMEOUT` variable, you
can limit the runtime of each test to a specific length (in seconds).
```sh
-TIMEOUT=30
+TIMEOUT=60
```
-Note that not all tests honor this timeout.
+Note that not all tests honor this timeout. You can define the `QUICK_RUN`
+variable in addition to `TIMEOUT` to specify that only tests which honor the
+timeout or are otherwise "quick" should run. This corresponds to the `-q`
+command line option.
+
+```sh
+QUICK_RUN=1
+TIMEOUT=30
+```
eval set -- "$TEMP"
unset TEMP
+# Default configuration.
QUICK_RUN=0
EXCLUDE=()
+TEST_DEVS=()
+
+if [[ -r config ]]; then
+ . config
+fi
+
while true; do
case "$1" in
'-q'|'--quick')
QUICK_RUN=1
- TIMEOUT="${2:-30}"
+ # Use the timeout specified on the command line, from
+ # the config, or the default.
+ TIMEOUT="${2:-${TIMEOUT:-30}}"
shift 2
;;
'-x'|'--exclude')
esac
done
-if [[ -r config ]]; then
- . config
-fi
-
-if [[ ! -v TEST_DEVS ]]; then
- TEST_DEVS=()
+if [[ QUICK_RUN -ne 0 && ! -v TIMEOUT ]]; then
+ _error "QUICK_RUN specified without TIMEOUT"
fi
# Convert the exclude list to an associative array.