Skip to contentSkip to conversation

protobuf: add ptest support

PATCH New [email protected] 1 participant 1 message Dec 22, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 protobuf: add ptest support

From: Mingli Yu <[email protected]>

* Add DEPENDS_class-target = "protobuf-native"
to fix below error:

  | DEBUG: SITE files ['endian-little', 'common-linux', 'common-glibc', 'bit-64', 'x86_64-linux', 'common']
  | DEBUG: Executing shell function do_compile_ptest_base
  | NOTE: make -C $Prj/build/tmp-glibc/work/core2-64-wrs-linux/protobuf/3.4.1+gitAUTOINC+b04e5cba35-r0/git/examples cpp
  | make: Entering directory '$Prj/build/tmp-glibc/work/core2-64-wrs-linux/protobuf/3.4.1+gitAUTOINC+b04e5cba35-r0/git/examples'
  | protoc --cpp_out=. --java_out=. --python_out=. addressbook.proto
  | make: protoc: Command not found
  | make: *** [Makefile:25: protoc_middleman] Error 127

* Add run-ptest
* Add rdepends on bash and python-protobuf for ptest

---
 .../recipes-devtools/protobuf/protobuf/run-ptest   | 38 +++++++++++++++
 .../recipes-devtools/protobuf/protobuf_3.4.1.bb    | 54 +++++++++++++++++++++-
 2 files changed, 90 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/protobuf/protobuf/run-ptest
meta-oe/recipes-devtools/protobuf/protobuf/run-ptest new file +38 -0
new file mode 100644
index 000000000..7c3a8d1b3
@@ -0,0 +1,38 @@
+#!/bin/bash
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+TEST_FILE="/tmp/test.data"
+
+RETVAL=0
+# Test every writing test application
+for write_exe_full_path in ${DIR}/add_person_*; do
+	if [ -x "${write_exe_full_path}" ]; then
+		write_exe=`basename ${write_exe_full_path}`
+		echo "Generating new test file using ${write_exe}..."
+		${write_exe_full_path} "${TEST_FILE}"
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] || exit $RETVAL
+
+		# Test every reading test application
+		for read_exe_full_path in ${DIR}/list_people_*; do
+			read_exe=`basename ${read_exe_full_path}`
+			echo "Test: Write with ${write_exe}; Read with ${read_exe}..."
+			if [ -x "${read_exe_full_path}" ]; then
+				${read_exe_full_path} "${TEST_FILE}"
+				RETVAL=$?
+				[ $RETVAL -eq 0 ] || exit $RETVAL
+			fi
+		done
+
+		# Cleanup...
+		if [ -e "${TEST_FILE}" ]; then
+			rm "${TEST_FILE}"
+		fi
+	fi
+done
+
+if [ $RETVAL -eq 0 ] ; then
+    echo "PASS: protobuf"
+else
+    echo "FAIL: protobuf"
+fi
+
meta-oe/recipes-devtools/protobuf/protobuf_3.4.1.bb +52 -2

73 lines not on this page · raw message

Signature · 1 line
2.13.3