mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:20:11 +01:00
This removes hardcoding of the test target name from file_test. --------- Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
30 lines
820 B
C++
30 lines
820 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#include "common/build_data.h"
|
|
|
|
#include <gmock/gmock.h>
|
|
|
|
#include "common/ostream.h"
|
|
|
|
namespace Carbon {
|
|
namespace {
|
|
|
|
using ::testing::EndsWith;
|
|
using ::testing::HasSubstr;
|
|
|
|
TEST(BuildDataTest, Values) {
|
|
EXPECT_FALSE(BuildData::Platform.empty());
|
|
// Can't really test BuildCoverageEnabled.
|
|
|
|
// This doesn't require `//`, for a bit of incremental robustness.
|
|
EXPECT_THAT(BuildData::TargetName, EndsWith("/common:build_data_test"));
|
|
|
|
// This doesn't examine the path, for platform robustness (e.g. `.exe`).
|
|
EXPECT_THAT(BuildData::BuildTarget, HasSubstr("build_data_test"));
|
|
}
|
|
|
|
} // namespace
|
|
} // namespace Carbon
|