#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include "llvm/ProfileData/Coverage/CoverageMappingReader.h"
#include "llvm/ProfileData/Coverage/CoverageMappingWriter.h"
#include "llvm/ProfileData/InstrProfReader.h"
#include "llvm/ProfileData/InstrProfWriter.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Testing/Support/Error.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include "gtest/gtest.h"
#include <map>
#include <ostream>
#include <utility>
usingnamespacellvm;
usingnamespacecoverage;
[[nodiscard]] static ::testing::AssertionResult
ErrorEquals(Error E, coveragemap_error Expected_Err,
const std::string &Expected_Msg = std::string()) { … }
namespace llvm {
namespace coverage {
void PrintTo(const Counter &C, ::std::ostream *os) { … }
void PrintTo(const CoverageSegment &S, ::std::ostream *os) { … }
}
}
namespace {
struct OutputFunctionCoverageData { … };
struct CoverageMappingReaderMock : CoverageMappingReader { … };
struct InputFunctionCoverageData { … };
struct CoverageMappingTest : ::testing::TestWithParam<std::tuple<bool, bool>> { … };
TEST_P(CoverageMappingTest, basic_write_read) { … }
TEST_P(CoverageMappingTest, correct_deserialize_for_more_than_two_files) { … }
static const auto Err = …;
TEST_P(CoverageMappingTest, load_coverage_for_more_than_two_files) { … }
TEST_P(CoverageMappingTest, load_coverage_with_bogus_function_name) { … }
TEST_P(CoverageMappingTest, load_coverage_for_several_functions) { … }
TEST_P(CoverageMappingTest, create_combined_regions) { … }
TEST_P(CoverageMappingTest, skipped_segments_have_no_count) { … }
TEST_P(CoverageMappingTest, multiple_regions_end_after_parent_ends) { … }
TEST_P(CoverageMappingTest, multiple_completed_segments_at_same_loc) { … }
TEST_P(CoverageMappingTest, dont_emit_redundant_segments) { … }
TEST_P(CoverageMappingTest, dont_emit_closing_segment_at_new_region_start) { … }
TEST_P(CoverageMappingTest, handle_consecutive_regions_with_zero_length) { … }
TEST_P(CoverageMappingTest, handle_sandwiched_zero_length_region) { … }
TEST_P(CoverageMappingTest, handle_last_completed_region) { … }
TEST_P(CoverageMappingTest, expansion_gets_first_counter) { … }
TEST_P(CoverageMappingTest, basic_coverage_iteration) { … }
TEST_P(CoverageMappingTest, test_line_coverage_iterator) { … }
TEST_P(CoverageMappingTest, uncovered_function) { … }
TEST_P(CoverageMappingTest, uncovered_function_with_mapping) { … }
TEST_P(CoverageMappingTest, combine_regions) { … }
TEST_P(CoverageMappingTest, restore_combined_counter_after_nested_region) { … }
TEST_P(CoverageMappingTest, dont_combine_expansions) { … }
TEST_P(CoverageMappingTest, combine_expansions) { … }
TEST_P(CoverageMappingTest, non_code_region_counters) { … }
TEST_P(CoverageMappingTest, non_code_region_bitmask) { … }
TEST_P(CoverageMappingTest, decision_before_expansion) { … }
TEST_P(CoverageMappingTest, strip_filename_prefix) { … }
TEST_P(CoverageMappingTest, strip_unknown_filename_prefix) { … }
TEST_P(CoverageMappingTest, dont_detect_false_instantiations) { … }
TEST_P(CoverageMappingTest, load_coverage_for_expanded_file) { … }
TEST_P(CoverageMappingTest, skip_duplicate_function_record) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST(CoverageMappingTest, filename_roundtrip) { … }
TEST(CoverageMappingTest, filename_compilation_dir) { … }
TEST(CoverageMappingTest, TVIdxBuilder) { … }
}