blob: 08049fab6258fbb8f15ec1bc88bf1bde87f7a808 [file] [log] [blame]
Brad Bishop83c43492017-05-22 22:04:03 -04001include $(top_srcdir)/vars.mk
2
3AM_CPPFLAGS = -iquote$(top_srcdir)/src
4gtest_cflags = $(PTHREAD_CFLAGS)
5gtest_ldadd = -lgtest -lgtest_main -lgmock $(PTHREAD_LIBS)
6
7TEMPLATESEARCH+=${srcdir}/templates
8
9check_PROGRAMS =
Brad Bishop13fd8722017-05-15 12:44:01 -040010noinst_PROGRAMS =
Brad Bishop83c43492017-05-22 22:04:03 -040011BUILT_SOURCES =
12CLEANFILES =
13
14TESTS = $(check_PROGRAMS)
Brad Bishop6522cdc2018-07-10 12:04:04 -040015XFAIL_TESTS = callbacktest
Brad Bishopb6044802017-05-07 23:14:57 -040016
17check_PROGRAMS += pathgentest
18pathgentest_SOURCES = \
19 pathgentest.cpp
20pathgentest_CXXFLAGS = \
21 $(gtest_cflags)
22pathgentest_LDFLAGS = \
23 $(OESDK_TESTCASE_FLAGS)
24pathgentest_LDADD = \
25 ${gtest_ldadd}
26
27BUILT_SOURCES += pathgentest.hpp
28CLEANFILES += pathgentest.hpp
29
30PATH_TEST_GEN_DEPS = \
31 templates/pathgentest.mako.hpp \
32 yaml/pathgentest
33
34pathgentest.hpp: $(PDMGEN) $(PATH_TEST_GEN_DEPS)
35 $(AM_V_GEN) $(PYTHON) $(PDMGEN) \
36 -t pathgentest.mako.hpp \
37 -p "${TEMPLATESEARCH}" \
Brad Bishop2d6586a2017-05-31 19:43:35 -040038 -d ${srcdir}/yaml/pathgentest \
Brad Bishopb6044802017-05-07 23:14:57 -040039 -o $(builddir)/$@ \
40 generate-cpp
Brad Bishopc9e173f2017-05-09 00:23:11 -040041
42check_PROGRAMS += propertygentest
43propertygentest_SOURCES = \
44 propertygentest.cpp
45propertygentest_CXXFLAGS = \
46 $(gtest_cflags)
47propertygentest_LDFLAGS = \
48 $(OESDK_TESTCASE_FLAGS)
49propertygentest_LDADD = \
50 ${gtest_ldadd}
51
52BUILT_SOURCES += propertygentest.hpp
53CLEANFILES += propertygentest.hpp
54
55PROPERTY_TEST_GEN_DEPS = \
56 templates/propertygentest.mako.hpp \
57 yaml/propertygentest
58
59propertygentest.hpp: $(PROPERTY_TEST_GEN_DEPS)
60 $(AM_V_GEN) $(PYTHON) $(PDMGEN) \
61 -t propertygentest.mako.hpp \
62 -p "${TEMPLATESEARCH}" \
Brad Bishop2d6586a2017-05-31 19:43:35 -040063 -d ${srcdir}/yaml/propertygentest \
Brad Bishopc9e173f2017-05-09 00:23:11 -040064 -o $(builddir)/$@ \
65 generate-cpp
Brad Bishop13fd8722017-05-15 12:44:01 -040066
67check_PROGRAMS += propertywatchgentest
68propertywatchgentest_SOURCES = \
69 propertywatchgentest.cpp
70propertywatchgentest_CXXFLAGS = \
71 $(gtest_cflags)
72propertywatchgentest_LDFLAGS = \
73 $(OESDK_TESTCASE_FLAGS)
74propertywatchgentest_LDADD = \
75 ${gtest_ldadd}
76
77BUILT_SOURCES += propertywatchgentest.hpp
78CLEANFILES += propertywatchgentest.hpp
79
80PROPERTY_WATCH_TEST_GEN_DEPS = \
81 templates/propertywatchgentest.mako.hpp \
82 yaml/propertywatchgentest
83
84propertywatchgentest.hpp: $(PROPERTY_WATCH_TEST_GEN_DEPS)
85 $(AM_V_GEN) $(PYTHON) $(PDMGEN) \
86 -t propertywatchgentest.mako.hpp \
87 -p "${TEMPLATESEARCH}" \
Brad Bishop2d6586a2017-05-31 19:43:35 -040088 -d ${srcdir}/yaml/propertywatchgentest \
Brad Bishop13fd8722017-05-15 12:44:01 -040089 -o $(builddir)/$@ \
90 generate-cpp
91
92# propertywatchtest is intentionally omitted from
93# check_PROGRAMS until a bug that manifests with
94# with GCC7 can be resolved.
95
96noinst_PROGRAMS += propertywatchtest
97propertywatchtest_SOURCES = \
98 propertywatchtest.cpp
99propertywatchtest_CXXFLAGS = \
100 $(gtest_cflags) \
101 ${SDBUSPLUS_CFLAGS}
102propertywatchtest_LDFLAGS = \
103 $(OESDK_TESTCASE_FLAGS)
104propertywatchtest_LDADD = \
105 ${gtest_ldadd} \
106 ${SDBUSPLUS_LIBS} \
107 $(builddir)/../propertywatch.o
Brad Bishop3ce5c482017-05-25 21:31:58 -0400108
109check_PROGRAMS += callbackgentest
110callbackgentest_SOURCES = \
111 callbackgentest.cpp
112callbackgentest_CXXFLAGS = \
113 $(gtest_cflags)
114callbackgentest_LDFLAGS = \
115 $(OESDK_TESTCASE_FLAGS)
116callbackgentest_LDADD = \
117 ${gtest_ldadd}
118
119BUILT_SOURCES += callbackgentest.hpp
120CLEANFILES += callbackgentest.hpp
121
122CALLBACK_TEST_GEN_DEPS = \
123 templates/callbackgentest.mako.hpp \
124 yaml/callbackgentest
125
126callbackgentest.hpp: $(CALLBACK_TEST_GEN_DEPS)
127 $(AM_V_GEN) $(PYTHON) $(PDMGEN) \
128 -t callbackgentest.mako.hpp \
129 -p "${TEMPLATESEARCH}" \
Brad Bishop2d6586a2017-05-31 19:43:35 -0400130 -d ${srcdir}/yaml/callbackgentest \
Brad Bishop3ce5c482017-05-25 21:31:58 -0400131 -o $(builddir)/$@ \
132 generate-cpp
Brad Bishop731171a2017-05-25 21:49:32 -0400133
134check_PROGRAMS += callbackgroupgentest
135callbackgroupgentest_SOURCES = \
136 callbackgroupgentest.cpp
137callbackgroupgentest_CXXFLAGS = \
138 $(gtest_cflags)
139callbackgroupgentest_LDFLAGS = \
140 $(OESDK_TESTCASE_FLAGS)
141callbackgroupgentest_LDADD = \
142 ${gtest_ldadd}
143
144BUILT_SOURCES += callbackgroupgentest.hpp
145CLEANFILES += callbackgroupgentest.hpp
146
147CALLBACKGROUP_TEST_GEN_DEPS = \
148 templates/callbackgroupgentest.mako.hpp \
149 yaml/callbackgroupgentest
150
151callbackgroupgentest.hpp: $(CALLBACKGROUP_TEST_GEN_DEPS)
152 $(AM_V_GEN) $(PYTHON) $(PDMGEN) \
153 -t callbackgroupgentest.mako.hpp \
154 -p "${TEMPLATESEARCH}" \
Brad Bishop2d6586a2017-05-31 19:43:35 -0400155 -d ${srcdir}/yaml/callbackgroupgentest \
Brad Bishop731171a2017-05-25 21:49:32 -0400156 -o $(builddir)/$@ \
157 generate-cpp
Brad Bishopb97bfff2017-05-25 22:14:54 -0400158
159check_PROGRAMS += conditiongentest
160conditiongentest_SOURCES = \
161 conditiongentest.cpp
162conditiongentest_CXXFLAGS = \
163 $(gtest_cflags)
164conditiongentest_LDFLAGS = \
165 $(OESDK_TESTCASE_FLAGS)
166conditiongentest_LDADD = \
167 ${gtest_ldadd}
168
169BUILT_SOURCES += conditiongentest.hpp
170CLEANFILES += conditiongentest.hpp
171
172CONDITION_TEST_GEN_DEPS = \
173 templates/conditiongentest.mako.hpp \
174 yaml/conditiongentest
175
176conditiongentest.hpp: $(CONDITION_TEST_GEN_DEPS)
177 $(AM_V_GEN) $(PYTHON) $(PDMGEN) \
178 -t conditiongentest.mako.hpp \
179 -p "${TEMPLATESEARCH}" \
Brad Bishop2d6586a2017-05-31 19:43:35 -0400180 -d ${srcdir}/yaml/conditiongentest \
Brad Bishopb97bfff2017-05-25 22:14:54 -0400181 -o $(builddir)/$@ \
182 generate-cpp
Brad Bishop18b228e2017-05-31 21:34:39 -0400183
184check_PROGRAMS += callbacktest
185callbacktest_SOURCES = \
186 callbacktest.cpp
187callbacktest_CXXFLAGS = \
188 $(gtest_cflags)
Gunnar Mills2c11e452017-08-14 16:13:32 -0500189 $(SDBUSPLUS_CFLAGS) \
190 $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
191 $(PHOSPHOR_LOGGING_CFLAGS)
Brad Bishop18b228e2017-05-31 21:34:39 -0400192callbacktest_LDFLAGS = \
193 $(OESDK_TESTCASE_FLAGS)
194callbacktest_LDADD = \
195 ${gtest_ldadd} \
196 ${SDBUSPLUS_LIBS} \
Gunnar Mills2c11e452017-08-14 16:13:32 -0500197 $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
198 $(PHOSPHOR_LOGGING_LIBS) \
199 $(builddir)/../journal.o \
Matt Spinler56fd8332017-10-31 14:00:18 -0500200 $(builddir)/../elog.o \
Ratan Gupta3e84ec62017-10-06 21:37:01 +0530201 $(builddir)/../resolve_errors.o \
202 $(builddir)/../event_manager.o \
Dhruvaraj Subhashchandran6524b9d2017-10-18 01:41:51 -0500203 $(builddir)/../event_serialize.o \
Ratan Gupta3e84ec62017-10-06 21:37:01 +0530204 -lstdc++fs
Marri Devender Raoe5576bf2018-04-16 05:56:11 -0500205
206check_PROGRAMS += interfaceaddtest
207interfaceaddtest_SOURCES = \
208 interfaceaddtest.cpp
209interfaceaddtest_CXXFLAGS = \
210 $(gtest_cflags)
211interfaceaddtest_LDFLAGS = \
212 $(OESDK_TESTCASE_FLAGS)
213interfaceaddtest_LDADD = \
214 ${gtest_ldadd}
215
216BUILT_SOURCES += interfaceaddtest.hpp
217CLEANFILES += interfaceaddtest.hpp
218
219INTERFACEADD_TEST_GEN_DEPS = \
220 templates/interfaceaddtest.mako.hpp \
221 yaml/interfaceaddtest
222
223interfaceaddtest.hpp: $(PDMGEN) $(INTERFACEADD_TEST_GEN_DEPS)
224 $(AM_V_GEN) $(PYTHON) $(PDMGEN) \
225 -t interfaceaddtest.mako.hpp \
226 -p "${TEMPLATESEARCH}" \
227 -d ${srcdir}/yaml/interfaceaddtest \
228 -o $(builddir)/$@ \
229 generate-cpp