1# Copyright 2018 The Fuchsia Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5LOCAL_DIR := $(GET_LOCAL_DIR)
6
7# These are the tests that don't require linkage with libc++ since
8# Zircon currently only supports that for the host.
9fit_zircon_friendly_usertests := \
10    $(LOCAL_DIR)/function_tests.cpp \
11    $(LOCAL_DIR)/main.c \
12    $(LOCAL_DIR)/nullable_tests.cpp \
13    $(LOCAL_DIR)/optional_tests.cpp \
14    $(LOCAL_DIR)/result_tests.cpp \
15    $(LOCAL_DIR)/traits_tests.cpp \
16
17fit_tests := \
18    $(fit_zircon_friendly_usertests) \
19    $(LOCAL_DIR)/bridge_tests.cpp \
20    $(LOCAL_DIR)/defer_tests.cpp \
21    $(LOCAL_DIR)/examples/function_example1.cpp \
22    $(LOCAL_DIR)/examples/function_example2.cpp \
23    $(LOCAL_DIR)/examples/promise_example1.cpp \
24    $(LOCAL_DIR)/examples/promise_example2.cpp \
25    $(LOCAL_DIR)/examples/utils.cpp \
26    $(LOCAL_DIR)/function_examples.cpp \
27    $(LOCAL_DIR)/future_tests.cpp \
28    $(LOCAL_DIR)/pending_task_tests.cpp \
29    $(LOCAL_DIR)/promise_examples.cpp \
30    $(LOCAL_DIR)/promise_tests.cpp \
31    $(LOCAL_DIR)/result_examples.cpp \
32    $(LOCAL_DIR)/scheduler_tests.cpp \
33    $(LOCAL_DIR)/scope_tests.cpp \
34    $(LOCAL_DIR)/sequencer_tests.cpp \
35    $(LOCAL_DIR)/single_threaded_executor_tests.cpp \
36    $(LOCAL_DIR)/suspended_task_tests.cpp \
37    $(LOCAL_DIR)/variant_tests.cpp \
38
39# Userspace tests.
40# Disabled for now because libstdc++ isn't available for Zircon targets yet.
41MODULE := $(LOCAL_DIR)
42
43MODULE_TYPE := usertest
44
45MODULE_NAME := fit-test
46
47MODULE_SRCS := $(fit_zircon_friendly_usertests)
48
49MODULE_COMPILEFLAGS += -DFIT_NO_STD_FOR_ZIRCON_USERSPACE
50
51MODULE_STATIC_LIBS := \
52    system/ulib/zxcpp \
53    system/ulib/fit
54
55MODULE_LIBS := \
56    system/ulib/c \
57    system/ulib/fdio \
58    system/ulib/unittest \
59    system/ulib/zircon \
60
61include make/module.mk
62
63# Host tests.
64
65MODULE := $(LOCAL_DIR).hostapp
66
67MODULE_TYPE := hosttest
68
69MODULE_NAME := fit-test
70
71MODULE_SRCS := $(fit_tests)
72
73MODULE_COMPILEFLAGS := \
74    -Isystem/ulib/fit/include \
75    -Isystem/ulib/unittest/include \
76
77MODULE_HOST_LIBS := \
78    system/ulib/fit.hostlib \
79    system/ulib/pretty.hostlib \
80    system/ulib/unittest.hostlib \
81
82include make/module.mk
83
84# Clear local variables.
85
86fit_zircon_friendly_usertests :=
87fit_tests :=
88