OSDN Git Service

test: add getFullTestName to i965 test fixture
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Wed, 7 Sep 2016 20:43:37 +0000 (13:43 -0700)
committerSean V Kelley <seanvk@posteo.de>
Thu, 8 Sep 2016 22:21:47 +0000 (15:21 -0700)
Add I965TestFixture::getFullTestName to allow tests to
log the current test's name.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>
test/i965_test_fixture.cpp
test/i965_test_fixture.h

index 56af0ab..d7f30c2 100644 (file)
@@ -45,6 +45,15 @@ I965TestFixture::~I965TestFixture()
     m_vaDisplay = NULL;
 }
 
+const std::string I965TestFixture::getFullTestName() const
+{
+    const ::testing::TestInfo * const info =
+        ::testing::UnitTest::GetInstance()->current_test_info();
+    return std::string(info->test_case_name())
+        + std::string(".")
+        + std::string(info->name());
+}
+
 void I965TestFixture::initialize()
 {
     ASSERT_FALSE(NULL == (VADisplay)*this);
index f803848..511c791 100644 (file)
@@ -28,6 +28,7 @@
 #include "test.h"
 #include "i965_internal_decl.h"
 
+#include <string>
 #include <vector>
 
 typedef std::vector<VASurfaceID> Surfaces;
@@ -82,6 +83,8 @@ protected:
         terminate();
     }
 
+    const std::string getFullTestName() const;
+
 public:
     /**
      * Initializes the i965 driver and display.  May generate a fatal or