[Intel-gfx] [PATCH i-g-t 1/4] tests: Add a hw-tests subdirectory
Petri Latvala
petri.latvala at intel.com
Wed Dec 13 12:58:13 UTC 2017
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 | 2 ++
6 files changed, 82 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 8740f7a4..5c48025b 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 1b9a7b0a..18479722 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 191ac4ce..8ab16a70 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -316,3 +316,5 @@ image_files = [
'pass.png',
]
install_data(sources : image_files, install_dir : pkgdatadir)
+
+subdir('hw-tests')
--
2.14.1
More information about the Intel-gfx
mailing list