llvm/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp

//===- unittests/DirectoryWatcher/DirectoryWatcherTest.cpp ----------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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 clang

namespace {

EventKind;

// We've observed this test being significantly flaky when running on a heavily
// loaded machine (e.g. when it's being run as part of the full check-clang
// suite). Set a high timeout value to avoid this flakiness. The 60s timeout
// value was determined empirically. It's a timeout value, not a sleep value,
// and the test should require much less time in practice the vast majority of
// instances. The cases where we do come close to (or still end up hitting) the
// longer timeout are most likely to occur when other tests are also running at
// the same time (e.g. as part of the full check-clang suite), in which case the
// latency of the timeout will be masked by the latency of the other tests.
constexpr std::chrono::seconds EventualResultTimeout(60);

struct DirectoryWatcherTestFixture {};

std::string eventKindToString(const EventKind K) {}

struct VerifyingConsumer {};

void checkEventualResultWithTimeout(VerifyingConsumer &TestConsumer) {}
} // namespace

TEST(DirectoryWatcherTest, InitialScanSync) {}

TEST(DirectoryWatcherTest, InitialScanAsync) {}

TEST(DirectoryWatcherTest, AddFiles) {}

TEST(DirectoryWatcherTest, ModifyFile) {}

TEST(DirectoryWatcherTest, DeleteFile) {}

TEST(DirectoryWatcherTest, DeleteWatchedDir) {}

TEST(DirectoryWatcherTest, InvalidatedWatcher) {}

TEST(DirectoryWatcherTest, InvalidatedWatcherAsync) {}