Files
swift-mirror/test/ScanDependencies/tautological_import.swift
Artem Chikin 9c58b9f5f5 [Dependency Scanning] Detect and ignore (and warn about) tautological imports
This matches the current behavior in `ImportResolution`. The change refactors an existing utility function to do this check from `UnboundImport` to a common utility used now also in the scanner.
2023-11-01 06:46:42 -07:00

11 lines
552 B
Swift

// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/clang-module-cache)
// RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %S/Inputs/CHeaders -I %S/Inputs/Swift -module-name TautologicalModule -verify
// Check the contents of the JSON output
// RUN: %validate-json %t/deps.json | %FileCheck %s
import TautologicalModule // expected-warning {{file 'tautological_import.swift' is part of module 'TautologicalModule'; ignoring import}}
// CHECK: "mainModuleName": "TautologicalModule"