shithub: libvpx

Download patch

ref: bc27d7e96704251272ff68b1ceae1070ec9efeb3
parent: 619e6b539a6eb2beed1dccc43b504e357f120da3
author: Tom Finegan <tomfinegan@google.com>
date: Thu May 15 17:34:42 EDT 2014

Add make target for running example tests.

Change-Id: I0d0dfda96b99cefb5ef5c16df4a024de5bf8007e

--- a/build/make/Makefile
+++ b/build/make/Makefile
@@ -19,6 +19,7 @@
         done
 all: .DEFAULT
 clean:: .DEFAULT
+exampletest: .DEFAULT
 install:: .DEFAULT
 test:: .DEFAULT
 testdata:: .DEFAULT
@@ -105,6 +106,8 @@
 
 .PHONY: dist
 dist:
+.PHONY: exampletest
+exampletest:
 .PHONY: install
 install::
 .PHONY: test
--- a/libs.mk
+++ b/libs.mk
@@ -556,3 +556,26 @@
 utiltest:
 	@echo Unit tests must be enabled to make the utiltest target.
 endif
+
+##
+## Example tests.
+##
+ifeq ($(CONFIG_UNIT_TESTS),yes)
+# All non-MSVC targets output example targets in a sub dir named examples.
+EXAMPLES_BIN_PATH = examples
+ifeq ($(CONFIG_MSVS),yes)
+# MSVC will build both Debug and Release configurations of the examples in a
+# sub directory named for the current target. Assume the user wants to
+# run the Release tools, and assign EXAMPLES_BIN_PATH accordingly.
+# TODO(tomfinegan): Is this adequate for ARM?
+# TODO(tomfinegan): Support running the debug versions of tools?
+EXAMPLES_BIN_PATH := $(TGT_OS:win64=x64)/Release
+endif
+exampletest: examples testdata
+	$(qexec)$(SRC_PATH_BARE)/test/examples.sh \
+		--test-data-path $(LIBVPX_TEST_DATA_PATH) \
+		--bin-path $(EXAMPLES_BIN_PATH)
+else
+exampletest:
+	@echo Unit tests must be enabled to make the exampletest target.
+endif
--- a/test/examples.sh
+++ b/test/examples.sh
@@ -24,5 +24,6 @@
 
 for test in ${example_tests}; do
   # Source each test script so that exporting variables can be avoided.
+  VPX_TEST_NAME="$(basename ${test%.*})"
   . "${test}"
 done