chromium/third_party/angle/util/test_utils_unittest.cpp

//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// test_utils_unittest.cpp: Unit tests for ANGLE's test utility functions

#include "gtest/gtest.h"

#include "common/system_utils.h"
#include "tests/test_utils/runner/TestSuite.h"
#include "util/Timer.h"
#include "util/test_utils.h"
#include "util/test_utils_unittest_helper.h"

usingnamespaceangle;

namespace
{
#if defined(ANGLE_PLATFORM_WINDOWS)
constexpr char kRunAppHelperExecutable[] = "test_utils_unittest_helper.exe";
#elif ANGLE_PLATFORM_IOS_FAMILY
constexpr char kRunAppHelperExecutable[] =
    "../test_utils_unittest_helper.app/test_utils_unittest_helper";
#else
constexpr char kRunAppHelperExecutable[] =;
#endif

// Transforms various line endings into C/Unix line endings:
//
// - A\nB -> A\nB
// - A\rB -> A\nB
// - A\r\nB -> A\nB
std::string NormalizeNewLines(const std::string &str)
{}

// Tests that Sleep() actually waits some time.
TEST(TestUtils, Sleep)
{}

// TODO: android support. http://anglebug.com/40096559
#if defined(ANGLE_PLATFORM_ANDROID)
#define MAYBE_RunApp
#define MAYBE_RunAppAsync
#define MAYBE_RunAppAsyncRedirectStderrToStdout
// TODO: fuchsia support. http://anglebug.com/42265786
#elif defined(ANGLE_PLATFORM_FUCHSIA)
#define MAYBE_RunApp
#define MAYBE_RunAppAsync
#define MAYBE_RunAppAsyncRedirectStderrToStdout
// TODO: iOS simulator support. http://anglebug.com/42266562
#elif ANGLE_PLATFORM_IOS_FAMILY_SIMULATOR
#define MAYBE_RunApp
#define MAYBE_RunAppAsync
#define MAYBE_RunAppAsyncRedirectStderrToStdout
#else
#define MAYBE_RunApp
#define MAYBE_RunAppAsync
#define MAYBE_RunAppAsyncRedirectStderrToStdout
#endif  // defined(ANGLE_PLATFORM_ANDROID)

std::string GetTestAppExecutablePath()
{}

// Test running an external application and receiving its output
TEST(TestUtils, MAYBE_RunApp)
{}

// Test running an external application and receiving its output asynchronously.
TEST(TestUtils, MAYBE_RunAppAsync)
{}

// Test running an external application and receiving its stdout and stderr output interleaved.
TEST(TestUtils, MAYBE_RunAppAsyncRedirectStderrToStdout)
{}

// Verify that NumberOfProcessors returns something reasonable.
TEST(TestUtils, NumberOfProcessors)
{}
}  // namespace