Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Sep 2015 15:42:49 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r397252 - in head/devel: android-tools-adb android-tools-adb-devel android-tools-adb-devel/files
Message-ID:  <201509181542.t8IFgncC023933@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Fri Sep 18 15:42:48 2015
New Revision: 397252
URL: https://svnweb.freebsd.org/changeset/ports/397252

Log:
  devel/android-tools-adb-devel: add unit tests like simpleperf

Added:
  head/devel/android-tools-adb-devel/files/patch-adb_adb__io__test.cpp   (contents, props changed)
  head/devel/android-tools-adb-devel/files/patch-base_logging__test.cpp   (contents, props changed)
  head/devel/android-tools-adb-devel/files/patch-base_stringprintf__test.cpp   (contents, props changed)
Modified:
  head/devel/android-tools-adb-devel/Makefile   (contents, props changed)
  head/devel/android-tools-adb-devel/files/Makefile   (contents, props changed)
  head/devel/android-tools-adb/Makefile   (contents, props changed)

Modified: head/devel/android-tools-adb-devel/Makefile
==============================================================================
--- head/devel/android-tools-adb-devel/Makefile	Fri Sep 18 15:42:29 2015	(r397251)
+++ head/devel/android-tools-adb-devel/Makefile	Fri Sep 18 15:42:48 2015	(r397252)
@@ -18,5 +18,14 @@ BUILD_WRKSRC=	${WRKSRC}/adb
 INSTALL_WRKSRC=	${BUILD_WRKSRC}
 MAKE_ENV=	FILESDIR="${FILESDIR}"
 CFLAGS+=	-DADB_REVISION='\"${DISTVERSIONFULL}\"'
+ALL_TARGET=	all
+
+OPTIONS_DEFINE=	TEST
+
+TEST_BUILD_DEPENDS=googletest>=1.6.0:${PORTSDIR}/devel/googletest
+TEST_ALL_TARGET=adb_test
+
+pre-install-TEST-on:
+	${BUILD_WRKSRC}/adb_test
 
 .include "${MASTERDIR}/Makefile"

Modified: head/devel/android-tools-adb-devel/files/Makefile
==============================================================================
--- head/devel/android-tools-adb-devel/files/Makefile	Fri Sep 18 15:42:29 2015	(r397251)
+++ head/devel/android-tools-adb-devel/files/Makefile	Fri Sep 18 15:42:48 2015	(r397252)
@@ -22,6 +22,13 @@ SRCS+= transport.cpp
 SRCS+= transport_local.cpp
 SRCS+= transport_usb.cpp
 
+TEST_SRCS+= adb_io_test.cpp
+TEST_SRCS+= adb_utils_test.cpp
+TEST_SRCS+= fdevent_test.cpp
+TEST_SRCS+= shell_service_protocol_test.cpp
+TEST_SRCS+= transport_test.cpp
+CFLAGS.shell_service_protocol_test.cpp+= -Dsighandler_t=sig_t
+
 .PATH: ${.CURDIR}/client
 SRCS+= main.cpp
 
@@ -34,6 +41,12 @@ SRCS+= file.cpp
 SRCS+= logging.cpp
 SRCS+= strings.cpp
 SRCS+= stringprintf.cpp
+TEST_SRCS+= file_test.cpp
+TEST_SRCS+= logging_test.cpp
+TEST_SRCS+= stringprintf_test.cpp
+TEST_SRCS+= strings_test.cpp
+TEST_SRCS+= test_main.cpp
+TEST_SRCS+= test_utils.cpp
 
 .PATH: ${.CURDIR}/../libcutils
 SRCS+= socket_inaddr_any_server.c
@@ -65,7 +78,18 @@ CFLAGS+=${CFLAGS.${.IMPSRC:T}}
 CXXFLAGS+= -std=gnu++11
 CXXFLAGS+= ${CFLAGS:N-std*}
 
+TEST_CFLAGS+= $$(${GTEST_CONFIG} --cppflags)
+.for f in ${TEST_SRCS}
+CFLAGS.${f}+= ${TEST_CFLAGS}
+.endfor
+
 LDADD+= -lcrypto -lpthread -lusb -lz
 DPADD+= ${LIBCRYPTO} ${LIBPTHREAD} ${LIBUSB} ${LIBZ}
+TEST_LDADD+= $$(${GTEST_CONFIG} --libs --ldflags)
+
+GTEST_CONFIG?= gtest-config
+
+adb_test: ${SRCS:R:S/$/.o/:Nmain.o:Ncommandline.o} ${TEST_SRCS:R:S/$/.o/}
+	${CXX} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD}
 
 .include <bsd.prog.mk>

Added: head/devel/android-tools-adb-devel/files/patch-adb_adb__io__test.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/android-tools-adb-devel/files/patch-adb_adb__io__test.cpp	Fri Sep 18 15:42:48 2015	(r397252)
@@ -0,0 +1,10 @@
+--- adb/adb_io_test.cpp.orig	2015-09-05 00:01:27 UTC
++++ adb/adb_io_test.cpp
+@@ -18,6 +18,7 @@
+ 
+ #include <gtest/gtest.h>
+ 
++#include <errno.h>
+ #include <fcntl.h>
+ #include <stdio.h>
+ #include <stdlib.h>

Added: head/devel/android-tools-adb-devel/files/patch-base_logging__test.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/android-tools-adb-devel/files/patch-base_logging__test.cpp	Fri Sep 18 15:42:48 2015	(r397252)
@@ -0,0 +1,10 @@
+--- base/logging_test.cpp.orig	2015-09-17 22:58:36 UTC
++++ base/logging_test.cpp
+@@ -16,6 +16,7 @@
+ 
+ #include "base/logging.h"
+ 
++#include <errno.h>
+ #include <libgen.h>
+ 
+ #include <regex>

Added: head/devel/android-tools-adb-devel/files/patch-base_stringprintf__test.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/android-tools-adb-devel/files/patch-base_stringprintf__test.cpp	Fri Sep 18 15:42:48 2015	(r397252)
@@ -0,0 +1,10 @@
+--- base/stringprintf_test.cpp.orig	2015-09-17 22:58:36 UTC
++++ base/stringprintf_test.cpp
+@@ -18,6 +18,7 @@
+ 
+ #include <gtest/gtest.h>
+ 
++#include <errno.h>
+ #include <string>
+ 
+ TEST(StringPrintfTest, HexSizeT) {

Modified: head/devel/android-tools-adb/Makefile
==============================================================================
--- head/devel/android-tools-adb/Makefile	Fri Sep 18 15:42:29 2015	(r397251)
+++ head/devel/android-tools-adb/Makefile	Fri Sep 18 15:42:48 2015	(r397252)
@@ -32,7 +32,7 @@ PLIST_FILES=	bin/adb \
 		%%BASH%%etc/bash_completion.d/adb
 PORTDOCS=	*.txt *.TXT
 
-OPTIONS_DEFINE=	BASH DOCS
+OPTIONS_DEFINE+=BASH DOCS
 OPTIONS_SUB=	yes
 
 BASH_VARS=	LICENSE+=MIT LICENSE_COMB=multi # debian/copyright



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509181542.t8IFgncC023933>