[igt-dev] [PATCH i-g-t 1/3] tests: Add a hw-tests subdirectory

Katarzyna Dec katarzyna.dec at intel.com
Tue Jun 12 06:56:23 UTC 2018


From: Petri Latvala <petri.latvala at intel.com>

The hw-tests subdirectory is meant for tests that target the
hardware's behaviour without the kernel having much say in
matters. Tests in the directory are not meant for regular CI runs, and
running them requires setting IGT_TEST_ROOT to that directory when
using piglit.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Antonio Argenziano <antonio.argenziano at intel.com>
---
 configure.ac                    | 12 ++++++++++++
 tests/Makefile.am               |  2 +-
 tests/hw-tests/Makefile.am      | 41 +++++++++++++++++++++++++++++++++++++++++
 tests/hw-tests/Makefile.sources |  2 ++
 tests/hw-tests/meson.build      | 24 ++++++++++++++++++++++++
 tests/meson.build               |  1 +
 6 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 tests/hw-tests/Makefile.am
 create mode 100644 tests/hw-tests/Makefile.sources
 create mode 100644 tests/hw-tests/meson.build

diff --git a/configure.ac b/configure.ac
index 2f6bc70e..56e7554d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -374,6 +374,16 @@ if test "x$BUILD_TESTS" = xyes; then
 	AC_DEFINE(BUILD_TESTS, 1, [Build tests])
 fi
 AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" = xyes])
+
+AC_ARG_ENABLE(hw_tests,
+             AS_HELP_STRING([--disable-hw-tests],
+             [Disable HW tests build (default: enabled)]),
+             [BUILD_HW_TESTS=$enableval], [BUILD_HW_TESTS="yes"])
+if test "x$BUILD_TESTS" = xyes; then
+       AC_DEFINE(BUILD_HW_TESTS, 1, [Build hw tests])
+fi
+AM_CONDITIONAL(BUILD_HW_TESTS, [test "x$BUILD_HW_TESTS" = xyes])
+
 AC_DEFINE_UNQUOTED(TARGET_CPU_PLATFORM, ["$host_cpu"], [Target platform])
 
 files="broadwell cherryview haswell ivybridge sandybridge valleyview skylake"
@@ -397,6 +407,7 @@ AC_CONFIG_FILES([
 		 man/Makefile
 		 scripts/Makefile
 		 tests/Makefile
+		 tests/hw-tests/Makefile
 		 tests/intel-ci/Makefile
 		 tools/Makefile
 		 tools/null_state_gen/Makefile
@@ -423,6 +434,7 @@ echo "Intel GPU tools"
 echo ""
 echo " • Tests:"
 echo "       Build tests        : ${BUILD_TESTS}"
+echo "       Build HW tests     : ${BUILD_HW_TESTS}"
 echo "       Chamelium tests    : ${enable_chamelium}"
 echo "       Audio tests        : ${enable_audio}"
 echo "       Compile prime tests: ${NOUVEAU}"
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f41ad509..277b07fd 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@
 include Makefile.sources
 
-SUBDIRS = intel-ci
+SUBDIRS = hw-tests intel-ci
 
 if HAVE_LIBDRM_AMDGPU
     TESTS_progs += $(AMDGPU_TESTS)
diff --git a/tests/hw-tests/Makefile.am b/tests/hw-tests/Makefile.am
new file mode 100644
index 00000000..434ff695
--- /dev/null
+++ b/tests/hw-tests/Makefile.am
@@ -0,0 +1,41 @@
+include Makefile.sources
+
+if BUILD_HW_TESTS
+test-list.txt: Makefile
+	@echo TESTLIST > $@
+	@echo ${hw_tests} >> $@
+	@echo END TESTLIST >> $@
+
+hwtests_libexecdir = $(pkglibexecdir)/hw-tests
+hwtests_libexec_DATA = \
+	test-list.txt \
+	$(NULL)
+hwtests_libexec_PROGRAMS = $(hw_tests)
+
+all-local: .gitignore
+.gitignore: Makefile.sources
+	@echo "$(hw_tests) test-list.txt /.gitignore" | sed 's/\s\+/\n/g' | sort > $@
+
+EXTRA_DIST = \
+	meson.build \
+	$(NULL)
+
+CLEANFILES = test-list.txt .gitignore
+
+AM_CFLAGS = $(CWARNFLAGS) -Wno-unused-result $(DEBUG_CFLAGS)\
+	-I$(top_srcdir)/include/drm-uapi \
+	-I$(srcdir)/.. \
+	-I$(top_srcdir)/lib \
+	-include "$(srcdir)/../lib/check-ndebug.h" \
+	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
+	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
+	-D_GNU_SOURCE \
+	$(DRM_CFLAGS) $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) \
+	$(NULL)
+
+LDADD = ../../lib/libintel_tools.la $(XMLRPC_LIBS)
+
+AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS)
+AM_LDFLAGS = -Wl,--as-needed
+
+endif
diff --git a/tests/hw-tests/Makefile.sources b/tests/hw-tests/Makefile.sources
new file mode 100644
index 00000000..a224da7c
--- /dev/null
+++ b/tests/hw-tests/Makefile.sources
@@ -0,0 +1,2 @@
+hw_tests = \
+	 $(NULL)
diff --git a/tests/hw-tests/meson.build b/tests/hw-tests/meson.build
new file mode 100644
index 00000000..32bb637d
--- /dev/null
+++ b/tests/hw-tests/meson.build
@@ -0,0 +1,24 @@
+hw_test_progs = [
+]
+
+hw_test_deps = [ igt_deps ]
+
+# TODO: Refactoring of all such paths
+hw_libexecdir = join_paths(get_option('libexecdir'), 'intel-gpu-tools', 'hw-tests')
+
+hw_test_executables = []
+
+foreach prog : hw_test_progs
+	hw_test_executables += executable(prog, prog + '.c',
+		   dependencies : test_deps,
+		   install_dir : hw_libexecdir,
+		   install : true)
+endforeach
+
+hw_pkgdatadir = join_paths(get_option('datadir'), 'intel-gpu-tools', 'hw-tests')
+
+hw_test_list = custom_target('hw_testlist',
+	      output : 'test-list.txt',
+	      command : [ gen_testlist, '@OUTPUT@', hw_test_progs ],
+	      install : true,
+	      install_dir : hw_pkgdatadir)
diff --git a/tests/meson.build b/tests/meson.build
index cedb4ff1..bf42424f 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -343,3 +343,4 @@ image_files = [
 install_data(sources : image_files, install_dir : datadir)
 
 subdir('intel-ci')
+subdir('hw-tests')
-- 
2.14.4



More information about the igt-dev mailing list