folly/folly/testing/TestUtil.cpp

/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <folly/testing/TestUtil.h>

#include <sys/stat.h>
#include <sys/types.h>

#include <glog/logging.h>

#include <folly/Exception.h>
#include <folly/File.h>
#include <folly/FileUtil.h>
#include <folly/Memory.h>
#include <folly/String.h>
#include <folly/ext/test_ext.h>
#include <folly/portability/Fcntl.h>

#ifdef _WIN32
#include <crtdbg.h> // @manual
#endif

// This needs to be at the end because some versions end up including
// Windows.h without defining NOMINMAX, which breaks uses of std::numeric_limits
// in various headers that we include.
#include <boost/regex.hpp>

namespace folly {
namespace test {

namespace {

fs::path generateUniquePath(fs::path path, StringPiece namePrefix) {}

} // namespace

TemporaryFile::TemporaryFile(
    StringPiece namePrefix, fs::path dir, Scope scope, bool closeOnDestruction)
    :{}

void TemporaryFile::close() {}

const fs::path& TemporaryFile::path() const {}

void TemporaryFile::reset() {}

TemporaryFile::~TemporaryFile() {}

TemporaryDirectory::TemporaryDirectory(
    StringPiece namePrefix, fs::path dir, Scope scope)
    :{}

TemporaryDirectory::~TemporaryDirectory() {}

ChangeToTempDir::ChangeToTempDir() {}

ChangeToTempDir::~ChangeToTempDir() {}

namespace detail {

SavedState disableInvalidParameters() {}

#ifdef _WIN32
void enableInvalidParameters(SavedState state) {
  _set_thread_local_invalid_parameter_handler(
      (_invalid_parameter_handler)state.previousThreadLocalHandler);
  _CrtSetReportMode(_CRT_ASSERT, state.previousCrtReportMode);
}
#else
void enableInvalidParameters(SavedState) {}
#endif

bool hasPCREPatternMatch(StringPiece pattern, StringPiece target) {}

bool hasNoPCREPatternMatch(StringPiece pattern, StringPiece target) {}

} // namespace detail

CaptureFD::CaptureFD(int fd, ChunkCob chunk_cob)
    :{}

void CaptureFD::release() {}

CaptureFD::~CaptureFD() {}

std::string CaptureFD::read() const {}

std::string CaptureFD::readIncremental() {}

fs::path find_resource(const std::string& resource) {}

} // namespace test
} // namespace folly