1#
2# Test Makefile
3#
4
5# TODO (b/175919480) - General improvements to make adding tests easier
6# - How best to configure it at build time? For example, is it sufficient
7#   to supply an env var when invoking make, or would a different build
8#   target be useful (similar to how we have *_debug targets)?
9# - How can we add tests for one specific platform without impacting a
10#   different platform where it doesn't apply (and may not compile)?
11# - Can we also loop in tests for common code, which are currently
12#   executed off-target via ./run_tests.sh (those added via GOOGLETEST_SRCS,
13#   e.g. core/tests/*, util/tests/*)
14
15ifeq ($(CHRE_ON_DEVICE_TESTS_ENABLED),true)
16include $(CHRE_PREFIX)/build/pw_unit_test.mk
17COMMON_CFLAGS += $(PW_UT_CFLAGS)
18COMMON_CFLAGS += -I$(CHRE_PREFIX)/test/common/include
19COMMON_SRCS += $(CHRE_PREFIX)/test/common/run_tests.cc
20
21COMMON_CFLAGS += -DCHRE_ON_DEVICE_TESTS_ENABLED
22
23COMMON_SRCS += $(PW_UT_SRCS)
24
25# Core unit tests
26COMMON_SRCS += $(CHRE_PREFIX)/core/tests/audio_util_test.cc
27COMMON_SRCS += $(CHRE_PREFIX)/core/tests/memory_manager_test.cc
28COMMON_SRCS += $(CHRE_PREFIX)/core/tests/request_multiplexer_test.cc
29COMMON_SRCS += $(CHRE_PREFIX)/core/tests/sensor_request_test.cc
30COMMON_SRCS += $(CHRE_PREFIX)/core/tests/wifi_scan_request_test.cc
31
32# CHPP tests
33COMMON_SRCS += $(CHRE_PREFIX)/chpp/test/wifi_convert_test.cpp
34COMMON_SRCS += $(CHRE_PREFIX)/chpp/test/wwan_convert_test.cpp
35
36# PAL unit tests
37COMMON_CFLAGS += -I$(CHRE_PREFIX)/pal/tests/include
38
39COMMON_SRCS += $(CHRE_PREFIX)/pal/tests/src/version_test.cc
40COMMON_SRCS += $(CHRE_PREFIX)/pal/tests/src/wwan_test.cc
41
42endif
43