Add configure option to enable building unit tests 34/734/2
authorDamjan Marion <damarion@cisco.com>
Mon, 11 Apr 2016 11:34:36 +0000 (13:34 +0200)
committerGerrit Code Review <gerrit@fd.io>
Mon, 11 Apr 2016 13:03:30 +0000 (13:03 +0000)
Same template should be used for other libs...

Change-Id: Icc771cb6b243d215f30fb51c0dbc028e497a74c6
Signed-off-by: Damjan Marion <damarion@cisco.com>
build-data/packages/vppinfra.mk
build-data/platforms/vpp.mk
vppinfra/Makefile.am
vppinfra/configure.ac

index 9205987..6ca6eb2 100644 (file)
@@ -1,2 +1,5 @@
-# nothing
+
+ifeq ($($(PLATFORM)_enable_tests),yes)
+vppinfra_configure_args += --enable-tests
+endif
 
index 9b4a78c..c3c18ae 100644 (file)
@@ -17,6 +17,9 @@ vpp_native_tools = vppapigen
 
 vpp_uses_dpdk = yes
 
+# Uncoment to enable building unit tests
+# vpp_enable_tests = yes
+
 vpp_root_packages = vpp vlib vlib-api vnet svm vpp-api-test \
        vpp-japi gmod
 
index 3a40016..adcd32c 100644 (file)
@@ -20,7 +20,10 @@ endif
 
 lib_LIBRARIES =
 
-TESTS  =  test_bihash_template \
+TESTS =
+
+if ENABLE_TESTS
+TESTS  +=  test_bihash_template \
           test_elog \
           test_elf \
           test_fifo \
@@ -44,6 +47,7 @@ TESTS =  test_bihash_template \
           test_timing_wheel \
           test_vec \
           test_zvec 
+endif
 
 noinst_PROGRAMS = $(TESTS)
 check_PROGRAMS = $(TESTS)
index d0b3a0c..712186a 100644 (file)
@@ -31,6 +31,13 @@ AC_ARG_WITH(ldflags,
 
 ######################################################################
 
+AC_ARG_ENABLE(tests,
+              AC_HELP_STRING([--enable-tests],[Enable unit tests]),
+              [enable_tests=1],
+              [enable_tests=0])
+
+AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" = "1")
+
 AC_ARG_WITH(unix,
             AC_HELP_STRING([--with-unix],[Compile unix version of clib]),
            [],