From patchwork Thu Feb 19 22:32:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44857 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 476C121553 for ; Thu, 19 Feb 2015 22:33:17 +0000 (UTC) Received: by wesu56 with SMTP id u56sf1793114wes.1 for ; Thu, 19 Feb 2015 14:33:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=tcj/HpzgyBZRneDC0nLS8ZsSTcxpyCLt31ntDZJlJxQ=; b=GQaH1TuaLjAIh4GYzPOmO3UsCq817BALKQK3+SvMe+5gl27Kz9i94aXyhBg9V1b8FG RXWm4ighiQBCKAj6jRjvnapPqN9jRdgxdjp25XJcKOroDSwMdqWjFEb+ukMqcDCa7vng 9jQcUxGohTctqW0Mpt4XadlZh7XTvC3tI54YvverkjZFHh0zlJ/yTA2V8irnO4RzeXY6 RIlEknZJoGzffno3V+s1SzsQLnUoW6gU3NaIthDk2yznu2TRJkD9wCRCsCLft9Ga5Zkl mwaG5wR0KV+l5ZXxdDzD08IsMCelgH7NZLopWFOAFRahw4yqT4RxcPVOnzLMay5Dmpjv 4HZg== X-Gm-Message-State: ALoCoQm+RZ/zuEBS8/r705EpjbjwmBisiYKdeJjcFp3fKsU/mpJ7npSPEqs4pCjPVdgiCQxU0oA6 X-Received: by 10.152.43.166 with SMTP id x6mr881955lal.3.1424385196566; Thu, 19 Feb 2015 14:33:16 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.164.193 with SMTP id ys1ls219884lab.39.gmail; Thu, 19 Feb 2015 14:33:16 -0800 (PST) X-Received: by 10.112.123.133 with SMTP id ma5mr6065991lbb.122.1424385196337; Thu, 19 Feb 2015 14:33:16 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id da9si15995805lad.115.2015.02.19.14.33.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Feb 2015 14:33:15 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbdu10 with SMTP id u10so2851664lbd.7 for ; Thu, 19 Feb 2015 14:33:15 -0800 (PST) X-Received: by 10.152.116.18 with SMTP id js18mr5998827lab.106.1424385195911; Thu, 19 Feb 2015 14:33:15 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp786059lbj; Thu, 19 Feb 2015 14:33:15 -0800 (PST) X-Received: by 10.140.93.195 with SMTP id d61mr16264679qge.48.1424385194432; Thu, 19 Feb 2015 14:33:14 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id t5si5688997qgd.84.2015.02.19.14.33.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Feb 2015 14:33:14 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YOZec-0003xO-Ow; Thu, 19 Feb 2015 22:33:06 +0000 Received: from mail-qg0-f53.google.com ([209.85.192.53]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YOZeX-0003xJ-Qh for lng-odp@lists.linaro.org; Thu, 19 Feb 2015 22:33:01 +0000 Received: by mail-qg0-f53.google.com with SMTP id f51so10180187qge.12 for ; Thu, 19 Feb 2015 14:32:56 -0800 (PST) X-Received: by 10.140.86.199 with SMTP id p65mr5194947qgd.49.1424385176513; Thu, 19 Feb 2015 14:32:56 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id b9sm6550754qac.22.2015.02.19.14.32.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Feb 2015 14:32:55 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 19 Feb 2015 17:32:20 -0500 Message-Id: <1424385140-20283-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH v2] test: miscellaneous: Add CPP test X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Simon Kagstrom Add conditional test to link and run ODP from a cpp application. Signed-off-by: Simon Kagstrom Signed-off-by: Mike Holmes --- v2 Automatically enable cpp test if the compiler supports it configure.ac | 20 ++++++++++++++++++++ test/Makefile.am | 2 +- test/Makefile.inc | 5 +++-- test/miscellaneous/.gitignore | 1 + test/miscellaneous/Makefile.am | 12 ++++++++++++ test/miscellaneous/gitignore | 1 + test/miscellaneous/odp_api_from_cpp.cpp | 12 ++++++++++++ 7 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 test/miscellaneous/.gitignore create mode 100644 test/miscellaneous/Makefile.am create mode 100644 test/miscellaneous/gitignore create mode 100644 test/miscellaneous/odp_api_from_cpp.cpp diff --git a/configure.ac b/configure.ac index e5c1c56..396ab16 100644 --- a/configure.ac +++ b/configure.ac @@ -13,6 +13,8 @@ AM_SILENT_RULES([yes]) AC_PROG_CC AM_PROG_CC_C_O +AC_PROG_CXX + AC_PROG_INSTALL AC_PROG_MAKE_SET @@ -114,6 +116,22 @@ AC_ARG_ENABLE([test-perf], AM_CONDITIONAL([test_perf], [test x$test_perf = xyes ]) ########################################################################## +# Enable/disable test-cpp +########################################################################## +if test "$GXX" = "yes"; then +test_cpp=yes +else +test_cpp=no +fi +AC_ARG_ENABLE([test-cpp], + [ --enable-test-cpp run basic test aginast cpp], + [if test "x$enableval" = "xyes"; then + test_cpp=yes + fi]) + +AM_CONDITIONAL([test_cpp], [test x$test_cpp = xyes ]) + +########################################################################## # Set optional CUnit path ########################################################################## AC_ARG_WITH([cunit-path], @@ -244,6 +262,7 @@ AC_CONFIG_FILES([Makefile test/api_test/Makefile test/performance/Makefile test/validation/Makefile + test/miscellaneous/Makefile ]) AC_SEARCH_LIBS([timer_create],[rt posix4]) @@ -284,4 +303,5 @@ AC_MSG_RESULT([ cunit: ${cunit_support} test_vald: ${test_vald} test_perf: ${test_perf} + test_cpp: ${test_cpp} ]) diff --git a/test/Makefile.am b/test/Makefile.am index ec2b248..2ba8008 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = api_test performance +SUBDIRS = api_test performance miscellaneous if cunit_support SUBDIRS += validation diff --git a/test/Makefile.inc b/test/Makefile.inc index ebee80a..93ead25 100644 --- a/test/Makefile.inc +++ b/test/Makefile.inc @@ -2,12 +2,13 @@ include $(top_srcdir)/Makefile.inc include $(top_srcdir)/platform/@with_platform@/Makefile.inc LIB = $(top_builddir)/lib LDADD = $(LIB)/libodp.la -AM_CFLAGS += \ - -I$(srcdir) \ +INCFLAGS = -I$(srcdir) \ -I$(top_srcdir)/test \ -I$(top_srcdir)/platform/@with_platform@/include \ -I$(top_srcdir)/platform/linux-generic/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/helper/include +AM_CFLAGS += $(INCFLAGS) +AM_CXXFLAGS = $(INCFLAGS) AM_LDFLAGS += -L$(LIB) diff --git a/test/miscellaneous/.gitignore b/test/miscellaneous/.gitignore new file mode 100644 index 0000000..134df38 --- /dev/null +++ b/test/miscellaneous/.gitignore @@ -0,0 +1 @@ +odp_api_from_cpp diff --git a/test/miscellaneous/Makefile.am b/test/miscellaneous/Makefile.am new file mode 100644 index 0000000..110b63c --- /dev/null +++ b/test/miscellaneous/Makefile.am @@ -0,0 +1,12 @@ +include $(top_srcdir)/test/Makefile.inc + +if test_cpp +bin_PROGRAMS = odp_api_from_cpp +TESTS = odp_api_from_cpp +endif + +odp_api_from_cpp_CFLAGS = $(AM_CFLAGS) + +odp_api_from_cpp_LDFLAGS = $(AM_LDFLAGS) -static + +dist_odp_api_from_cpp_SOURCES = odp_api_from_cpp.cpp diff --git a/test/miscellaneous/gitignore b/test/miscellaneous/gitignore new file mode 100644 index 0000000..134df38 --- /dev/null +++ b/test/miscellaneous/gitignore @@ -0,0 +1 @@ +odp_api_from_cpp diff --git a/test/miscellaneous/odp_api_from_cpp.cpp b/test/miscellaneous/odp_api_from_cpp.cpp new file mode 100644 index 0000000..e62ef8d --- /dev/null +++ b/test/miscellaneous/odp_api_from_cpp.cpp @@ -0,0 +1,12 @@ +#include +#include +#include + +int main(int argc, const char *argv[]) +{ + + printf("\tODP API version: %s\n", odp_version_api_str()); + printf("\tODP implementation version: %s\n", odp_version_impl_str()); + + return 0; +}