def GenerateInclusionsDatabase(config): generator = inclusions_generator.InclusionsGenerator(config) including_to_included = (generator.MapIncludingToIncluded()) included_to_including = (generator.MapIncludedToIncluding()) inclusions_db = {} inclusions_db["config"] = config now = datetime.datetime.utcnow() inclusions_db["timestamp (UTC)"] = str(now) repo_rev = git_utils.GetRepoRevision(config["evaluated_repo_root"]) inclusions_db["repo_rev"] = repo_rev repo_commit_date = git_utils.GetRepoCommitDate( config["evaluated_repo_root"]) inclusions_db["repo_commit_date"] = repo_commit_date usage_analyzer_rev = git_utils.GetUsageAnalyzerRepoRevision() inclusions_db["usage_analyzer_rev"] = usage_analyzer_rev inclusions_db["included_to_including"] = (included_to_including) inclusions_db["including_to_included"] = (including_to_included) return inclusions_db
def test_MapIncludingToIncludedBasic(self): generator = inclusions_generator.InclusionsGenerator( test_utils.BASIC_TEST_CONFIG) inclusions = generator.MapIncludingToIncluded() test_utils.VerifyBasicIncludingToIncluded(self, inclusions)
def test_MapIncludedToIncludingComplex(self): generator = inclusions_generator.InclusionsGenerator( test_utils.COMPLEX_TEST_CONFIG) inclusions = generator.MapIncludedToIncluding() test_utils.VerifyComplexIncludedToIncluding(self, inclusions)