10
10
//
11
11
// ===----------------------------------------------------------------------===//
12
12
13
+ #include " TestingSupport/SubsystemRAII.h"
13
14
#include " gtest/gtest.h"
14
15
15
16
#include " Plugins/TypeSystem/Swift/SwiftASTContext.h"
@@ -31,15 +32,14 @@ using namespace lldb_private;
31
32
} else { \
32
33
}
33
34
34
- struct TestSwiftASTContext : public testing ::Test {
35
- static void SetUpTestCase () {
36
- FileSystem::Initialize () ;
37
- HostInfo::Initialize (); }
35
+ class TestSwiftASTContext : public testing ::Test {
36
+ public:
37
+ SubsystemRAII<FileSystem, HostInfo> subsystems ;
38
+ };
38
39
39
- static void TearDownTestCase () {
40
- HostInfo::Terminate ();
41
- FileSystem::Terminate ();
42
- }
40
+ class ClangArgs : public testing ::Test {
41
+ public:
42
+ SubsystemRAII<FileSystem, HostInfo> subsystems;
43
43
};
44
44
45
45
struct SwiftASTContextTester : public SwiftASTContext {
@@ -231,23 +231,23 @@ const std::vector<std::string> uniqued_flags = {
231
231
};
232
232
} // namespace
233
233
234
- TEST (ClangArgs, UniquingCollisionWithExistingFlags) {
234
+ TEST_F (ClangArgs, UniquingCollisionWithExistingFlags) {
235
235
const std::vector<std::string> source = duplicated_flags;
236
236
std::vector<std::string> dest = uniqued_flags;
237
237
SwiftASTContext::AddExtraClangArgs (source, dest);
238
238
239
239
EXPECT_EQ (dest, uniqued_flags);
240
240
}
241
241
242
- TEST (ClangArgs, UniquingCollisionWithAddedFlags) {
242
+ TEST_F (ClangArgs, UniquingCollisionWithAddedFlags) {
243
243
const std::vector<std::string> source = duplicated_flags;
244
244
std::vector<std::string> dest;
245
245
SwiftASTContext::AddExtraClangArgs (source, dest);
246
246
247
247
EXPECT_EQ (dest, uniqued_flags);
248
248
}
249
249
250
- TEST (ClangArgs, DoubleDash) {
250
+ TEST_F (ClangArgs, DoubleDash) {
251
251
// -v with all currently ignored arguments following.
252
252
const std::vector<std::string> source{" -v" , " --" , " -Werror" , " " };
253
253
std::vector<std::string> dest;
0 commit comments