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)
committerSean V Kelley <seanvk@posteo.de>
Thu, 6 Oct 2016 21:02:27 +0000 (14:02 -0700)
commit8fb4dd957ff1db28c54430a47b5305a4e05f1e1d
treebfb7722b152af8e07213a91c702bf019e57231d3
parent464d36dda586addb32379b8c74b2055da73783d3
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>
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