-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest
executable file
·48 lines (44 loc) · 2.05 KB
/
Test
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
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
#
# Test - test only t8dev stuff (and not all of it)
#
# This is usually expected to be run in a "parent" environment (i.e.,
# where on entry T8_PROJDIR points to a developer's repo) that includes
# this as a submodule, and it will run the t8dev pytest tests in that
# parent environment. (Developers may also simply chose to add
# t8dev/src/ to their own pytest runs.)
#
# It may also be run stand-alone (i.e., where T8_PROJDIR is not set on
# entry) which will instead do a minimal install and build of t8dev
# software and run pytest.
#
set -Eeuo pipefail
trap 'ec=$?; echo 1>&2 "INTERNAL ERROR: ec=$ec line=$LINENO cmd=$BASH_COMMAND";
exit $ec;' ERR
# We build/test using the existing project's virtualenv etc. if present.
[[ -n ${T8_PROJDIR:-} ]] || {
echo "WARNING: \$T8_PROJDIR not set; building local copy."
export T8_PROJDIR=$(cd "$(dirname "$0")" && pwd -P)
. "$T8_PROJDIR"/t8dev/t8setup.bash
}
# The following is the bare mininum to run the pytest tests. We should be
# testing builds of all of the toolsets and emulator startups, though for
# the latter we should not actually be starting emulators we can't run
# non-interactively, but just doing our best to make sure that they're
# there.
t8dev toolset asl
t8dev asl t8dev
# When pytest is run from _this_ script, as opposed to a Test script in a
# parent directory or when using a parent virtualenv from a development
# repo that includes this as a Git submodule (even if CWD is in or under
# this directory, but T8_PROJDIR is set to the parent dir), we want to
# act as if we are a standalone `t8dev` repo to test.
#
# Thus here we set rootdir explicitly to T8_PROJDIR (using either the
# actual preset T8_PROJDIR or the default of this dir that we set above)
# and set our config file to /dev/null because we do not want pytest
# searching for config files above us that may not be applicable to
# this "standalone" test configuration.
#
pytest --rootdir="$T8_PROJDIR" --config-file=/dev/null -q "$@"
"$(dirname "$0")/r8format/Functest"