lib/igt.cocci: Add s/assert/igt_assert/
[platform/upstream/intel-gpu-tools.git] / tests / Android.mk
1 LOCAL_PATH := $(call my-dir)
2
3 include $(LOCAL_PATH)/Makefile.sources
4
5 #================#
6 # each igt test is a separate executable. define a function to build one of these tests
7 define add_test
8     include $(CLEAR_VARS)
9
10     # specific to this test
11     LOCAL_SRC_FILES := $1.c
12     LOCAL_MODULE := $1
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
20     LOCAL_MODULE_TAGS := optional
21     # ask linker to define a specific symbol; we use this to identify IGT tests
22     LOCAL_LDFLAGS := -Wl,--defsym=$2=0
23     LOCAL_MODULE_PATH := $(ANDROID_PRODUCT_OUT)/$(TARGET_COPY_OUT_VENDOR)/intel/validation/core/igt
24
25     include $(BUILD_EXECUTABLE)
26 endef
27
28
29 # some tests still do not build under android
30 skip_tests_list :=
31 skip_tests_list += testdisplay        # needs glib.h
32 skip_tests_list += pm_rpm
33
34 # set local compilation flags for IGT tests
35 IGT_LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM -DANDROID -UNDEBUG
36 IGT_LOCAL_CFLAGS += -include "check-ndebug.h" -std=c99
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
43 IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib
44 IGT_LOCAL_C_INCLUDES += ${ANDROID_BUILD_TOP}/external/PRIVATE/drm/include/drm
45
46 # set local libraries
47 IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
48 IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libdrm libdrm_intel
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 += \
58     kms_plane \
59     kms_addfb \
60     kms_cursor_crc \
61     kms_flip \
62     kms_flip_tiling \
63     kms_pipe_crc_basic \
64     kms_psr_sink_crc \
65     kms_fbc_crc \
66     kms_setmode \
67     kms_sink_crc_basic \
68     gem_render_copy \
69     pm_lpsp \
70     kms_fence_pin_leak \
71     kms_mmio_vs_cs_flip \
72     kms_render \
73     kms_universal_plane \
74     kms_rotation_crc \
75     kms_force_connector
76     IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=0
77 endif
78
79 # create two test lists, one for simple single tests, one for tests that have subtests
80 tests_list   := $(filter-out $(skip_tests_list),$(TESTS_progs) $(HANG) $(TESTS_testsuite))
81 tests_list_M := $(filter-out $(skip_tests_list),$(TESTS_progs_M))
82
83 $(foreach item,$(tests_list),$(eval $(call add_test,$(item),"IGT_SINGLE_TEST")))
84 $(foreach item,$(tests_list_M),$(eval $(call add_test,$(item),"IGT_MULTI_TEST")))
85