OSDN Git Service

test: move vaInitialize/vaTerminate to a global test environment
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Wed, 5 Oct 2016 17:54:24 +0000 (10:54 -0700)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 31 Oct 2016 02:00:08 +0000 (10:00 +0800)
commit1840c050031e039ed6206db9427c3a9564fd6850
treebfb7722b152af8e07213a91c702bf019e57231d3
parente233da263238afe28d18b27046350c59a7b30d12
test: move vaInitialize/vaTerminate to a global test environment

Move the VADisplay, vaInitialize and vaTerminate responsibility
out of the I965TestFixture class and into a global
I965TestEnvironment (::testing::Environment) singleton.

The I965TestEnvironment singleton instance is registered with
the gtest framework at startup and it's SetUp and TearDown routines
are executed before and after all tests are executed.  This
allows all tests to obtain access to the VADisplay et. al.
outside of an I965TestFixture instance.

Essentially, this results in only one VADisplay being shared
between all executed test cases and one init/term sequence
for the entire test program execution.  This more closely
resembles how several real-world programs would use the
driver (i.e. init driver once, encode/decode multiple streams
and terminate driver once).

Prior to this, each test case had it's own VADisplay instance
and init/term sequence.  That behavior can still be achieved by
executing one test case at a time via the --gtest_filter option.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>
(cherry picked from commit 8fb4dd957ff1db28c54430a47b5305a4e05f1e1d)
test/Makefile.am
test/i965_test_environment.cpp [new file with mode: 0644]
test/i965_test_environment.h [new file with mode: 0644]
test/i965_test_fixture.cpp
test/i965_test_fixture.h
test/test_main.cpp