[PATCH 1/5] Add unittest framework for common


Ian Bell <IBell@...>
 

From 39c85ec4d82fe063d0ea61ff7bd3863ae57cd12a Mon Sep 17 00:00:00 2001

Message-Id: <39c85ec4d82fe063d0ea61ff7bd3863ae57cd12a.1351009358.git.ibell@...>

From: Ian Bell <ibell@...>

Date: Tue, 23 Oct 2012 11:55:59 +0100

Subject: [PATCH 1/5] Add unittest framework for common

 

Added unittest framework to configure.ac in common in preparation for

adding unittests

 

Signed-off-by: Ian Bell <ibell@...>

---

common/c_cpp/configure.ac |   35 +++++++++++++++++++++++++++++++++++

1 file changed, 35 insertions(+)

 

diff --git a/common/c_cpp/configure.ac b/common/c_cpp/configure.ac

index de1ccf1..8d87ca6 100755

--- a/common/c_cpp/configure.ac

+++ b/common/c_cpp/configure.ac

@@ -94,6 +94,41 @@ AC_CACHE_SAVE

##################################################

 ##################################################

+# UNIT TESTS: --with-unittests

+# Whether or not to build the unit tests

+# GTEST_HOME is the root directory of the gtest installation. It can be

+# specified as an environment variable or as a configure parameter

+##################################################

+UNIT_TEST_HOME=[$GTEST_HOME]

+AC_ARG_WITH(

+    unittests,

+    [AC_HELP_STRING([--with-unittests=DIR],

+                    [Location of the gtest API include/library files in DIR])],

+    [

+     if test -d $withval; then

+         UNIT_TEST_HOME="$withval"

+     fi

+     CPPFLAGS="$CPPFLAGS -I$UNIT_TEST_HOME/include -I$UNIT_TEST_HOME -DWITH_UNITTESTS "

+     AC_CHECK_HEADERS(

+         [$UNIT_TEST_HOME/include/gtest/gtest.h],

+         [

+          LDFLAGS="$LDFLAGS -L$UNIT_TEST_HOME/lib"

+

+      with_unittests=true

+         ],

+         [

+            AC_MSG_ERROR([Valid GTEST installation not found!])

+         ]

+         )

+    ],

+    [

+     with_unittests=false

+    ])

+AM_CONDITIONAL(WITH_UNITTESTS, test x$with_unittests = xtrue)

+

+##################################################

+

+##################################################

#

# PREREQUISITES

#

--

1.7.9.5

 




Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.