]> granicus.if.org Git - libvpx/commitdiff
Add make target for running example tests.
authorTom Finegan <tomfinegan@google.com>
Fri, 16 May 2014 04:34:42 +0000 (21:34 -0700)
committerTom Finegan <tomfinegan@google.com>
Fri, 16 May 2014 04:35:01 +0000 (21:35 -0700)
Change-Id: I0d0dfda96b99cefb5ef5c16df4a024de5bf8007e

build/make/Makefile
libs.mk
test/examples.sh

index c4d53f1605f62bcd78d8c8350d23252f737e81a9..63ec271b72eb64224c05a820e076de13c55d2410 100644 (file)
@@ -19,6 +19,7 @@ ifeq ($(target),)
         done
 all: .DEFAULT
 clean:: .DEFAULT
+exampletest: .DEFAULT
 install:: .DEFAULT
 test:: .DEFAULT
 testdata:: .DEFAULT
@@ -105,6 +106,8 @@ distclean: clean
 
 .PHONY: dist
 dist:
+.PHONY: exampletest
+exampletest:
 .PHONY: install
 install::
 .PHONY: test
diff --git a/libs.mk b/libs.mk
index 85c5f8a02eee33454767a197fd63f2a344682925..31e45956eabde0d43a18bc9229593781ddeed2f3 100644 (file)
--- a/libs.mk
+++ b/libs.mk
@@ -556,3 +556,26 @@ else
 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
index ac2a18c030c9b1d416ce9d52fd65533c0fc0754d..7ba9ccef92a3a147250db859df686a640e02dbdc 100755 (executable)
@@ -24,5 +24,6 @@ done
 
 for test in ${example_tests}; do
   # Source each test script so that exporting variables can be avoided.
+  VPX_TEST_NAME="$(basename ${test%.*})"
   . "${test}"
 done