summaryrefslogtreecommitdiff
path: root/tests/subdir.am
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2021-05-20 19:22:14 -0400
committerChristian Hopps <chopps@gmail.com>2021-06-06 18:03:17 +0000
commitdeca28a33bcd913abeaf03017c52b1d2e9fd50e7 (patch)
treecac3453ef98cab1e6180430a2f2addc0b6a6efdf /tests/subdir.am
parent6198bc98bea5034277de2ef1bec34929c9346894 (diff)
tests: add grpc unit test
Test uses staticd which required some C++ header protections. Additionally, the test also runs in the ubuntu20 docker container as grpc is supported there by the packaging system. Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'tests/subdir.am')
-rw-r--r--tests/subdir.am22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/subdir.am b/tests/subdir.am
index 3996699774..ca477851e3 100644
--- a/tests/subdir.am
+++ b/tests/subdir.am
@@ -106,6 +106,12 @@ check_PROGRAMS = \
$(TESTS_ZEBRA) \
# end
+if GRPC
+check_PROGRAMS += \
+ tests/lib/test_grpc \
+ #end
+endif
+
if ZEROMQ
check_PROGRAMS += \
tests/lib/test_zmq \
@@ -156,9 +162,19 @@ TESTS_CFLAGS = \
# end
# note no -Werror
+TESTS_CXXFLAGS = \
+ $(AC_CXXFLAGS) \
+ $(LIBYANG_CFLAGS) \
+ $(SAN_FLAGS) \
+ # end
+# note no -Werror
+
ALL_TESTS_LDADD = lib/libfrr.la $(LIBCAP)
BGP_TEST_LDADD = bgpd/libbgp.a $(RFPLDADD) $(ALL_TESTS_LDADD) $(LIBYANG_LIBS) -lm
ISISD_TEST_LDADD = isisd/libisis.a $(ALL_TESTS_LDADD)
+if GRPC
+GRPC_TESTS_LDADD = staticd/libstatic.a grpc/libfrrgrpc_pb.la -lgrpc++ -lprotobuf $(ALL_TESTS_LDADD) $(LIBYANG_LIBS) -lm
+endif
OSPFD_TEST_LDADD = ospfd/libfrrospf.a $(ALL_TESTS_LDADD)
OSPF6_TEST_LDADD = ospf6d/libospf6.a $(ALL_TESTS_LDADD)
ZEBRA_TEST_LDADD = zebra/label_manager.o $(ALL_TESTS_LDADD)
@@ -251,6 +267,12 @@ tests_lib_northbound_test_oper_data_CPPFLAGS = $(TESTS_CPPFLAGS)
tests_lib_northbound_test_oper_data_LDADD = $(ALL_TESTS_LDADD)
tests_lib_northbound_test_oper_data_SOURCES = tests/lib/northbound/test_oper_data.c
nodist_tests_lib_northbound_test_oper_data_SOURCES = yang/frr-test-module.yang.c
+if GRPC
+tests_lib_test_grpc_CXXFLAGS = $(WERROR) $(TESTS_CXXFLAGS)
+tests_lib_test_grpc_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_grpc_LDADD = $(GRPC_TESTS_LDADD)
+tests_lib_test_grpc_SOURCES = tests/lib/test_grpc.cpp
+endif
tests_lib_test_assert_CFLAGS = $(TESTS_CFLAGS)
tests_lib_test_assert_CPPFLAGS = $(TESTS_CPPFLAGS)
tests_lib_test_assert_LDADD = $(ALL_TESTS_LDADD)