#include "clang/DirectoryWatcher/DirectoryWatcher.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"
#include <condition_variable>
#include <future>
#include <mutex>
#include <optional>
#include <thread>
usingnamespacellvm;
usingnamespacellvm::sys;
usingnamespacellvm::sys::fs;
usingnamespaceclang;
namespace clang {
static bool operator==(const DirectoryWatcher::Event &lhs,
const DirectoryWatcher::Event &rhs) { … }
}
namespace {
EventKind;
constexpr std::chrono::seconds EventualResultTimeout(60);
struct DirectoryWatcherTestFixture { … };
std::string eventKindToString(const EventKind K) { … }
struct VerifyingConsumer { … };
void checkEventualResultWithTimeout(VerifyingConsumer &TestConsumer) { … }
}
TEST(DirectoryWatcherTest, InitialScanSync) { … }
TEST(DirectoryWatcherTest, InitialScanAsync) { … }
TEST(DirectoryWatcherTest, AddFiles) { … }
TEST(DirectoryWatcherTest, ModifyFile) { … }
TEST(DirectoryWatcherTest, DeleteFile) { … }
TEST(DirectoryWatcherTest, DeleteWatchedDir) { … }
TEST(DirectoryWatcherTest, InvalidatedWatcher) { … }
TEST(DirectoryWatcherTest, InvalidatedWatcherAsync) { … }