build_data_test.cpp 820 B

1234567891011121314151617181920212223242526272829
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include "common/build_data.h"
  5. #include <gmock/gmock.h>
  6. #include "common/ostream.h"
  7. namespace Carbon {
  8. namespace {
  9. using ::testing::EndsWith;
  10. using ::testing::HasSubstr;
  11. TEST(BuildDataTest, Values) {
  12. EXPECT_FALSE(BuildData::Platform.empty());
  13. // Can't really test BuildCoverageEnabled.
  14. // This doesn't require `//`, for a bit of incremental robustness.
  15. EXPECT_THAT(BuildData::TargetName, EndsWith("/common:build_data_test"));
  16. // This doesn't examine the path, for platform robustness (e.g. `.exe`).
  17. EXPECT_THAT(BuildData::BuildTarget, HasSubstr("build_data_test"));
  18. }
  19. } // namespace
  20. } // namespace Carbon