]> granicus.if.org Git - libvpx/commitdiff
Add utiltest target to Makefile.
authorTom Finegan <tomfinegan@google.com>
Tue, 22 Apr 2014 17:38:43 +0000 (10:38 -0700)
committerTom Finegan <tomfinegan@google.com>
Tue, 22 Apr 2014 17:38:43 +0000 (10:38 -0700)
Add target for running tests via make. Runs vpxdec.sh and vpxenc.sh.

Change-Id: I5fddb7356b6ac37e284b4f15b47310f108ae3da3

build/make/Makefile
libs.mk

index 0c5ff64f4c897c1d3cdaf09aa1df2c41a6f8e985..03dacce5e166a4ae1101f3b7f63d877357e7dd0b 100644 (file)
@@ -22,6 +22,7 @@ clean:: .DEFAULT
 install:: .DEFAULT
 test:: .DEFAULT
 testdata:: .DEFAULT
+utiltest: .DEFAULT
 
 
 # Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
@@ -52,8 +53,6 @@ dist:
                 | sed -e 's/MD5(\(.*\))= \([0-9a-f]\{32\}\)/\2  \1/' \
                 > md5sums.txt;\
         fi
-
-
 endif
 
 ifneq ($(target),)
@@ -112,6 +111,8 @@ install::
 test::
 .PHONY: testdata
 testdata::
+.PHONY: utiltest
+utiltest:
 
 # Add compiler flags for intrinsic files
 $(BUILD_PFX)%_mmx.c.d: CFLAGS += -mmmx
diff --git a/libs.mk b/libs.mk
index a5c4b760d9b378cb5a588716b275a4acd0fa2ff0..85c5f8a02eee33454767a197fd63f2a344682925 100644 (file)
--- a/libs.mk
+++ b/libs.mk
@@ -531,3 +531,28 @@ $(OBJS-yes:.o=.d): $(RTCD)
 
 ## Update the global src list
 SRCS += $(CODEC_SRCS) $(LIBVPX_TEST_SRCS) $(GTEST_SRCS)
+
+##
+## vpxdec/vpxenc tests.
+##
+ifeq ($(CONFIG_UNIT_TESTS),yes)
+TEST_BIN_PATH = .
+ifeq ($(CONFIG_MSVS),yes)
+# MSVC will build both Debug and Release configurations of tools in a
+# sub directory named for the current target. Assume the user wants to
+# run the Release tools, and assign TEST_BIN_PATH accordingly.
+# TODO(tomfinegan): Is this adequate for ARM?
+# TODO(tomfinegan): Support running the debug versions of tools?
+TEST_BIN_PATH := $(addsuffix /$(TGT_OS:win64=x64)/Release, $(TEST_BIN_PATH))
+endif
+utiltest: testdata
+       $(qexec)$(SRC_PATH_BARE)/test/vpxdec.sh \
+               --test-data-path $(LIBVPX_TEST_DATA_PATH) \
+               --bin-path $(TEST_BIN_PATH)
+       $(qexec)$(SRC_PATH_BARE)/test/vpxenc.sh \
+               --test-data-path $(LIBVPX_TEST_DATA_PATH) \
+               --bin-path $(TEST_BIN_PATH)
+else
+utiltest:
+       @echo Unit tests must be enabled to make the utiltest target.
+endif