From patchwork Wed Feb 18 18:36:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44791 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4E76F21573 for ; Wed, 18 Feb 2015 18:37:02 +0000 (UTC) Received: by lamq1 with SMTP id q1sf2017160lam.0 for ; Wed, 18 Feb 2015 10:37:01 -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=23SRCn2E27ioA5fZ27wnETJI/bnWju8Ugysp/jujyX0=; b=CKWgq87z6YoTcl5GczdiDG21ZfiHhvuhBB6cgiRgBWUpQCFBhiI57WEGLlCGYcgt1R TnWPyVC362sXLmphcqww1YLgzoltRc3uu3hQ0UVUBfpdckZZnt00hq2vJJ7T7w9xd5Ot OJe/wsax8+uHmgd3zXaPo4i4fRcmr80zsghHqHITg3aroZmKY02Z2sHHZKAzLEeucwV8 IdzzwmMryAkypoqfPbMyy1p+TVs1eHlw9wb7jUJ1pY/XsOcIoaPwxWz0xoVB8KV7LL01 plhjFGNEcggaXKNyxDVWroktfv+qkDMLxEThlIdC438oQFpAndDkDrTzSWCmqYoToKKa Cp6A== X-Gm-Message-State: ALoCoQkILhL5EiW5yvQ4/jIY2se+dEF73pUQcLfAIon0Q4IIHFzDCg1czMFY03Sso5/NgwvLwAd4 X-Received: by 10.112.124.142 with SMTP id mi14mr103556lbb.1.1424284621337; Wed, 18 Feb 2015 10:37:01 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.137 with SMTP id s9ls60009las.15.gmail; Wed, 18 Feb 2015 10:37:01 -0800 (PST) X-Received: by 10.112.126.98 with SMTP id mx2mr736157lbb.52.1424284621073; Wed, 18 Feb 2015 10:37:01 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id k3si15532934lbj.176.2015.02.18.10.37.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 10:37:01 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbjf15 with SMTP id f15so2876366lbj.13 for ; Wed, 18 Feb 2015 10:37:01 -0800 (PST) X-Received: by 10.112.119.165 with SMTP id kv5mr704783lbb.72.1424284620962; Wed, 18 Feb 2015 10:37:00 -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 h5csp6349lbj; Wed, 18 Feb 2015 10:37:00 -0800 (PST) X-Received: by 10.140.91.131 with SMTP id z3mr2851814qgd.1.1424284619638; Wed, 18 Feb 2015 10:36:59 -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 u194si10905114qhd.72.2015.02.18.10.36.57 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 18 Feb 2015 10:36:59 -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 1YO9UT-0000fA-9e; Wed, 18 Feb 2015 18:36:53 +0000 Received: from mail-qg0-f46.google.com ([209.85.192.46]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YO9UN-0000eo-Sv for lng-odp@lists.linaro.org; Wed, 18 Feb 2015 18:36:47 +0000 Received: by mail-qg0-f46.google.com with SMTP id z107so2421943qgd.5 for ; Wed, 18 Feb 2015 10:36:42 -0800 (PST) X-Received: by 10.140.23.40 with SMTP id 37mr2589960qgo.93.1424284602626; Wed, 18 Feb 2015 10:36:42 -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 a92sm3230421qgf.11.2015.02.18.10.36.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Feb 2015 10:36:42 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Wed, 18 Feb 2015 13:36:12 -0500 Message-Id: <1424284572-11367-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH] 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.175 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 --- configure.ac | 16 ++++++++++++++++ test/Makefile.am | 2 +- test/Makefile.inc | 5 +++-- test/miscellaneous/.gitignore | 2 ++ test/miscellaneous/Makefile.am | 12 ++++++++++++ test/miscellaneous/gitignore | 1 + test/miscellaneous/odp_api_from_cpp.cpp | 12 ++++++++++++ 7 files changed, 47 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..68841b4 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,18 @@ AC_ARG_ENABLE([test-perf], AM_CONDITIONAL([test_perf], [test x$test_perf = xyes ]) ########################################################################## +# Enable/disable test-cpp +########################################################################## +test_cpp=no +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 +258,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 +299,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..328331d --- /dev/null +++ b/test/miscellaneous/.gitignore @@ -0,0 +1,2 @@ +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; +}