diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2016-09-01 12:59:37 -0700 |
---|---|---|
committer | Sean V Kelley <seanvk@posteo.de> | 2016-09-07 10:18:21 -0700 |
commit | ea2a1050593184a832fabbd694eb7fe18b70a993 (patch) | |
tree | 394380035a5fa392304036f5a26e7d24e4160bca /test | |
parent | b6906974929e778400c2a84dba8ebf2a2a3f68f4 (diff) |
test: add initial test_i965_drv_video target
Add test_i965_drv_video as noinst program with an initial
test main() definition.
Also provide a test.h header with common test includes and
definitions that can be included by all test compilation
units.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 43 | ||||
-rw-r--r-- | test/test.h | 49 | ||||
-rw-r--r-- | test/test_main.cpp | 32 |
3 files changed, 124 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index aa79703..19ad347 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -9,6 +9,8 @@ AM_CPPFLAGS = \ -DGTEST_USE_OWN_TR1_TUPLE=0 \ -DGTEST_LANG_CXX11=1 \ -DGTEST_HAS_TR1_TUPLE=1 \ + -DPTHREADS \ + -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH)\"" \ -std=c++11 \ $(NULL) @@ -16,6 +18,7 @@ AM_LDFLAGS = \ -pthread \ $(NULL) +# libgtest noinst_LTLIBRARIES = libgtest.la libgtest_la_SOURCES = \ @@ -36,3 +39,43 @@ EXTRA_DIST = \ gtest/README.md \ gtest/LICENSE \ $(NULL) + +# test_i965_drv_video +noinst_PROGRAMS = test_i965_drv_video +noinst_HEADERS = \ + test.h \ + $(NULL) + +test_i965_drv_video_SOURCES = \ + test_main.cpp \ + $(NULL) + +test_i965_drv_video_LDFLAGS = \ + $(DRM_LDFLAGS) \ + $(LIBVA_DEPS_LDFLAGS) \ + $(LIBVA_DRM_DEPS_LDFLAGS) \ + $(AM_LDFLAGS) \ + $(NULL) + +test_i965_drv_video_LDADD = \ + libgtest.la \ + $(DRM_LIBS) \ + $(LIBVA_DEPS_LIBS) \ + $(LIBVA_DRM_DEPS_LIBS) \ + -ldrm_intel -lm -ldl \ + $(NULL) + +test_i965_drv_video_CPPFLAGS = \ + $(DRM_CFLAGS) \ + $(LIBVA_DEPS_CFLAGS) \ + $(LIBVA_DRM_DEPS_CFLAGS) \ + $(AM_CPPFLAGS) \ + $(NULL) + +test_i965_drv_video_CXXFLAGS = \ + -Wall -Werror \ + $(AM_CXXFLAGS) \ + $(NULL) + +check-local: test_i965_drv_video + $(builddir)/test_i965_drv_video diff --git a/test/test.h b/test/test.h new file mode 100644 index 0000000..24c2933 --- /dev/null +++ b/test/test.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2016 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef TEST_H +#define TEST_H + +#include <gtest/gtest.h> +#include <va/va.h> + +#define EXPECT_STATUS(status) \ + EXPECT_EQ(VA_STATUS_SUCCESS, (status)) + +#define ASSERT_STATUS(status) \ + ASSERT_EQ(VA_STATUS_SUCCESS, (status)) + +#define EXPECT_ID(id) \ + EXPECT_NE(VA_INVALID_ID, (id)) + +#define ASSERT_ID(id) \ + ASSERT_NE(VA_INVALID_ID, (id)) + +#define EXPECT_PTR(ptr) \ + EXPECT_FALSE(NULL == (ptr)) + +#define ASSERT_PTR(ptr) \ + ASSERT_FALSE(NULL == (ptr)) + +#endif // TEST_H diff --git a/test/test_main.cpp b/test/test_main.cpp new file mode 100644 index 0000000..55a5b09 --- /dev/null +++ b/test/test_main.cpp @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2016 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "test.h" + +int main(int argc, char **argv) +{ + ::testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +} |