[Libva] [PATCH RFC intel-driver 00/11] Automated (Unit) Test Suite

U. Artie Eoff ullysses.a.eoff at intel.com
Thu Sep 1 19:59:34 UTC 2016


The following patchset integrates the Google Test Framework
into the source tree.  This test framework provides a rich
set of features like automatic test discovery, assertion macros,
test fixtures, structured console and/or xml test results, and more.
These kinds of features allow developers to spend more time
focusing on writing the tests rather than the test framework
itself.  You can learn more about GTest here:

  <https://github.com/google/googletest/tree/release-1.8.0/googletest>

The intention is to give developers a simple way to write and
execute [unit] tests for the vaapi-intel-driver.  With an "integrated"
automated test suite/framework, developers are enabled to develop
tests that can exercise internal driver functions, features and
concepts.  It also helps developers to identify regressions before
submitting new patches.  All of which, hopefully, leads to an overall
higher quality driver.

As part of this patch series, I have provided a driver test fixture
that can be used as a foundation for most test cases.  I've also
developed several test cases that can be used as a reference for other
developers to get started on developing their own test cases.

This patch series is not meant to address *every* need that we might
have to test the driver.  Rather, it serves as a point to get us
started.  As new tests are developed, I would expect that this test
suite will evolve to accommodate additional needs.

One foreseeable addition is that, sooner than later, new tests will need
to determine if the hardware supports a tested driver feature or not
(e.g. JPEG encode, HEVC decode, ...) and return early if needed.  I'm
thinking we can just move the HAS_* macros (i.e.  HAS_JPEG_ENCODING,
HAS_HEVC_DECODING, ...) out of the src/i965_drv_video.c implementation
file and put them into the src/i965_drv_video.h header file.  This will
allow tests to use the same macros that the driver uses, for example:

    TEST_F(JPEGEncodeTest, Simple)
    {
        struct i965_driver_data *i965(*this);
        ASSERT_PTR(i965);
        if (!HAS_JPEG_ENCODING(i965)) {
            RecordProperty("skipped", true);
            std::cout << “[SKIPPED] “ << testname() << “ unsupported”
            return;
        }

        // do jpeg encode test
    }

Does this seem reasonable enough?  Are there other suggestions or
recommendations?

Cheers.

U. Artie Eoff (11):
  test: add googletest release-1.8.0 source
  toolchain: build gtest convenience library
  test: add initial test_i965_drv_video target
  i965: compile driver source as convenience library
  test: link to i965 convenience library
  test: add i965 test fixture
  test: add an i965 initialize test
  test: add some JPEG decode test cases
  test: add some object_heap tests
  test: add some chipset tests
  test: add TESTING readme file

 Makefile.am                                        |    5 +
 README                                             |    7 +-
 TESTING                                            |  147 +
 configure.ac                                       |   11 +-
 src/Makefile.am                                    |   17 +-
 test/Makefile.am                                   |   91 +
 test/gtest/LICENSE                                 |   28 +
 test/gtest/README.md                               |  280 +
 test/gtest/docs/AdvancedGuide.md                   | 2182 ++++++++
 test/gtest/docs/DevGuide.md                        |  126 +
 test/gtest/docs/Documentation.md                   |   14 +
 test/gtest/docs/FAQ.md                             | 1087 ++++
 test/gtest/docs/Primer.md                          |  502 ++
 test/gtest/docs/PumpManual.md                      |  177 +
 test/gtest/docs/Samples.md                         |   14 +
 test/gtest/docs/XcodeGuide.md                      |   93 +
 test/gtest/include/gtest/gtest-death-test.h        |  294 ++
 test/gtest/include/gtest/gtest-message.h           |  250 +
 test/gtest/include/gtest/gtest-param-test.h        | 1444 ++++++
 test/gtest/include/gtest/gtest-param-test.h.pump   |  510 ++
 test/gtest/include/gtest/gtest-printers.h          |  993 ++++
 test/gtest/include/gtest/gtest-spi.h               |  232 +
 test/gtest/include/gtest/gtest-test-part.h         |  179 +
 test/gtest/include/gtest/gtest-typed-test.h        |  263 +
 test/gtest/include/gtest/gtest.h                   | 2236 ++++++++
 test/gtest/include/gtest/gtest_pred_impl.h         |  358 ++
 test/gtest/include/gtest/gtest_prod.h              |   58 +
 .../include/gtest/internal/custom/gtest-port.h     |   69 +
 .../include/gtest/internal/custom/gtest-printers.h |   42 +
 test/gtest/include/gtest/internal/custom/gtest.h   |   41 +
 .../gtest/internal/gtest-death-test-internal.h     |  319 ++
 test/gtest/include/gtest/internal/gtest-filepath.h |  206 +
 test/gtest/include/gtest/internal/gtest-internal.h | 1238 +++++
 .../include/gtest/internal/gtest-linked_ptr.h      |  243 +
 .../gtest/internal/gtest-param-util-generated.h    | 5146 +++++++++++++++++++
 .../internal/gtest-param-util-generated.h.pump     |  286 ++
 .../include/gtest/internal/gtest-param-util.h      |  731 +++
 .../gtest/include/gtest/internal/gtest-port-arch.h |   93 +
 test/gtest/include/gtest/internal/gtest-port.h     | 2554 ++++++++++
 test/gtest/include/gtest/internal/gtest-string.h   |  167 +
 test/gtest/include/gtest/internal/gtest-tuple.h    | 1020 ++++
 .../include/gtest/internal/gtest-tuple.h.pump      |  347 ++
 .../gtest/include/gtest/internal/gtest-type-util.h | 3331 ++++++++++++
 .../include/gtest/internal/gtest-type-util.h.pump  |  297 ++
 test/gtest/src/gtest-all.cc                        |   48 +
 test/gtest/src/gtest-death-test.cc                 | 1342 +++++
 test/gtest/src/gtest-filepath.cc                   |  387 ++
 test/gtest/src/gtest-internal-inl.h                | 1183 +++++
 test/gtest/src/gtest-port.cc                       | 1259 +++++
 test/gtest/src/gtest-printers.cc                   |  373 ++
 test/gtest/src/gtest-test-part.cc                  |  110 +
 test/gtest/src/gtest-typed-test.cc                 |  118 +
 test/gtest/src/gtest.cc                            | 5388 ++++++++++++++++++++
 test/gtest/src/gtest_main.cc                       |   38 +
 test/i965_chipset_test.cpp                         |  104 +
 test/i965_initialize_test.cpp                      |   66 +
 test/i965_internal_decl.h                          |   74 +
 test/i965_jpeg_decode_test.cpp                     |  292 ++
 test/i965_jpeg_test_data.h                         | 1085 ++++
 test/i965_test_fixture.cpp                         |  223 +
 test/i965_test_fixture.h                           |  237 +
 test/object_heap_test.cpp                          |  248 +
 test/test.h                                        |   52 +
 test/test_main.cpp                                 |   32 +
 64 files changed, 40381 insertions(+), 6 deletions(-)
 create mode 100644 TESTING
 create mode 100644 test/Makefile.am
 create mode 100644 test/gtest/LICENSE
 create mode 100644 test/gtest/README.md
 create mode 100644 test/gtest/docs/AdvancedGuide.md
 create mode 100644 test/gtest/docs/DevGuide.md
 create mode 100644 test/gtest/docs/Documentation.md
 create mode 100644 test/gtest/docs/FAQ.md
 create mode 100644 test/gtest/docs/Primer.md
 create mode 100644 test/gtest/docs/PumpManual.md
 create mode 100644 test/gtest/docs/Samples.md
 create mode 100644 test/gtest/docs/XcodeGuide.md
 create mode 100644 test/gtest/include/gtest/gtest-death-test.h
 create mode 100644 test/gtest/include/gtest/gtest-message.h
 create mode 100644 test/gtest/include/gtest/gtest-param-test.h
 create mode 100644 test/gtest/include/gtest/gtest-param-test.h.pump
 create mode 100644 test/gtest/include/gtest/gtest-printers.h
 create mode 100644 test/gtest/include/gtest/gtest-spi.h
 create mode 100644 test/gtest/include/gtest/gtest-test-part.h
 create mode 100644 test/gtest/include/gtest/gtest-typed-test.h
 create mode 100644 test/gtest/include/gtest/gtest.h
 create mode 100644 test/gtest/include/gtest/gtest_pred_impl.h
 create mode 100644 test/gtest/include/gtest/gtest_prod.h
 create mode 100644 test/gtest/include/gtest/internal/custom/gtest-port.h
 create mode 100644 test/gtest/include/gtest/internal/custom/gtest-printers.h
 create mode 100644 test/gtest/include/gtest/internal/custom/gtest.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-death-test-internal.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-filepath.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-internal.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-linked_ptr.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-param-util-generated.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
 create mode 100644 test/gtest/include/gtest/internal/gtest-param-util.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-port-arch.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-port.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-string.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-tuple.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-tuple.h.pump
 create mode 100644 test/gtest/include/gtest/internal/gtest-type-util.h
 create mode 100644 test/gtest/include/gtest/internal/gtest-type-util.h.pump
 create mode 100644 test/gtest/src/gtest-all.cc
 create mode 100644 test/gtest/src/gtest-death-test.cc
 create mode 100644 test/gtest/src/gtest-filepath.cc
 create mode 100644 test/gtest/src/gtest-internal-inl.h
 create mode 100644 test/gtest/src/gtest-port.cc
 create mode 100644 test/gtest/src/gtest-printers.cc
 create mode 100644 test/gtest/src/gtest-test-part.cc
 create mode 100644 test/gtest/src/gtest-typed-test.cc
 create mode 100644 test/gtest/src/gtest.cc
 create mode 100644 test/gtest/src/gtest_main.cc
 create mode 100644 test/i965_chipset_test.cpp
 create mode 100644 test/i965_initialize_test.cpp
 create mode 100644 test/i965_internal_decl.h
 create mode 100644 test/i965_jpeg_decode_test.cpp
 create mode 100644 test/i965_jpeg_test_data.h
 create mode 100644 test/i965_test_fixture.cpp
 create mode 100644 test/i965_test_fixture.h
 create mode 100644 test/object_heap_test.cpp
 create mode 100644 test/test.h
 create mode 100644 test/test_main.cpp

-- 
2.4.11



More information about the Libva mailing list