summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2018-03-14 17:59:10 -0700
committerPetri Latvala <petri.latvala@intel.com>2018-03-21 13:12:28 +0200
commit060c7e4f5a3622e01a25aebfeac5c6d1e3832a8c (patch)
tree4e169396d0a5fef3709f562280cfa028616cdd1c /scripts
parent28594986b2909f9c9f362de7fb1ee0ebea1f96a1 (diff)
run-tests.sh: use meson build by default
This makes scripts/run-tests.sh to look into a build dir by default, looking for the test lists. With this we can run the script after building i-g-t with meson without having to resort to the environment variable. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/run-tests.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index 230250dd..fe153934 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -24,22 +24,30 @@
ROOT="`dirname $0`"
ROOT="`readlink -f $ROOT/..`"
-IGT_TEST_ROOT="`readlink -f ${IGT_TEST_ROOT:-$ROOT/tests}`"
IGT_CONFIG_PATH="`readlink -f ${IGT_CONFIG_PATH:-$HOME/.igtrc}`"
RESULTS="$ROOT/results"
PIGLIT=`which piglit 2> /dev/null`
-if [ ! -d "$IGT_TEST_ROOT" ]; then
- echo "Error: could not find tests directory."
- exit 1
+if [ -z "$IGT_TEST_ROOT" ]; then
+ paths=("$ROOT/build/tests/test-list.txt"
+ "$ROOT/tests/test-list.txt")
+ for p in "${paths[@]}"; do
+ if [ -f "$p" ]; then
+ echo "Found test list: \"$p\""
+ IGT_TEST_ROOT=$(dirname "$p")
+ break
+ fi
+ done
fi
-if [ ! -f "$IGT_TEST_ROOT/test-list.txt" ]; then
+if [ -z "$IGT_TEST_ROOT" ]; then
echo "Error: test list not found."
- echo "Please run make in the tests directory to generate the test list."
+ echo "Please build tests to generate the test list or use IGT_TEST_ROOT env var."
exit 1
fi
+IGT_TEST_ROOT="`readlink -f ${IGT_TEST_ROOT}`"
+
function download_piglit {
git clone git://anongit.freedesktop.org/piglit "$ROOT/piglit"
}