[llvm-exegesis][NFC] Refactor X86 tests fixtures into a base class.

Reviewers: gchatelet, a.sidorin

Subscribers: tschuett, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68262

llvm-svn: 373313
diff --git a/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp b/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp
index d4773fc..69dd689 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp
@@ -9,6 +9,7 @@
 #include "SnippetFile.h"
 
 #include "LlvmState.h"
+#include "TestBase.h"
 #include "X86InstrInfo.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FileSystem.h"
@@ -33,19 +34,8 @@
 using testing::Property;
 using testing::SizeIs;
 
-class X86SnippetFileTest : public ::testing::Test {
+class X86SnippetFileTest : public X86TestBase {
 protected:
-  X86SnippetFileTest() : State("x86_64-unknown-linux", "haswell") {}
-
-  static void SetUpTestCase() {
-    LLVMInitializeX86TargetInfo();
-    LLVMInitializeX86TargetMC();
-    LLVMInitializeX86Target();
-    LLVMInitializeX86AsmPrinter();
-    LLVMInitializeX86AsmParser();
-    InitializeX86ExegesisTarget();
-  }
-
   Expected<std::vector<BenchmarkCode>> TestCommon(StringRef Contents) {
     SmallString<64> Filename;
     std::error_code EC;
@@ -60,8 +50,6 @@
     }
     return readSnippets(State, Filename);
   }
-
-  const LLVMState State;
 };
 
 // FIXME: Refactor these to ../Common/Matchers.h