[Intel-gfx] [PATCH 05/23] piglit: Add a 'run-tests' Makefile target

Damien Lespiau damien.lespiau at intel.com
Fri Nov 15 17:33:22 CET 2013


Let's start to craft porcelain targets to run the test suite. First
stop, run the piglit tests enumerated by igt.tests.

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 Makefile.am             | 20 ++++++++++++++++++++
 scripts/Makefile.am     |  2 +-
 scripts/build-piglit.sh | 20 ++++++++++++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 scripts/build-piglit.sh

diff --git a/Makefile.am b/Makefile.am
index d7a479c..8611929 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,3 +46,23 @@ ChangeLog:
 	$(CHANGELOG_CMD)
 
 dist-hook: ChangeLog INSTALL
+
+#
+# Useful shortcuts to run tests
+#
+PIGLIT := $(srcdir)/piglit/piglit-run.py
+PIGLIT_SUMMARY := $(srcdir)/piglit/piglit-summary.py -s
+PIGLIT_HTML := $(srcdir)/piglit/piglit-summary-html.py
+IGT_TESTS := $(abs_srcdir)/piglit/tests/igt.tests
+TEST_TARGETS := #
+
+TEST_TARGETS += run-test
+run-tests:
+	@source $(srcdir)/scripts/build-piglit.sh && \
+	output=$$(igt_result_directory) && \
+	$(PIGLIT) $(IGT_TESTS) $$output && \
+	$(PIGLIT_HTML) $$output/html $$output/main && \
+	$(PIGLIT_SUMMARY) $$output/main
+
+
+.PHONY: $(TEST_TARGETS)
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index baf3612..1cabd3f 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1,3 +1,3 @@
 
-dist_noinst_SCRIPTS = who.sh
+dist_noinst_SCRIPTS = who.sh build-piglit.sh
 noinst_PYTHON = throttle.py
diff --git a/scripts/build-piglit.sh b/scripts/build-piglit.sh
new file mode 100644
index 0000000..832b5bf
--- /dev/null
+++ b/scripts/build-piglit.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# This script is sourced by Makefiles to provide various utility functions
+
+function igt_result_directory()
+{
+	suite=$1
+	[ -z "$suite" ] && suite=results
+
+	date=`date +%Y%m%d`
+	base=$date-piglit-$suite
+
+	n=1
+	dir=$base.$n
+	while [ -e "$dir" ]; do
+		let n+=1
+		dir=$base.$n
+	done
+
+	echo $dir
+}
-- 
1.8.3.1




More information about the Intel-gfx mailing list