Rafael Barbalho | 09bcb0a | 2014-01-31 14:57:40 +0000 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 2 | |
Rafael Barbalho | 09bcb0a | 2014-01-31 14:57:40 +0000 | [diff] [blame] | 3 | include $(LOCAL_PATH)/Makefile.sources |
Oscar Mateo | 62e1cbc | 2013-12-13 20:48:24 +0000 | [diff] [blame] | 4 | |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 5 | #================# |
Tim Gore | 41cbe36 | 2014-05-12 13:39:00 +0100 | [diff] [blame] | 6 | # each igt test is a separate executable. define a function to build one of these tests |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 7 | define add_test |
| 8 | include $(CLEAR_VARS) |
| 9 | |
Tim Gore | 41cbe36 | 2014-05-12 13:39:00 +0100 | [diff] [blame] | 10 | # specific to this test |
Rafael Barbalho | 09bcb0a | 2014-01-31 14:57:40 +0000 | [diff] [blame] | 11 | LOCAL_SRC_FILES := $1.c |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 12 | LOCAL_MODULE := $1 |
Tim Gore | 41cbe36 | 2014-05-12 13:39:00 +0100 | [diff] [blame] | 13 | |
| 14 | # common to all tests |
| 15 | LOCAL_CFLAGS += ${IGT_LOCAL_CFLAGS} |
| 16 | LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES} |
| 17 | LOCAL_STATIC_LIBRARIES := ${IGT_LOCAL_STATIC_LIBRARIES} |
| 18 | LOCAL_SHARED_LIBRARIES := ${IGT_LOCAL_SHARED_LIBRARIES} |
| 19 | |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 20 | LOCAL_MODULE_TAGS := optional |
Tim Gore | 0be29da | 2014-05-13 09:34:42 +0100 | [diff] [blame] | 21 | # ask linker to define a specific symbol; we use this to identify IGT tests |
Arkadiusz Hiler | 53e7f53 | 2017-04-12 09:42:47 +0200 | [diff] [blame] | 22 | LOCAL_LDFLAGS := -Wl,--defsym=$2=0 -lkmod |
Derek Morton | d524a96 | 2015-08-13 11:27:35 +0100 | [diff] [blame] | 23 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 24 | |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 25 | include $(BUILD_EXECUTABLE) |
| 26 | endef |
| 27 | |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 28 | |
Tim Gore | 41cbe36 | 2014-05-12 13:39:00 +0100 | [diff] [blame] | 29 | # some tests still do not build under android |
| 30 | skip_tests_list := |
Tim Gore | 41cbe36 | 2014-05-12 13:39:00 +0100 | [diff] [blame] | 31 | skip_tests_list += testdisplay # needs glib.h |
Daniel Vetter | 1c9a5b1 | 2014-05-16 10:33:28 +0200 | [diff] [blame] | 32 | skip_tests_list += pm_rpm |
Tim Gore | 41cbe36 | 2014-05-12 13:39:00 +0100 | [diff] [blame] | 33 | |
| 34 | # set local compilation flags for IGT tests |
| 35 | IGT_LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM -DANDROID -UNDEBUG |
Tim Gore | a11117e | 2014-12-12 12:14:33 +0000 | [diff] [blame] | 36 | IGT_LOCAL_CFLAGS += -include "check-ndebug.h" -std=gnu99 |
Tim Gore | 41cbe36 | 2014-05-12 13:39:00 +0100 | [diff] [blame] | 37 | # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit |
| 38 | IGT_LOCAL_CFLAGS += -Wno-error=return-type |
| 39 | # Excessive complaining for established cases. Rely on the Linux version warnings. |
| 40 | IGT_LOCAL_CFLAGS += -Wno-sign-compare |
| 41 | |
| 42 | # set local includes |
Arkadiusz Hiler | 6047b01 | 2017-04-14 15:10:20 +0200 | [diff] [blame] | 43 | IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \ |
| 44 | $(LOCAL_PATH)/../lib/stubs/drm/ |
Tim Gore | 41cbe36 | 2014-05-12 13:39:00 +0100 | [diff] [blame] | 45 | |
| 46 | # set local libraries |
| 47 | IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools |
Arkadiusz Hiler | 53e7f53 | 2017-04-12 09:42:47 +0200 | [diff] [blame] | 48 | IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libkmod libdrm libdrm_intel |
Tim Gore | 41cbe36 | 2014-05-12 13:39:00 +0100 | [diff] [blame] | 49 | |
| 50 | # handle cairo requirements if it is enabled |
| 51 | ifeq ("${ANDROID_HAS_CAIRO}", "1") |
| 52 | IGT_LOCAL_C_INCLUDES += ${ANDROID_BUILD_TOP}/external/cairo-1.12.16/src |
| 53 | IGT_LOCAL_SHARED_LIBRARIES += libcairo |
| 54 | IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=1 |
| 55 | else |
| 56 | # the following tests depend on cairo, so skip them |
| 57 | skip_tests_list += \ |
Oscar Mateo | 62e1cbc | 2013-12-13 20:48:24 +0000 | [diff] [blame] | 58 | gem_render_copy \ |
Derek Morton | 2da624e | 2016-05-24 15:32:35 +0100 | [diff] [blame] | 59 | pm_lpsp \ |
| 60 | drm_read \ |
| 61 | gem_exec_blt \ |
Arkadiusz Hiler | 4fe47f4 | 2017-04-12 12:35:54 +0200 | [diff] [blame] | 62 | perf \ |
Derek Morton | 2da624e | 2016-05-24 15:32:35 +0100 | [diff] [blame] | 63 | prime_mmap_kms |
Derek Morton | d819b7e | 2015-05-15 11:24:55 +0100 | [diff] [blame] | 64 | |
| 65 | # All kms tests depend on cairo |
| 66 | tmp_list := $(foreach test_name, $(TESTS_progs),\ |
| 67 | $(if $(findstring kms_,$(test_name)),$(test_name))) |
| 68 | skip_tests_list += $(tmp_list) |
| 69 | |
| 70 | tmp_list := $(foreach test_name, $(TESTS_progs_M),\ |
| 71 | $(if $(findstring kms_,$(test_name)),$(test_name))) |
| 72 | skip_tests_list += $(tmp_list) |
| 73 | |
Tim Gore | 41cbe36 | 2014-05-12 13:39:00 +0100 | [diff] [blame] | 74 | IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=0 |
| 75 | endif |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 76 | |
Tim Gore | 0be29da | 2014-05-13 09:34:42 +0100 | [diff] [blame] | 77 | # create two test lists, one for simple single tests, one for tests that have subtests |
| 78 | tests_list := $(filter-out $(skip_tests_list),$(TESTS_progs) $(HANG) $(TESTS_testsuite)) |
| 79 | tests_list_M := $(filter-out $(skip_tests_list),$(TESTS_progs_M)) |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 80 | |
Tim Gore | 0be29da | 2014-05-13 09:34:42 +0100 | [diff] [blame] | 81 | $(foreach item,$(tests_list),$(eval $(call add_test,$(item),"IGT_SINGLE_TEST"))) |
| 82 | $(foreach item,$(tests_list_M),$(eval $(call add_test,$(item),"IGT_MULTI_TEST"))) |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 83 | |