From 15b285527ab680dab9ba5907e24f4ef96ec3dac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Mon, 30 Dec 2024 12:26:46 +0100 Subject: [PATCH] Separate built-in rule tests from framework tests (#5924) * Short names for test modules * Lint plugins and `Package.swift` in integration tests * Simplify and merge file groups in Bazel * Move common functions to `TestHelpers` --- .sourcery/GeneratedTests.stencil | 2 +- .swiftlint.yml | 3 +- BUILD | 5 +- Package.swift | 26 +++++-- Tests/BUILD | 76 ++++++++++++------- .../AttributesRuleTests.swift | 1 + .../BlanketDisableCommandRuleTests.swift | 1 + ...hildOptionSeverityConfigurationTests.swift | 1 + .../CollectionAlignmentRuleTests.swift | 1 + .../ColonRuleTests.swift | 1 + .../CompilerProtocolInitRuleTests.swift | 1 + .../ComputedAccessorsOrderRuleTests.swift | 1 + ...ConditionalReturnsOnNewlineRuleTests.swift | 1 + .../ContainsOverFirstNotNilRuleTests.swift | 3 +- ...clomaticComplexityConfigurationTests.swift | 1 + .../CyclomaticComplexityRuleTests.swift | 1 + .../DeploymentTargetConfigurationTests.swift | 1 + .../DeploymentTargetRuleTests.swift | 3 +- .../DiscouragedDirectInitRuleTests.swift | 1 + .../DiscouragedObjectLiteralRuleTests.swift | 1 + .../DuplicateImportsRuleTests.swift | 0 .../EmptyCountRuleTests.swift | 1 + .../ExpiringTodoRuleTests.swift | 3 +- .../ExplicitInitRuleTests.swift | 1 + ...licitTypeInterfaceConfigurationTests.swift | 1 + .../ExplicitTypeInterfaceRuleTests.swift | 1 + .../FileHeaderRuleTests.swift | 3 +- .../FileLengthRuleTests.swift | 1 + .../FileNameNoSpaceRuleTests.swift | 5 +- .../FileNameRuleTests.swift | 3 +- .../FileTypesOrderRuleTests.swift | 1 + .../FunctionBodyLengthRuleTests.swift | 3 +- .../FunctionParameterCountRuleTests.swift | 1 + .../GenericTypeNameRuleTests.swift | 1 + .../IdentifierNameRuleTests.swift | 1 + .../ImplicitGetterRuleTests.swift | 1 + .../ImplicitReturnConfigurationTests.swift | 1 + .../ImplicitReturnRuleTests.swift | 1 + ...yUnwrappedOptionalConfigurationTests.swift | 1 + ...ImplicitlyUnwrappedOptionalRuleTests.swift | 1 + .../InclusiveLanguageRuleTests.swift | 1 + .../IndentationWidthRuleTests.swift | 2 +- .../LineLengthConfigurationTests.swift | 1 + .../LineLengthRuleTests.swift | 1 + .../MissingDocsRuleTests.swift | 1 + .../MultilineArgumentsRuleTests.swift | 1 + ...ultilineParametersConfigurationTests.swift | 1 + .../NameConfigurationTests.swift | 1 + .../NestingRuleTests.swift | 1 + .../NoEmptyBlockConfigurationTests.swift | 1 + .../NumberSeparatorRuleTests.swift | 1 + .../ObjectLiteralRuleTests.swift | 1 + .../OpeningBraceRuleTests.swift | 1 + .../PreferKeyPathRuleTests.swift | 1 + .../PrefixedTopLevelConstantRuleTests.swift | 1 + .../PrivateOverFilePrivateRuleTests.swift | 1 + .../RequiredEnumCaseConfigurationTests.swift | 1 + .../DocumentedType.swift | 0 .../FileHeaderEmpty.swift | 0 .../FileNameCaseMismatch.swift | 0 .../FileNameMatchingComplex.swift | 0 .../FileNameMatchingSimple.swift | 0 .../FileNameMismatch.swift | 0 .../FileNameMissing.swift | 0 .../File Name.swift | 0 .../File+Extension.swift | 0 .../File+Test Extension.swift | 0 .../FileNameNoSpaceRuleFixtures/File.swift | 0 .../FileNameRuleFixtures/BoolExtension.swift | 0 .../BoolExtensionTests.swift | 0 .../FileNameRuleFixtures/BoolExtensions.swift | 0 .../ExtensionBool+SwiftLint.swift | 0 .../FileNameRuleFixtures/ExtensionBool.swift | 0 .../FileNameRuleFixtures/ExtensionsBool.swift | 0 .../FileNameRuleFixtures/LinuxMain.swift | 2 +- ...Multiple.Levels.Deeply.Nested.MyType.swift | 0 .../FileNameRuleFixtures/MyClass.swift | 0 .../FileNameRuleFixtures/MyStruct.swift | 0 .../FileNameRuleFixtures/MyStructf.swift | 0 .../FileNameRuleFixtures/MyType.swift | 0 .../NSString+Extension.swift | 0 .../FileNameRuleFixtures/Nested.MyType.swift | 0 .../Notification.Name+Extension.swift | 0 .../NotificationName+Extension.swift | 0 .../Notification__Name+Extension.swift | 0 .../SLBoolExtension.swift | 0 .../Resources/FileNameRuleFixtures/main.swift | 0 .../StatementPositionRuleTests.swift | 1 + .../SwitchCaseAlignmentRuleTests.swift | 1 + .../TodoRuleTests.swift | 3 +- .../TrailingClosureConfigurationTests.swift | 1 + .../TrailingClosureRuleTests.swift | 1 + .../TrailingCommaRuleTests.swift | 1 + .../TrailingWhitespaceRuleTests.swift | 1 + .../TypeContentsOrderRuleTests.swift | 1 + .../TypeNameRuleTests.swift | 1 + .../TypesafeArrayInitRuleTests.swift | 3 +- .../UnneededOverrideRuleTests.swift | 1 + .../UnusedDeclarationConfigurationTests.swift | 0 .../UnusedOptionalBindingRuleTests.swift | 1 + .../VerticalWhitespaceRuleTests.swift | 1 + .../XCTSpecificMatcherRuleTests.swift | 3 +- Tests/ExtraRulesTests/ExtraRulesTests.swift | 2 +- .../AccessControlLevelTests.swift | 0 .../BaselineTests.swift | 0 .../CodeIndentingRewriterTests.swift | 0 .../CollectingRuleTests.swift | 2 +- .../CommandTests.swift | 0 .../ConfigurationAliasesTests.swift | 0 .../ConfigurationTests+Mock.swift | 15 +--- .../ConfigurationTests+MultipleConfigs.swift | 0 .../ConfigurationTests.swift | 0 .../CustomRulesTests.swift | 5 +- .../DisableAllTests.swift | 0 .../ExampleTests.swift | 0 .../Exports.swift | 2 +- .../ExtendedNSStringTests.swift | 0 .../ExtendedStringTests.swift | 0 .../GlobTests.swift | 3 +- .../LineEndingTests.swift | 0 .../LintOrAnalyzeOptionsTests.swift | 0 .../LinterCacheTests.swift | 0 .../ModifierOrderTests.swift | 0 .../ParserDiagnosticsTests.swift | 0 .../RegexConfigurationTests.swift | 0 .../RegionTests.swift | 0 .../ReporterTests.swift | 5 +- .../Resources/CannedCSVReporterOutput.csv | 0 .../CannedCheckstyleReporterOutput.xml | 0 .../CannedCodeClimateReporterOutput.json | 0 .../Resources/CannedEmojiReporterOutput.txt | 0 ...nnedGitHubActionsLoggingReporterOutput.txt | 0 .../CannedGitLabJUnitReporterOutput.xml | 0 .../Resources/CannedHTMLReporterOutput.html | 0 .../Resources/CannedJSONReporterOutput.json | 0 .../Resources/CannedJunitReporterOutput.xml | 0 .../Resources/CannedMarkdownReporterOutput.md | 0 .../CannedRelativePathReporterOutput.txt | 0 .../Resources/CannedSARIFReporterOutput.json | 0 .../CannedSonarQubeReporterOutput.json | 0 ...annedSummaryReporterNoViolationsOutput.txt | 0 .../Resources/CannedSummaryReporterOutput.txt | 0 .../Resources/CannedXcodeReporterOutput.txt | 0 .../Resources/ProjectMock/.swiftlint.yml | 0 .../ChildConfig/Cycle1/.swiftlint.yml | 0 .../ChildConfig/Cycle2/.swiftlint.yml | 0 .../ProjectMock/ChildConfig/Cycle2/child.yml | 0 .../ChildConfig/Cycle3/Main/.swiftlint.yml | 0 .../ChildConfig/Cycle3/Main/Folder/child2.yml | 0 .../ChildConfig/Cycle3/Main/child1.yml | 0 .../ProjectMock/ChildConfig/Cycle3/child3.yml | 0 .../ProjectMock/ChildConfig/Cycle4/child.yml | 0 .../ProjectMock/ChildConfig/Cycle4/main.yml | 0 .../ChildConfig/Test1/Main/Folder/child3.yml | 0 .../ChildConfig/Test1/Main/child1.yml | 0 .../ChildConfig/Test1/Main/child2.yml | 0 .../ChildConfig/Test1/Main/expected.yml | 0 .../ChildConfig/Test1/Main/main.yml | 0 .../ProjectMock/ChildConfig/Test1/child4.yml | 0 .../ProjectMock/ChildConfig/Test2/child1.yml | 0 .../ProjectMock/ChildConfig/Test2/child2.yml | 0 .../ChildConfig/Test2/expected.yml | 0 .../ProjectMock/ChildConfig/Test2/main.yml | 0 .../Directory.swift/DirectoryLevel1.swift | 0 .../ProjectMock/EmptyFolder/.gitkeep | 0 .../Resources/ProjectMock/Level0.swift | 0 .../Resources/ProjectMock/Level1/Level1.swift | 0 .../ProjectMock/Level1/Level2/.swiftlint.yml | 0 .../ProjectMock/Level1/Level2/Level2.swift | 0 .../Level1/Level2/Level3/.swiftlint.yml | 0 .../Level1/Level2/Level3/Level3.swift | 0 .../Level1/Level2/custom_rules.yml | 0 .../Level1/Level2/custom_rules_disabled.yml | 0 .../Level1/Level2/custom_rules_only.yml | 0 .../Level1/Level2/custom_rules_reconfig.yml | 0 .../NestedConfig/Test/.swiftlint.yml | 0 .../ProjectMock/NestedConfig/Test/Main.swift | 0 .../NestedConfig/Test/Sub/.swiftlint.yml | 0 .../NestedConfig/Test/Sub/Sub.swift | 0 .../ParentConfig/Cycle1/.swiftlint.yml | 0 .../ParentConfig/Cycle2/.swiftlint.yml | 0 .../ParentConfig/Cycle2/parent.yml | 0 .../ParentConfig/Cycle3/.swiftlint.yml | 0 .../ParentConfig/Cycle3/parent.yml | 0 .../ParentConfig/Test1/expected.yml | 0 .../ProjectMock/ParentConfig/Test1/main.yml | 0 .../ParentConfig/Test1/parent1.yml | 0 .../ParentConfig/Test1/parent2.yml | 0 .../ParentConfig/Test2/expected.yml | 0 .../ProjectMock/ParentConfig/Test2/main.yml | 0 .../ParentConfig/Test2/parent1.yml | 0 .../ParentConfig/Test2/parent2.yml | 0 .../ProjectMock/RemoteConfig/Child/child.yml | 0 .../RemoteConfig/Child/expected.yml | 0 .../ProjectMock/RemoteConfig/Child/main.yml | 0 .../RemoteConfig/Cycle/.swiftlint.yml | 0 .../RemoteConfig/LocalRef/.swiftlint.yml | 0 .../RemoteConfig/LocalRef/child1.yml | 0 .../RemoteConfig/LocalRef/child2.yml | 0 .../RemoteConfig/Parent/expected.yml | 0 .../ProjectMock/RemoteConfig/Parent/main.yml | 0 .../RemoteConfig/Parent/parent.yml | 0 .../Resources/ProjectMock/custom.yml | 0 .../ProjectMock/custom_included_excluded.yml | 0 .../Resources/ProjectMock/custom_rules.yml | 0 .../ProjectMock/custom_rules_only.yml | 0 .../Resources/test.txt | 0 .../Resources/test.yml | 0 .../RuleConfigurationDescriptionTests.swift | 2 +- .../RuleConfigurationTests.swift | 0 .../RuleTests.swift | 0 .../RulesTests.swift | 0 .../SourceKitCrashTests.swift | 2 +- .../StringExtensionTests.swift | 0 .../StringViewExtensionTests.swift | 0 .../SwiftLintFileTests.swift | 0 .../SwiftVersionTests.swift | 0 .../YamlParserTests.swift | 0 .../YamlSwiftLintTests.swift | 2 +- Tests/GeneratedTests/GeneratedTests.swift | 2 +- Tests/IntegrationTests/IntegrationTests.swift | 2 +- .../XCTestCase+BundlePath.swift | 20 ----- .../RuleDescription+Examples.swift | 0 Tests/TestHelpers/RuleMock.swift | 19 +++++ .../SwiftLintTestCase.swift | 0 .../TestHelpers.swift | 0 Tests/TestHelpers/TestResources.swift | 14 ++++ 227 files changed, 200 insertions(+), 99 deletions(-) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/AttributesRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/BlanketDisableCommandRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ChildOptionSeverityConfigurationTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/CollectionAlignmentRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ColonRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/CompilerProtocolInitRuleTests.swift (97%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ComputedAccessorsOrderRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ConditionalReturnsOnNewlineRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ContainsOverFirstNotNilRuleTests.swift (92%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/CyclomaticComplexityConfigurationTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/CyclomaticComplexityRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/DeploymentTargetConfigurationTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/DeploymentTargetRuleTests.swift (95%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/DiscouragedDirectInitRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/DiscouragedObjectLiteralRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/DuplicateImportsRuleTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/EmptyCountRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ExpiringTodoRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ExplicitInitRuleTests.swift (97%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ExplicitTypeInterfaceConfigurationTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ExplicitTypeInterfaceRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/FileHeaderRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/FileLengthRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/FileNameNoSpaceRuleTests.swift (89%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/FileNameRuleTests.swift (97%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/FileTypesOrderRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/FunctionBodyLengthRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/FunctionParameterCountRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/GenericTypeNameRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/IdentifierNameRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ImplicitGetterRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ImplicitReturnConfigurationTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ImplicitReturnRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ImplicitlyUnwrappedOptionalConfigurationTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ImplicitlyUnwrappedOptionalRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/InclusiveLanguageRuleTests.swift (97%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/IndentationWidthRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/LineLengthConfigurationTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/LineLengthRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/MissingDocsRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/MultilineArgumentsRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/MultilineParametersConfigurationTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/NameConfigurationTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/NestingRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/NoEmptyBlockConfigurationTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/NumberSeparatorRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/ObjectLiteralRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/OpeningBraceRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/PreferKeyPathRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/PrefixedTopLevelConstantRuleTests.swift (97%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/PrivateOverFilePrivateRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/RequiredEnumCaseConfigurationTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileHeaderRuleFixtures/DocumentedType.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileHeaderRuleFixtures/FileHeaderEmpty.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileHeaderRuleFixtures/FileNameCaseMismatch.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileHeaderRuleFixtures/FileNameMatchingComplex.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileHeaderRuleFixtures/FileNameMatchingSimple.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileHeaderRuleFixtures/FileNameMismatch.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileHeaderRuleFixtures/FileNameMissing.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameNoSpaceRuleFixtures/File Name.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameNoSpaceRuleFixtures/File+Extension.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameNoSpaceRuleFixtures/File+Test Extension.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameNoSpaceRuleFixtures/File.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/BoolExtension.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/BoolExtensionTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/BoolExtensions.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/ExtensionBool+SwiftLint.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/ExtensionBool.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/ExtensionsBool.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/LinuxMain.swift (95%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/Multiple.Levels.Deeply.Nested.MyType.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/MyClass.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/MyStruct.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/MyStructf.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/MyType.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/NSString+Extension.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/Nested.MyType.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/Notification.Name+Extension.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/NotificationName+Extension.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/Notification__Name+Extension.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/SLBoolExtension.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/Resources/FileNameRuleFixtures/main.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/StatementPositionRuleTests.swift (94%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/SwitchCaseAlignmentRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/TodoRuleTests.swift (95%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/TrailingClosureConfigurationTests.swift (97%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/TrailingClosureRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/TrailingCommaRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/TrailingWhitespaceRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/TypeContentsOrderRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/TypeNameRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/TypesafeArrayInitRuleTests.swift (85%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/UnneededOverrideRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/UnusedDeclarationConfigurationTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/UnusedOptionalBindingRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/VerticalWhitespaceRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => BuiltInRulesTests}/XCTSpecificMatcherRuleTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/AccessControlLevelTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/BaselineTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/CodeIndentingRewriterTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/CollectingRuleTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/CommandTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/ConfigurationAliasesTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/ConfigurationTests+Mock.swift (92%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/ConfigurationTests+MultipleConfigs.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/ConfigurationTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/CustomRulesTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/DisableAllTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/ExampleTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Exports.swift (75%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/ExtendedNSStringTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/ExtendedStringTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/GlobTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/LineEndingTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/LintOrAnalyzeOptionsTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/LinterCacheTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/ModifierOrderTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/ParserDiagnosticsTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/RegexConfigurationTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/RegionTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/ReporterTests.swift (97%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedCSVReporterOutput.csv (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedCheckstyleReporterOutput.xml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedCodeClimateReporterOutput.json (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedEmojiReporterOutput.txt (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedGitHubActionsLoggingReporterOutput.txt (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedGitLabJUnitReporterOutput.xml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedHTMLReporterOutput.html (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedJSONReporterOutput.json (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedJunitReporterOutput.xml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedMarkdownReporterOutput.md (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedRelativePathReporterOutput.txt (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedSARIFReporterOutput.json (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedSonarQubeReporterOutput.json (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedSummaryReporterNoViolationsOutput.txt (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedSummaryReporterOutput.txt (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/CannedXcodeReporterOutput.txt (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Cycle1/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Cycle2/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Cycle2/child.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Cycle3/Main/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Cycle3/Main/Folder/child2.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Cycle3/Main/child1.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Cycle3/child3.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Cycle4/child.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Cycle4/main.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Test1/Main/Folder/child3.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Test1/Main/child1.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Test1/Main/child2.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Test1/Main/expected.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Test1/Main/main.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Test1/child4.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Test2/child1.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Test2/child2.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Test2/expected.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ChildConfig/Test2/main.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Directory.swift/DirectoryLevel1.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/EmptyFolder/.gitkeep (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Level0.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Level1/Level1.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Level1/Level2/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Level1/Level2/Level2.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Level1/Level2/Level3/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Level1/Level2/Level3/Level3.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Level1/Level2/custom_rules.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Level1/Level2/custom_rules_disabled.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Level1/Level2/custom_rules_only.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/Level1/Level2/custom_rules_reconfig.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/NestedConfig/Test/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/NestedConfig/Test/Main.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/NestedConfig/Test/Sub/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/NestedConfig/Test/Sub/Sub.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Cycle1/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Cycle2/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Cycle2/parent.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Cycle3/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Cycle3/parent.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Test1/expected.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Test1/main.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Test1/parent1.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Test1/parent2.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Test2/expected.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Test2/main.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Test2/parent1.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/ParentConfig/Test2/parent2.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/RemoteConfig/Child/child.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/RemoteConfig/Child/expected.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/RemoteConfig/Child/main.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/RemoteConfig/Cycle/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/RemoteConfig/LocalRef/.swiftlint.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/RemoteConfig/LocalRef/child1.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/RemoteConfig/LocalRef/child2.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/RemoteConfig/Parent/expected.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/RemoteConfig/Parent/main.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/RemoteConfig/Parent/parent.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/custom.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/custom_included_excluded.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/custom_rules.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/ProjectMock/custom_rules_only.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/test.txt (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/Resources/test.yml (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/RuleConfigurationDescriptionTests.swift (99%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/RuleConfigurationTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/RuleTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/RulesTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/SourceKitCrashTests.swift (98%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/StringExtensionTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/StringViewExtensionTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/SwiftLintFileTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/SwiftVersionTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/YamlParserTests.swift (100%) rename Tests/{SwiftLintFrameworkTests => FrameworkTests}/YamlSwiftLintTests.swift (96%) delete mode 100644 Tests/SwiftLintFrameworkTests/XCTestCase+BundlePath.swift rename Tests/{SwiftLintTestHelpers => TestHelpers}/RuleDescription+Examples.swift (100%) create mode 100644 Tests/TestHelpers/RuleMock.swift rename Tests/{SwiftLintTestHelpers => TestHelpers}/SwiftLintTestCase.swift (100%) rename Tests/{SwiftLintTestHelpers => TestHelpers}/TestHelpers.swift (100%) create mode 100644 Tests/TestHelpers/TestResources.swift diff --git a/.sourcery/GeneratedTests.stencil b/.sourcery/GeneratedTests.stencil index cd6f14c0fc..8536aec1ab 100644 --- a/.sourcery/GeneratedTests.stencil +++ b/.sourcery/GeneratedTests.stencil @@ -1,6 +1,6 @@ @testable import SwiftLintBuiltInRules @testable import SwiftLintCore -import SwiftLintTestHelpers +import TestHelpers // swiftlint:disable:next blanket_disable_command // swiftlint:disable file_length single_test_class type_name diff --git a/.swiftlint.yml b/.swiftlint.yml index c5f771a23b..ba12d32d8f 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -5,7 +5,8 @@ included: - Tests - Package.swift excluded: - - Tests/SwiftLintFrameworkTests/Resources + - Tests/BuiltInRulesTests/Resources + - Tests/FrameworkTests/Resources # Enabled/disabled rules analyzer_rules: diff --git a/BUILD b/BUILD index bf7e15a9e6..59db0a9498 100644 --- a/BUILD +++ b/BUILD @@ -194,9 +194,10 @@ cc_library( filegroup( name = "LintInputs", - srcs = glob(["Source/**/*.swift"]) + [ + srcs = glob(["Plugins/**/*.swift", "Source/**/*.swift"]) + [ ".swiftlint.yml", - "//Tests:SwiftLintFrameworkTestsData", + "Package.swift", + "//Tests:TestSources", ], visibility = ["//Tests:__subpackages__"], ) diff --git a/Package.swift b/Package.swift index e7e7ea10b1..d4ac4a774f 100644 --- a/Package.swift +++ b/Package.swift @@ -113,18 +113,18 @@ let package = Package( ), .target(name: "DyldWarningWorkaround"), .target( - name: "SwiftLintTestHelpers", + name: "TestHelpers", dependencies: [ "SwiftLintFramework" ], - path: "Tests/SwiftLintTestHelpers", + path: "Tests/TestHelpers", swiftSettings: swiftFeatures ), .testTarget( - name: "SwiftLintFrameworkTests", + name: "FrameworkTests", dependencies: [ "SwiftLintFramework", - "SwiftLintTestHelpers", + "TestHelpers", "SwiftLintCoreMacros", ], exclude: [ @@ -136,7 +136,7 @@ let package = Package( name: "GeneratedTests", dependencies: [ "SwiftLintFramework", - "SwiftLintTestHelpers", + "TestHelpers", ], swiftSettings: swiftFeatures ), @@ -144,18 +144,30 @@ let package = Package( name: "IntegrationTests", dependencies: [ "SwiftLintFramework", - "SwiftLintTestHelpers", + "TestHelpers", ], exclude: [ "default_rule_configurations.yml" ], swiftSettings: swiftFeatures ), + .testTarget( + name: "BuiltInRulesTests", + dependencies: [ + "SwiftLintBuiltInRules", + "SwiftLintFramework", + "TestHelpers", + ], + exclude: [ + "Resources", + ], + swiftSettings: swiftFeatures + ), .testTarget( name: "ExtraRulesTests", dependencies: [ "SwiftLintFramework", - "SwiftLintTestHelpers", + "TestHelpers", ], swiftSettings: swiftFeatures ), diff --git a/Tests/BUILD b/Tests/BUILD index 2c846a7625..57ef810106 100644 --- a/Tests/BUILD +++ b/Tests/BUILD @@ -55,13 +55,13 @@ swift_test( deps = [":MacroTests.library"], ) -# SwiftLintTestHelpers +# TestHelpers swift_library( - name = "SwiftLintTestHelpers", + name = "TestHelpers", testonly = True, - srcs = glob(["SwiftLintTestHelpers/**/*.swift"]), - module_name = "SwiftLintTestHelpers", + srcs = glob(["TestHelpers/**/*.swift"]), + module_name = "TestHelpers", package_name = "SwiftLint", deps = [ "//:SwiftLintFramework", @@ -69,51 +69,64 @@ swift_library( copts = copts, ) -# SwiftLintFrameworkTests +# BuiltInRulesTests -filegroup( - name = "SwiftLintFrameworkTestsSources", +swift_library( + name = "BuiltInRulesTests.library", + testonly = True, srcs = glob( - ["SwiftLintFrameworkTests/**/*.swift"], + ["BuiltInRulesTests/**/*.swift"], exclude = [ - "SwiftLintFrameworkTests/Resources/**", + "BuiltInRulesTests/Resources/**", # Bazel doesn't support paths with spaces in them - "SwiftLintFrameworkTests/FileNameNoSpaceRuleTests.swift", + "BuiltInRulesTests/FileNameNoSpaceRuleTests.swift", ], ), + module_name = "BuiltInRulesTests", + package_name = "SwiftLint", + deps = [ + ":TestHelpers", + ], + copts = copts, ) -filegroup( - name = "SwiftLintFrameworkTestsData", - srcs = glob( - ["**/**"], +swift_test( + name = "BuiltInRulesTests", + data = glob( + ["BuiltInRulesTests/Resources/**"], # Bazel doesn't support paths with spaces in them - exclude = ["SwiftLintFrameworkTests/Resources/FileNameNoSpaceRuleFixtures/**"], + exclude = ["BuiltInRulesTests/Resources/FileNameNoSpaceRuleFixtures/**"], ), visibility = ["//visibility:public"], + deps = [":BuiltInRulesTests.library"], ) +# FrameworkTests + swift_library( - name = "SwiftLintFrameworkTests.library", + name = "FrameworkTests.library", testonly = True, - srcs = [":SwiftLintFrameworkTestsSources"], - module_name = "SwiftLintFrameworkTests", + srcs = glob( + ["FrameworkTests/**/*.swift"], + exclude = [ + "FrameworkTests/Resources/**", + ], + ), + module_name = "FrameworkTests", package_name = "SwiftLint", deps = [ - ":SwiftLintTestHelpers", + ":TestHelpers", ], copts = copts, ) swift_test( - name = "SwiftLintFrameworkTests", + name = "FrameworkTests", data = glob( - ["SwiftLintFrameworkTests/Resources/**"], - # Bazel doesn't support paths with spaces in them - exclude = ["SwiftLintFrameworkTests/Resources/FileNameNoSpaceRuleFixtures/**"], + ["FrameworkTests/Resources/**"], ), visibility = ["//visibility:public"], - deps = [":SwiftLintFrameworkTests.library"], + deps = [":FrameworkTests.library"], ) # GeneratedTests @@ -125,7 +138,7 @@ swift_library( module_name = "GeneratedTests", package_name = "SwiftLint", deps = [ - ":SwiftLintTestHelpers", + ":TestHelpers", ], copts = copts, ) @@ -138,6 +151,15 @@ swift_test( # IntegrationTests +filegroup( + name = "TestSources", + srcs = glob( + ["**/*.swift"], + exclude = ["**/Resources/**"], + ), + visibility = ["//visibility:public"], +) + swift_library( name = "IntegrationTests.library", testonly = True, @@ -145,7 +167,7 @@ swift_library( module_name = "IntegrationTests", package_name = "SwiftLint", deps = [ - ":SwiftLintTestHelpers", + ":TestHelpers", ], copts = copts, ) @@ -184,7 +206,7 @@ swift_library( module_name = "ExtraRulesTests", package_name = "SwiftLint", deps = [ - ":SwiftLintTestHelpers", + ":TestHelpers", ], ) diff --git a/Tests/SwiftLintFrameworkTests/AttributesRuleTests.swift b/Tests/BuiltInRulesTests/AttributesRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/AttributesRuleTests.swift rename to Tests/BuiltInRulesTests/AttributesRuleTests.swift index 2a0f5444ee..ec8a993573 100644 --- a/Tests/SwiftLintFrameworkTests/AttributesRuleTests.swift +++ b/Tests/BuiltInRulesTests/AttributesRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class AttributesRuleTests: SwiftLintTestCase { func testAttributesWithAlwaysOnSameLine() { diff --git a/Tests/SwiftLintFrameworkTests/BlanketDisableCommandRuleTests.swift b/Tests/BuiltInRulesTests/BlanketDisableCommandRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/BlanketDisableCommandRuleTests.swift rename to Tests/BuiltInRulesTests/BlanketDisableCommandRuleTests.swift index 9540c085c1..061f7a637e 100644 --- a/Tests/SwiftLintFrameworkTests/BlanketDisableCommandRuleTests.swift +++ b/Tests/BuiltInRulesTests/BlanketDisableCommandRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class BlanketDisableCommandRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/ChildOptionSeverityConfigurationTests.swift b/Tests/BuiltInRulesTests/ChildOptionSeverityConfigurationTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/ChildOptionSeverityConfigurationTests.swift rename to Tests/BuiltInRulesTests/ChildOptionSeverityConfigurationTests.swift index 10d4cd4d0c..71d82b74e9 100644 --- a/Tests/SwiftLintFrameworkTests/ChildOptionSeverityConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/ChildOptionSeverityConfigurationTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class ChildOptionSeverityConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/CollectionAlignmentRuleTests.swift b/Tests/BuiltInRulesTests/CollectionAlignmentRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/CollectionAlignmentRuleTests.swift rename to Tests/BuiltInRulesTests/CollectionAlignmentRuleTests.swift index 364589bc88..13b63a3b82 100644 --- a/Tests/SwiftLintFrameworkTests/CollectionAlignmentRuleTests.swift +++ b/Tests/BuiltInRulesTests/CollectionAlignmentRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class CollectionAlignmentRuleTests: SwiftLintTestCase { func testCollectionAlignmentWithAlignLeft() { diff --git a/Tests/SwiftLintFrameworkTests/ColonRuleTests.swift b/Tests/BuiltInRulesTests/ColonRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/ColonRuleTests.swift rename to Tests/BuiltInRulesTests/ColonRuleTests.swift index 095214241e..cc3c45f7cf 100644 --- a/Tests/SwiftLintFrameworkTests/ColonRuleTests.swift +++ b/Tests/BuiltInRulesTests/ColonRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class ColonRuleTests: SwiftLintTestCase { func testColonWithFlexibleRightSpace() { diff --git a/Tests/SwiftLintFrameworkTests/CompilerProtocolInitRuleTests.swift b/Tests/BuiltInRulesTests/CompilerProtocolInitRuleTests.swift similarity index 97% rename from Tests/SwiftLintFrameworkTests/CompilerProtocolInitRuleTests.swift rename to Tests/BuiltInRulesTests/CompilerProtocolInitRuleTests.swift index 68460fd73b..27ddecd07f 100644 --- a/Tests/SwiftLintFrameworkTests/CompilerProtocolInitRuleTests.swift +++ b/Tests/BuiltInRulesTests/CompilerProtocolInitRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class CompilerProtocolInitRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/ComputedAccessorsOrderRuleTests.swift b/Tests/BuiltInRulesTests/ComputedAccessorsOrderRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/ComputedAccessorsOrderRuleTests.swift rename to Tests/BuiltInRulesTests/ComputedAccessorsOrderRuleTests.swift index 1066d61010..878814f0b3 100644 --- a/Tests/SwiftLintFrameworkTests/ComputedAccessorsOrderRuleTests.swift +++ b/Tests/BuiltInRulesTests/ComputedAccessorsOrderRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class ComputedAccessorsOrderRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/ConditionalReturnsOnNewlineRuleTests.swift b/Tests/BuiltInRulesTests/ConditionalReturnsOnNewlineRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/ConditionalReturnsOnNewlineRuleTests.swift rename to Tests/BuiltInRulesTests/ConditionalReturnsOnNewlineRuleTests.swift index e2ffbbbc1f..96a31dbd7e 100644 --- a/Tests/SwiftLintFrameworkTests/ConditionalReturnsOnNewlineRuleTests.swift +++ b/Tests/BuiltInRulesTests/ConditionalReturnsOnNewlineRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class ConditionalReturnsOnNewlineRuleTests: SwiftLintTestCase { func testConditionalReturnsOnNewlineWithIfOnly() { diff --git a/Tests/SwiftLintFrameworkTests/ContainsOverFirstNotNilRuleTests.swift b/Tests/BuiltInRulesTests/ContainsOverFirstNotNilRuleTests.swift similarity index 92% rename from Tests/SwiftLintFrameworkTests/ContainsOverFirstNotNilRuleTests.swift rename to Tests/BuiltInRulesTests/ContainsOverFirstNotNilRuleTests.swift index 83c162fba3..c2657af060 100644 --- a/Tests/SwiftLintFrameworkTests/ContainsOverFirstNotNilRuleTests.swift +++ b/Tests/BuiltInRulesTests/ContainsOverFirstNotNilRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class ContainsOverFirstNotNilRuleTests: SwiftLintTestCase { @@ -25,6 +26,6 @@ final class ContainsOverFirstNotNilRuleTests: SwiftLintTestCase { return [] } - return SwiftLintFrameworkTests.violations(example, config: config) + return TestHelpers.violations(example, config: config) } } diff --git a/Tests/SwiftLintFrameworkTests/CyclomaticComplexityConfigurationTests.swift b/Tests/BuiltInRulesTests/CyclomaticComplexityConfigurationTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/CyclomaticComplexityConfigurationTests.swift rename to Tests/BuiltInRulesTests/CyclomaticComplexityConfigurationTests.swift index eb9638a82f..d81f08b69b 100644 --- a/Tests/SwiftLintFrameworkTests/CyclomaticComplexityConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/CyclomaticComplexityConfigurationTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class CyclomaticComplexityConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/CyclomaticComplexityRuleTests.swift b/Tests/BuiltInRulesTests/CyclomaticComplexityRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/CyclomaticComplexityRuleTests.swift rename to Tests/BuiltInRulesTests/CyclomaticComplexityRuleTests.swift index 8dab89a1b4..4b6e28bb64 100644 --- a/Tests/SwiftLintFrameworkTests/CyclomaticComplexityRuleTests.swift +++ b/Tests/BuiltInRulesTests/CyclomaticComplexityRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class CyclomaticComplexityRuleTests: SwiftLintTestCase { private lazy var complexSwitchExample: Example = { diff --git a/Tests/SwiftLintFrameworkTests/DeploymentTargetConfigurationTests.swift b/Tests/BuiltInRulesTests/DeploymentTargetConfigurationTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/DeploymentTargetConfigurationTests.swift rename to Tests/BuiltInRulesTests/DeploymentTargetConfigurationTests.swift index f9edd35491..f5ee0e659b 100644 --- a/Tests/SwiftLintFrameworkTests/DeploymentTargetConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/DeploymentTargetConfigurationTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class DeploymentTargetConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/DeploymentTargetRuleTests.swift b/Tests/BuiltInRulesTests/DeploymentTargetRuleTests.swift similarity index 95% rename from Tests/SwiftLintFrameworkTests/DeploymentTargetRuleTests.swift rename to Tests/BuiltInRulesTests/DeploymentTargetRuleTests.swift index b101b89b0c..15c81e378a 100644 --- a/Tests/SwiftLintFrameworkTests/DeploymentTargetRuleTests.swift +++ b/Tests/BuiltInRulesTests/DeploymentTargetRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class DeploymentTargetRuleTests: SwiftLintTestCase { @@ -39,6 +40,6 @@ final class DeploymentTargetRuleTests: SwiftLintTestCase { return [] } - return SwiftLintFrameworkTests.violations(example, config: config) + return TestHelpers.violations(example, config: config) } } diff --git a/Tests/SwiftLintFrameworkTests/DiscouragedDirectInitRuleTests.swift b/Tests/BuiltInRulesTests/DiscouragedDirectInitRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/DiscouragedDirectInitRuleTests.swift rename to Tests/BuiltInRulesTests/DiscouragedDirectInitRuleTests.swift index 74f0f4fd57..35897dec9c 100644 --- a/Tests/SwiftLintFrameworkTests/DiscouragedDirectInitRuleTests.swift +++ b/Tests/BuiltInRulesTests/DiscouragedDirectInitRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class DiscouragedDirectInitRuleTests: SwiftLintTestCase { private let baseDescription = DiscouragedDirectInitRule.description diff --git a/Tests/SwiftLintFrameworkTests/DiscouragedObjectLiteralRuleTests.swift b/Tests/BuiltInRulesTests/DiscouragedObjectLiteralRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/DiscouragedObjectLiteralRuleTests.swift rename to Tests/BuiltInRulesTests/DiscouragedObjectLiteralRuleTests.swift index 1a2f17e04e..fe90df77e4 100644 --- a/Tests/SwiftLintFrameworkTests/DiscouragedObjectLiteralRuleTests.swift +++ b/Tests/BuiltInRulesTests/DiscouragedObjectLiteralRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class DiscouragedObjectLiteralRuleTests: SwiftLintTestCase { func testWithImageLiteral() { diff --git a/Tests/SwiftLintFrameworkTests/DuplicateImportsRuleTests.swift b/Tests/BuiltInRulesTests/DuplicateImportsRuleTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/DuplicateImportsRuleTests.swift rename to Tests/BuiltInRulesTests/DuplicateImportsRuleTests.swift diff --git a/Tests/SwiftLintFrameworkTests/EmptyCountRuleTests.swift b/Tests/BuiltInRulesTests/EmptyCountRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/EmptyCountRuleTests.swift rename to Tests/BuiltInRulesTests/EmptyCountRuleTests.swift index 7dddfe4f23..7df9e49108 100644 --- a/Tests/SwiftLintFrameworkTests/EmptyCountRuleTests.swift +++ b/Tests/BuiltInRulesTests/EmptyCountRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class EmptyCountRuleTests: SwiftLintTestCase { func testEmptyCountWithOnlyAfterDot() { diff --git a/Tests/SwiftLintFrameworkTests/ExpiringTodoRuleTests.swift b/Tests/BuiltInRulesTests/ExpiringTodoRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/ExpiringTodoRuleTests.swift rename to Tests/BuiltInRulesTests/ExpiringTodoRuleTests.swift index bb723d5321..b0dc3015f1 100644 --- a/Tests/SwiftLintFrameworkTests/ExpiringTodoRuleTests.swift +++ b/Tests/BuiltInRulesTests/ExpiringTodoRuleTests.swift @@ -1,5 +1,6 @@ @testable import SwiftLintBuiltInRules import SwiftLintFramework +import TestHelpers import XCTest final class ExpiringTodoRuleTests: SwiftLintTestCase { @@ -142,7 +143,7 @@ final class ExpiringTodoRuleTests: SwiftLintTestCase { } private func violations(_ example: Example) -> [StyleViolation] { - SwiftLintFrameworkTests.violations(example, config: config) + TestHelpers.violations(example, config: config) } private func dateString(for status: ExpiringTodoRule.ExpiryViolationLevel) -> String { diff --git a/Tests/SwiftLintFrameworkTests/ExplicitInitRuleTests.swift b/Tests/BuiltInRulesTests/ExplicitInitRuleTests.swift similarity index 97% rename from Tests/SwiftLintFrameworkTests/ExplicitInitRuleTests.swift rename to Tests/BuiltInRulesTests/ExplicitInitRuleTests.swift index 65dfee4653..407efbe3bc 100644 --- a/Tests/SwiftLintFrameworkTests/ExplicitInitRuleTests.swift +++ b/Tests/BuiltInRulesTests/ExplicitInitRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class ExplicitInitRuleTests: SwiftLintTestCase { func testIncludeBareInit() { diff --git a/Tests/SwiftLintFrameworkTests/ExplicitTypeInterfaceConfigurationTests.swift b/Tests/BuiltInRulesTests/ExplicitTypeInterfaceConfigurationTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/ExplicitTypeInterfaceConfigurationTests.swift rename to Tests/BuiltInRulesTests/ExplicitTypeInterfaceConfigurationTests.swift index df4d43731c..ee1d9b7a60 100644 --- a/Tests/SwiftLintFrameworkTests/ExplicitTypeInterfaceConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/ExplicitTypeInterfaceConfigurationTests.swift @@ -1,5 +1,6 @@ @testable import SwiftLintBuiltInRules @testable import SwiftLintCore +import TestHelpers import XCTest final class ExplicitTypeInterfaceConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/ExplicitTypeInterfaceRuleTests.swift b/Tests/BuiltInRulesTests/ExplicitTypeInterfaceRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/ExplicitTypeInterfaceRuleTests.swift rename to Tests/BuiltInRulesTests/ExplicitTypeInterfaceRuleTests.swift index 37d079aa3a..99c9120ec3 100644 --- a/Tests/SwiftLintFrameworkTests/ExplicitTypeInterfaceRuleTests.swift +++ b/Tests/BuiltInRulesTests/ExplicitTypeInterfaceRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class ExplicitTypeInterfaceRuleTests: SwiftLintTestCase { func testLocalVars() { diff --git a/Tests/SwiftLintFrameworkTests/FileHeaderRuleTests.swift b/Tests/BuiltInRulesTests/FileHeaderRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/FileHeaderRuleTests.swift rename to Tests/BuiltInRulesTests/FileHeaderRuleTests.swift index 8867afcf4a..82b56cdfea 100644 --- a/Tests/SwiftLintFrameworkTests/FileHeaderRuleTests.swift +++ b/Tests/BuiltInRulesTests/FileHeaderRuleTests.swift @@ -1,7 +1,8 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest -private let fixturesDirectory = "\(TestResources.path)/FileHeaderRuleFixtures" +private let fixturesDirectory = "\(TestResources.path())/FileHeaderRuleFixtures" final class FileHeaderRuleTests: SwiftLintTestCase { private func validate(fileName: String, using configuration: Any) throws -> [StyleViolation] { diff --git a/Tests/SwiftLintFrameworkTests/FileLengthRuleTests.swift b/Tests/BuiltInRulesTests/FileLengthRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/FileLengthRuleTests.swift rename to Tests/BuiltInRulesTests/FileLengthRuleTests.swift index 6b629889bf..490377caac 100644 --- a/Tests/SwiftLintFrameworkTests/FileLengthRuleTests.swift +++ b/Tests/BuiltInRulesTests/FileLengthRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class FileLengthRuleTests: SwiftLintTestCase { func testFileLengthWithDefaultConfiguration() { diff --git a/Tests/SwiftLintFrameworkTests/FileNameNoSpaceRuleTests.swift b/Tests/BuiltInRulesTests/FileNameNoSpaceRuleTests.swift similarity index 89% rename from Tests/SwiftLintFrameworkTests/FileNameNoSpaceRuleTests.swift rename to Tests/BuiltInRulesTests/FileNameNoSpaceRuleTests.swift index 4aee8dcc7c..9c0b3a1d01 100644 --- a/Tests/SwiftLintFrameworkTests/FileNameNoSpaceRuleTests.swift +++ b/Tests/BuiltInRulesTests/FileNameNoSpaceRuleTests.swift @@ -1,10 +1,9 @@ import SourceKittenFramework @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest -private let fixturesDirectory = #filePath.bridge() - .deletingLastPathComponent.bridge() - .appendingPathComponent("Resources/FileNameNoSpaceRuleFixtures") +private let fixturesDirectory = "\(TestResources.path())/FileNameNoSpaceRuleFixtures" final class FileNameNoSpaceRuleTests: SwiftLintTestCase { private func validate(fileName: String, excludedOverride: [String]? = nil) throws -> [StyleViolation] { diff --git a/Tests/SwiftLintFrameworkTests/FileNameRuleTests.swift b/Tests/BuiltInRulesTests/FileNameRuleTests.swift similarity index 97% rename from Tests/SwiftLintFrameworkTests/FileNameRuleTests.swift rename to Tests/BuiltInRulesTests/FileNameRuleTests.swift index 4e3a2923fa..147112846b 100644 --- a/Tests/SwiftLintFrameworkTests/FileNameRuleTests.swift +++ b/Tests/BuiltInRulesTests/FileNameRuleTests.swift @@ -1,7 +1,8 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest -private let fixturesDirectory = "\(TestResources.path)/FileNameRuleFixtures" +private let fixturesDirectory = "\(TestResources.path())/FileNameRuleFixtures" final class FileNameRuleTests: SwiftLintTestCase { private func validate(fileName: String, diff --git a/Tests/SwiftLintFrameworkTests/FileTypesOrderRuleTests.swift b/Tests/BuiltInRulesTests/FileTypesOrderRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/FileTypesOrderRuleTests.swift rename to Tests/BuiltInRulesTests/FileTypesOrderRuleTests.swift index e9a6f8c93d..4632cd32f7 100644 --- a/Tests/SwiftLintFrameworkTests/FileTypesOrderRuleTests.swift +++ b/Tests/BuiltInRulesTests/FileTypesOrderRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class FileTypesOrderRuleTests: SwiftLintTestCase { // swiftlint:disable:next function_body_length diff --git a/Tests/SwiftLintFrameworkTests/FunctionBodyLengthRuleTests.swift b/Tests/BuiltInRulesTests/FunctionBodyLengthRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/FunctionBodyLengthRuleTests.swift rename to Tests/BuiltInRulesTests/FunctionBodyLengthRuleTests.swift index d849b2996d..f8acfbaa2e 100644 --- a/Tests/SwiftLintFrameworkTests/FunctionBodyLengthRuleTests.swift +++ b/Tests/BuiltInRulesTests/FunctionBodyLengthRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest private func funcWithBody(_ body: String, @@ -102,6 +103,6 @@ final class FunctionBodyLengthRuleTests: SwiftLintTestCase { private func violations(_ example: Example, configuration: Any? = nil) -> [StyleViolation] { let config = makeConfig(configuration, FunctionBodyLengthRule.identifier)! - return SwiftLintFrameworkTests.violations(example, config: config) + return TestHelpers.violations(example, config: config) } } diff --git a/Tests/SwiftLintFrameworkTests/FunctionParameterCountRuleTests.swift b/Tests/BuiltInRulesTests/FunctionParameterCountRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/FunctionParameterCountRuleTests.swift rename to Tests/BuiltInRulesTests/FunctionParameterCountRuleTests.swift index c8f3e3ebf3..0c9b24d21c 100644 --- a/Tests/SwiftLintFrameworkTests/FunctionParameterCountRuleTests.swift +++ b/Tests/BuiltInRulesTests/FunctionParameterCountRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers private func funcWithParameters(_ parameters: String, violates: Bool = false, diff --git a/Tests/SwiftLintFrameworkTests/GenericTypeNameRuleTests.swift b/Tests/BuiltInRulesTests/GenericTypeNameRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/GenericTypeNameRuleTests.swift rename to Tests/BuiltInRulesTests/GenericTypeNameRuleTests.swift index 8473e98a8f..bfac1930fc 100644 --- a/Tests/SwiftLintFrameworkTests/GenericTypeNameRuleTests.swift +++ b/Tests/BuiltInRulesTests/GenericTypeNameRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class GenericTypeNameRuleTests: SwiftLintTestCase { func testGenericTypeNameWithExcluded() { diff --git a/Tests/SwiftLintFrameworkTests/IdentifierNameRuleTests.swift b/Tests/BuiltInRulesTests/IdentifierNameRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/IdentifierNameRuleTests.swift rename to Tests/BuiltInRulesTests/IdentifierNameRuleTests.swift index 324d4d197e..48bba3ebcb 100644 --- a/Tests/SwiftLintFrameworkTests/IdentifierNameRuleTests.swift +++ b/Tests/BuiltInRulesTests/IdentifierNameRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class IdentifierNameRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/ImplicitGetterRuleTests.swift b/Tests/BuiltInRulesTests/ImplicitGetterRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/ImplicitGetterRuleTests.swift rename to Tests/BuiltInRulesTests/ImplicitGetterRuleTests.swift index 0905bf01f9..105b55c98c 100644 --- a/Tests/SwiftLintFrameworkTests/ImplicitGetterRuleTests.swift +++ b/Tests/BuiltInRulesTests/ImplicitGetterRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class ImplicitGetterRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/ImplicitReturnConfigurationTests.swift b/Tests/BuiltInRulesTests/ImplicitReturnConfigurationTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/ImplicitReturnConfigurationTests.swift rename to Tests/BuiltInRulesTests/ImplicitReturnConfigurationTests.swift index b19dd28e02..f3d2e82a5c 100644 --- a/Tests/SwiftLintFrameworkTests/ImplicitReturnConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/ImplicitReturnConfigurationTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class ImplicitReturnConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/ImplicitReturnRuleTests.swift b/Tests/BuiltInRulesTests/ImplicitReturnRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/ImplicitReturnRuleTests.swift rename to Tests/BuiltInRulesTests/ImplicitReturnRuleTests.swift index 6aa4036f22..97f480f59e 100644 --- a/Tests/SwiftLintFrameworkTests/ImplicitReturnRuleTests.swift +++ b/Tests/BuiltInRulesTests/ImplicitReturnRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class ImplicitReturnRuleTests: SwiftLintTestCase { func testOnlyClosureKindIncluded() { diff --git a/Tests/SwiftLintFrameworkTests/ImplicitlyUnwrappedOptionalConfigurationTests.swift b/Tests/BuiltInRulesTests/ImplicitlyUnwrappedOptionalConfigurationTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/ImplicitlyUnwrappedOptionalConfigurationTests.swift rename to Tests/BuiltInRulesTests/ImplicitlyUnwrappedOptionalConfigurationTests.swift index 6ba01c625c..4e2b716b19 100644 --- a/Tests/SwiftLintFrameworkTests/ImplicitlyUnwrappedOptionalConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/ImplicitlyUnwrappedOptionalConfigurationTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest // swiftlint:disable:next type_name diff --git a/Tests/SwiftLintFrameworkTests/ImplicitlyUnwrappedOptionalRuleTests.swift b/Tests/BuiltInRulesTests/ImplicitlyUnwrappedOptionalRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/ImplicitlyUnwrappedOptionalRuleTests.swift rename to Tests/BuiltInRulesTests/ImplicitlyUnwrappedOptionalRuleTests.swift index 4d677b5bc2..e840f3da0d 100644 --- a/Tests/SwiftLintFrameworkTests/ImplicitlyUnwrappedOptionalRuleTests.swift +++ b/Tests/BuiltInRulesTests/ImplicitlyUnwrappedOptionalRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class ImplicitlyUnwrappedOptionalRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/InclusiveLanguageRuleTests.swift b/Tests/BuiltInRulesTests/InclusiveLanguageRuleTests.swift similarity index 97% rename from Tests/SwiftLintFrameworkTests/InclusiveLanguageRuleTests.swift rename to Tests/BuiltInRulesTests/InclusiveLanguageRuleTests.swift index a4eecf6901..a2b291fad1 100644 --- a/Tests/SwiftLintFrameworkTests/InclusiveLanguageRuleTests.swift +++ b/Tests/BuiltInRulesTests/InclusiveLanguageRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class InclusiveLanguageRuleTests: SwiftLintTestCase { func testNonTriggeringExamplesWithNonDefaultConfig() { diff --git a/Tests/SwiftLintFrameworkTests/IndentationWidthRuleTests.swift b/Tests/BuiltInRulesTests/IndentationWidthRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/IndentationWidthRuleTests.swift rename to Tests/BuiltInRulesTests/IndentationWidthRuleTests.swift index 4946e63adc..c8ae98abab 100644 --- a/Tests/SwiftLintFrameworkTests/IndentationWidthRuleTests.swift +++ b/Tests/BuiltInRulesTests/IndentationWidthRuleTests.swift @@ -1,6 +1,6 @@ @testable import SwiftLintBuiltInRules @testable import SwiftLintCore -import SwiftLintTestHelpers +import TestHelpers import XCTest final class IndentationWidthRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/LineLengthConfigurationTests.swift b/Tests/BuiltInRulesTests/LineLengthConfigurationTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/LineLengthConfigurationTests.swift rename to Tests/BuiltInRulesTests/LineLengthConfigurationTests.swift index 55360aabe8..c617bdc4fa 100644 --- a/Tests/SwiftLintFrameworkTests/LineLengthConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/LineLengthConfigurationTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class LineLengthConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/LineLengthRuleTests.swift b/Tests/BuiltInRulesTests/LineLengthRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/LineLengthRuleTests.swift rename to Tests/BuiltInRulesTests/LineLengthRuleTests.swift index 497ce3b6af..463d49ab87 100644 --- a/Tests/SwiftLintFrameworkTests/LineLengthRuleTests.swift +++ b/Tests/BuiltInRulesTests/LineLengthRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class LineLengthRuleTests: SwiftLintTestCase { private let longFunctionDeclarations = [ diff --git a/Tests/SwiftLintFrameworkTests/MissingDocsRuleTests.swift b/Tests/BuiltInRulesTests/MissingDocsRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/MissingDocsRuleTests.swift rename to Tests/BuiltInRulesTests/MissingDocsRuleTests.swift index 531373d1bc..8255c1693d 100644 --- a/Tests/SwiftLintFrameworkTests/MissingDocsRuleTests.swift +++ b/Tests/BuiltInRulesTests/MissingDocsRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class MissingDocsRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/MultilineArgumentsRuleTests.swift b/Tests/BuiltInRulesTests/MultilineArgumentsRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/MultilineArgumentsRuleTests.swift rename to Tests/BuiltInRulesTests/MultilineArgumentsRuleTests.swift index 2f66f76dbc..fe0a9faf44 100644 --- a/Tests/SwiftLintFrameworkTests/MultilineArgumentsRuleTests.swift +++ b/Tests/BuiltInRulesTests/MultilineArgumentsRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class MultilineArgumentsRuleTests: SwiftLintTestCase { func testMultilineArgumentsWithWithNextLine() { diff --git a/Tests/SwiftLintFrameworkTests/MultilineParametersConfigurationTests.swift b/Tests/BuiltInRulesTests/MultilineParametersConfigurationTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/MultilineParametersConfigurationTests.swift rename to Tests/BuiltInRulesTests/MultilineParametersConfigurationTests.swift index ecea8d2c40..12049483d0 100644 --- a/Tests/SwiftLintFrameworkTests/MultilineParametersConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/MultilineParametersConfigurationTests.swift @@ -1,5 +1,6 @@ @testable import SwiftLintBuiltInRules @testable import SwiftLintCore +import TestHelpers import XCTest final class MultilineParametersConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/NameConfigurationTests.swift b/Tests/BuiltInRulesTests/NameConfigurationTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/NameConfigurationTests.swift rename to Tests/BuiltInRulesTests/NameConfigurationTests.swift index fc39b2bf29..b9ca0449ce 100644 --- a/Tests/SwiftLintFrameworkTests/NameConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/NameConfigurationTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class NameConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/NestingRuleTests.swift b/Tests/BuiltInRulesTests/NestingRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/NestingRuleTests.swift rename to Tests/BuiltInRulesTests/NestingRuleTests.swift index 435ca660be..b41082edb4 100644 --- a/Tests/SwiftLintFrameworkTests/NestingRuleTests.swift +++ b/Tests/BuiltInRulesTests/NestingRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers // swiftlint:disable file_length diff --git a/Tests/SwiftLintFrameworkTests/NoEmptyBlockConfigurationTests.swift b/Tests/BuiltInRulesTests/NoEmptyBlockConfigurationTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/NoEmptyBlockConfigurationTests.swift rename to Tests/BuiltInRulesTests/NoEmptyBlockConfigurationTests.swift index 9a88de66aa..96f287145d 100644 --- a/Tests/SwiftLintFrameworkTests/NoEmptyBlockConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/NoEmptyBlockConfigurationTests.swift @@ -1,5 +1,6 @@ @testable import SwiftLintBuiltInRules @testable import SwiftLintCore +import TestHelpers import XCTest final class NoEmptyBlockConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/NumberSeparatorRuleTests.swift b/Tests/BuiltInRulesTests/NumberSeparatorRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/NumberSeparatorRuleTests.swift rename to Tests/BuiltInRulesTests/NumberSeparatorRuleTests.swift index e80d93b639..362e55ce4f 100644 --- a/Tests/SwiftLintFrameworkTests/NumberSeparatorRuleTests.swift +++ b/Tests/BuiltInRulesTests/NumberSeparatorRuleTests.swift @@ -1,5 +1,6 @@ @testable import SwiftLintBuiltInRules import SwiftParser +import TestHelpers import XCTest final class NumberSeparatorRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/ObjectLiteralRuleTests.swift b/Tests/BuiltInRulesTests/ObjectLiteralRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/ObjectLiteralRuleTests.swift rename to Tests/BuiltInRulesTests/ObjectLiteralRuleTests.swift index bfdb9ba375..988b8a9a93 100644 --- a/Tests/SwiftLintFrameworkTests/ObjectLiteralRuleTests.swift +++ b/Tests/BuiltInRulesTests/ObjectLiteralRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class ObjectLiteralRuleTests: SwiftLintTestCase { // MARK: - Instance Properties diff --git a/Tests/SwiftLintFrameworkTests/OpeningBraceRuleTests.swift b/Tests/BuiltInRulesTests/OpeningBraceRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/OpeningBraceRuleTests.swift rename to Tests/BuiltInRulesTests/OpeningBraceRuleTests.swift index 445b2afd44..fe04b07fda 100644 --- a/Tests/SwiftLintFrameworkTests/OpeningBraceRuleTests.swift +++ b/Tests/BuiltInRulesTests/OpeningBraceRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class OpeningBraceRuleTests: SwiftLintTestCase { func testDefaultNonTriggeringExamplesWithMultilineOptionsTrue() { diff --git a/Tests/SwiftLintFrameworkTests/PreferKeyPathRuleTests.swift b/Tests/BuiltInRulesTests/PreferKeyPathRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/PreferKeyPathRuleTests.swift rename to Tests/BuiltInRulesTests/PreferKeyPathRuleTests.swift index 4b99289fc0..830420df5d 100644 --- a/Tests/SwiftLintFrameworkTests/PreferKeyPathRuleTests.swift +++ b/Tests/BuiltInRulesTests/PreferKeyPathRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class PreferKeyPathRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/PrefixedTopLevelConstantRuleTests.swift b/Tests/BuiltInRulesTests/PrefixedTopLevelConstantRuleTests.swift similarity index 97% rename from Tests/SwiftLintFrameworkTests/PrefixedTopLevelConstantRuleTests.swift rename to Tests/BuiltInRulesTests/PrefixedTopLevelConstantRuleTests.swift index d2102a6db2..bbe836d3a7 100644 --- a/Tests/SwiftLintFrameworkTests/PrefixedTopLevelConstantRuleTests.swift +++ b/Tests/BuiltInRulesTests/PrefixedTopLevelConstantRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class PrefixedTopLevelConstantRuleTests: SwiftLintTestCase { func testPrivateOnly() { diff --git a/Tests/SwiftLintFrameworkTests/PrivateOverFilePrivateRuleTests.swift b/Tests/BuiltInRulesTests/PrivateOverFilePrivateRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/PrivateOverFilePrivateRuleTests.swift rename to Tests/BuiltInRulesTests/PrivateOverFilePrivateRuleTests.swift index 56a97267ef..baa77f7ee0 100644 --- a/Tests/SwiftLintFrameworkTests/PrivateOverFilePrivateRuleTests.swift +++ b/Tests/BuiltInRulesTests/PrivateOverFilePrivateRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class PrivateOverFilePrivateRuleTests: SwiftLintTestCase { func testPrivateOverFilePrivateValidatingExtensions() { diff --git a/Tests/SwiftLintFrameworkTests/RequiredEnumCaseConfigurationTests.swift b/Tests/BuiltInRulesTests/RequiredEnumCaseConfigurationTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/RequiredEnumCaseConfigurationTests.swift rename to Tests/BuiltInRulesTests/RequiredEnumCaseConfigurationTests.swift index 1ec83cbcde..bad8e2e969 100644 --- a/Tests/SwiftLintFrameworkTests/RequiredEnumCaseConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/RequiredEnumCaseConfigurationTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class RequiredEnumCaseConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/DocumentedType.swift b/Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/DocumentedType.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/DocumentedType.swift rename to Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/DocumentedType.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileHeaderEmpty.swift b/Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileHeaderEmpty.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileHeaderEmpty.swift rename to Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileHeaderEmpty.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileNameCaseMismatch.swift b/Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileNameCaseMismatch.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileNameCaseMismatch.swift rename to Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileNameCaseMismatch.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileNameMatchingComplex.swift b/Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileNameMatchingComplex.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileNameMatchingComplex.swift rename to Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileNameMatchingComplex.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileNameMatchingSimple.swift b/Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileNameMatchingSimple.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileNameMatchingSimple.swift rename to Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileNameMatchingSimple.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileNameMismatch.swift b/Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileNameMismatch.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileNameMismatch.swift rename to Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileNameMismatch.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileNameMissing.swift b/Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileNameMissing.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileHeaderRuleFixtures/FileNameMissing.swift rename to Tests/BuiltInRulesTests/Resources/FileHeaderRuleFixtures/FileNameMissing.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameNoSpaceRuleFixtures/File Name.swift b/Tests/BuiltInRulesTests/Resources/FileNameNoSpaceRuleFixtures/File Name.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameNoSpaceRuleFixtures/File Name.swift rename to Tests/BuiltInRulesTests/Resources/FileNameNoSpaceRuleFixtures/File Name.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameNoSpaceRuleFixtures/File+Extension.swift b/Tests/BuiltInRulesTests/Resources/FileNameNoSpaceRuleFixtures/File+Extension.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameNoSpaceRuleFixtures/File+Extension.swift rename to Tests/BuiltInRulesTests/Resources/FileNameNoSpaceRuleFixtures/File+Extension.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameNoSpaceRuleFixtures/File+Test Extension.swift b/Tests/BuiltInRulesTests/Resources/FileNameNoSpaceRuleFixtures/File+Test Extension.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameNoSpaceRuleFixtures/File+Test Extension.swift rename to Tests/BuiltInRulesTests/Resources/FileNameNoSpaceRuleFixtures/File+Test Extension.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameNoSpaceRuleFixtures/File.swift b/Tests/BuiltInRulesTests/Resources/FileNameNoSpaceRuleFixtures/File.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameNoSpaceRuleFixtures/File.swift rename to Tests/BuiltInRulesTests/Resources/FileNameNoSpaceRuleFixtures/File.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/BoolExtension.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/BoolExtension.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/BoolExtension.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/BoolExtension.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/BoolExtensionTests.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/BoolExtensionTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/BoolExtensionTests.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/BoolExtensionTests.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/BoolExtensions.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/BoolExtensions.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/BoolExtensions.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/BoolExtensions.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/ExtensionBool+SwiftLint.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/ExtensionBool+SwiftLint.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/ExtensionBool+SwiftLint.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/ExtensionBool+SwiftLint.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/ExtensionBool.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/ExtensionBool.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/ExtensionBool.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/ExtensionBool.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/ExtensionsBool.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/ExtensionsBool.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/ExtensionsBool.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/ExtensionsBool.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/LinuxMain.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/LinuxMain.swift similarity index 95% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/LinuxMain.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/LinuxMain.swift index 96fc6d1799..48d37ac814 100644 --- a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/LinuxMain.swift +++ b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/LinuxMain.swift @@ -5,6 +5,6 @@ extension AttributesRuleTests { static var allTests: [(String, (AttributesRuleTests) -> () throws -> Void)] = [ ("testAttributesWithDefaultConfiguration", testAttributesWithDefaultConfiguration), ("testAttributesWithAlwaysOnSameLine", testAttributesWithAlwaysOnSameLine), - ("testAttributesWithAlwaysOnLineAbove", testAttributesWithAlwaysOnLineAbove) + ("testAttributesWithAlwaysOnLineAbove", testAttributesWithAlwaysOnLineAbove), ] } diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/Multiple.Levels.Deeply.Nested.MyType.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/Multiple.Levels.Deeply.Nested.MyType.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/Multiple.Levels.Deeply.Nested.MyType.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/Multiple.Levels.Deeply.Nested.MyType.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/MyClass.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/MyClass.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/MyClass.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/MyClass.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/MyStruct.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/MyStruct.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/MyStruct.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/MyStruct.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/MyStructf.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/MyStructf.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/MyStructf.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/MyStructf.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/MyType.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/MyType.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/MyType.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/MyType.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/NSString+Extension.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/NSString+Extension.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/NSString+Extension.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/NSString+Extension.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/Nested.MyType.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/Nested.MyType.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/Nested.MyType.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/Nested.MyType.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/Notification.Name+Extension.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/Notification.Name+Extension.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/Notification.Name+Extension.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/Notification.Name+Extension.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/NotificationName+Extension.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/NotificationName+Extension.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/NotificationName+Extension.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/NotificationName+Extension.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/Notification__Name+Extension.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/Notification__Name+Extension.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/Notification__Name+Extension.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/Notification__Name+Extension.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/SLBoolExtension.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/SLBoolExtension.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/SLBoolExtension.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/SLBoolExtension.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/main.swift b/Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/main.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/FileNameRuleFixtures/main.swift rename to Tests/BuiltInRulesTests/Resources/FileNameRuleFixtures/main.swift diff --git a/Tests/SwiftLintFrameworkTests/StatementPositionRuleTests.swift b/Tests/BuiltInRulesTests/StatementPositionRuleTests.swift similarity index 94% rename from Tests/SwiftLintFrameworkTests/StatementPositionRuleTests.swift rename to Tests/BuiltInRulesTests/StatementPositionRuleTests.swift index b776b05302..ab4b81f353 100644 --- a/Tests/SwiftLintFrameworkTests/StatementPositionRuleTests.swift +++ b/Tests/BuiltInRulesTests/StatementPositionRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class StatementPositionRuleTests: SwiftLintTestCase { func testStatementPositionUncuddled() { diff --git a/Tests/SwiftLintFrameworkTests/SwitchCaseAlignmentRuleTests.swift b/Tests/BuiltInRulesTests/SwitchCaseAlignmentRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/SwitchCaseAlignmentRuleTests.swift rename to Tests/BuiltInRulesTests/SwitchCaseAlignmentRuleTests.swift index 5ec28069b9..9bada421fa 100644 --- a/Tests/SwiftLintFrameworkTests/SwitchCaseAlignmentRuleTests.swift +++ b/Tests/BuiltInRulesTests/SwitchCaseAlignmentRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class SwitchCaseAlignmentRuleTests: SwiftLintTestCase { func testSwitchCaseAlignmentWithoutIndentedCases() { diff --git a/Tests/SwiftLintFrameworkTests/TodoRuleTests.swift b/Tests/BuiltInRulesTests/TodoRuleTests.swift similarity index 95% rename from Tests/SwiftLintFrameworkTests/TodoRuleTests.swift rename to Tests/BuiltInRulesTests/TodoRuleTests.swift index 8130bc54cc..aebfec9dbe 100644 --- a/Tests/SwiftLintFrameworkTests/TodoRuleTests.swift +++ b/Tests/BuiltInRulesTests/TodoRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class TodoRuleTests: SwiftLintTestCase { @@ -42,6 +43,6 @@ final class TodoRuleTests: SwiftLintTestCase { private func violations(_ example: Example, config: Any? = nil) -> [StyleViolation] { let config = makeConfig(config, TodoRule.identifier)! - return SwiftLintFrameworkTests.violations(example, config: config) + return TestHelpers.violations(example, config: config) } } diff --git a/Tests/SwiftLintFrameworkTests/TrailingClosureConfigurationTests.swift b/Tests/BuiltInRulesTests/TrailingClosureConfigurationTests.swift similarity index 97% rename from Tests/SwiftLintFrameworkTests/TrailingClosureConfigurationTests.swift rename to Tests/BuiltInRulesTests/TrailingClosureConfigurationTests.swift index 51ffc479ce..0baef0beb9 100644 --- a/Tests/SwiftLintFrameworkTests/TrailingClosureConfigurationTests.swift +++ b/Tests/BuiltInRulesTests/TrailingClosureConfigurationTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class TrailingClosureConfigurationTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/TrailingClosureRuleTests.swift b/Tests/BuiltInRulesTests/TrailingClosureRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/TrailingClosureRuleTests.swift rename to Tests/BuiltInRulesTests/TrailingClosureRuleTests.swift index c50697287d..4ffd56a096 100644 --- a/Tests/SwiftLintFrameworkTests/TrailingClosureRuleTests.swift +++ b/Tests/BuiltInRulesTests/TrailingClosureRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class TrailingClosureRuleTests: SwiftLintTestCase { func testWithOnlySingleMutedParameterEnabled() { diff --git a/Tests/SwiftLintFrameworkTests/TrailingCommaRuleTests.swift b/Tests/BuiltInRulesTests/TrailingCommaRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/TrailingCommaRuleTests.swift rename to Tests/BuiltInRulesTests/TrailingCommaRuleTests.swift index e7b4a8f361..a4aa896a31 100644 --- a/Tests/SwiftLintFrameworkTests/TrailingCommaRuleTests.swift +++ b/Tests/BuiltInRulesTests/TrailingCommaRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class TrailingCommaRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/TrailingWhitespaceRuleTests.swift b/Tests/BuiltInRulesTests/TrailingWhitespaceRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/TrailingWhitespaceRuleTests.swift rename to Tests/BuiltInRulesTests/TrailingWhitespaceRuleTests.swift index 6de8111141..e79c400467 100644 --- a/Tests/SwiftLintFrameworkTests/TrailingWhitespaceRuleTests.swift +++ b/Tests/BuiltInRulesTests/TrailingWhitespaceRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class TrailingWhitespaceRuleTests: SwiftLintTestCase { func testWithIgnoresEmptyLinesEnabled() { diff --git a/Tests/SwiftLintFrameworkTests/TypeContentsOrderRuleTests.swift b/Tests/BuiltInRulesTests/TypeContentsOrderRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/TypeContentsOrderRuleTests.swift rename to Tests/BuiltInRulesTests/TypeContentsOrderRuleTests.swift index 808e3bb41d..8f4b0bd1c0 100644 --- a/Tests/SwiftLintFrameworkTests/TypeContentsOrderRuleTests.swift +++ b/Tests/BuiltInRulesTests/TypeContentsOrderRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class TypeContentsOrderRuleTests: SwiftLintTestCase { // swiftlint:disable:next function_body_length diff --git a/Tests/SwiftLintFrameworkTests/TypeNameRuleTests.swift b/Tests/BuiltInRulesTests/TypeNameRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/TypeNameRuleTests.swift rename to Tests/BuiltInRulesTests/TypeNameRuleTests.swift index 2c8819a5ec..4cebbfa871 100644 --- a/Tests/SwiftLintFrameworkTests/TypeNameRuleTests.swift +++ b/Tests/BuiltInRulesTests/TypeNameRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class TypeNameRuleTests: SwiftLintTestCase { func testTypeNameWithExcluded() { diff --git a/Tests/SwiftLintFrameworkTests/TypesafeArrayInitRuleTests.swift b/Tests/BuiltInRulesTests/TypesafeArrayInitRuleTests.swift similarity index 85% rename from Tests/SwiftLintFrameworkTests/TypesafeArrayInitRuleTests.swift rename to Tests/BuiltInRulesTests/TypesafeArrayInitRuleTests.swift index 59d0769491..792f8090db 100644 --- a/Tests/SwiftLintFrameworkTests/TypesafeArrayInitRuleTests.swift +++ b/Tests/BuiltInRulesTests/TypesafeArrayInitRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class TypesafeArrayInitRuleTests: SwiftLintTestCase { @@ -12,7 +13,7 @@ final class TypesafeArrayInitRuleTests: SwiftLintTestCase { XCTFail("Failed to create configuration") return } - let violations = SwiftLintFrameworkTests.violations(triggeringExample, config: config, requiresFileOnDisk: true) + let violations = violations(triggeringExample, config: config, requiresFileOnDisk: true) XCTAssertGreaterThanOrEqual(violations.count, 1) XCTAssertEqual(violations.first?.ruleIdentifier, baseDescription.identifier) } diff --git a/Tests/SwiftLintFrameworkTests/UnneededOverrideRuleTests.swift b/Tests/BuiltInRulesTests/UnneededOverrideRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/UnneededOverrideRuleTests.swift rename to Tests/BuiltInRulesTests/UnneededOverrideRuleTests.swift index 8ee55ec026..f32bea1598 100644 --- a/Tests/SwiftLintFrameworkTests/UnneededOverrideRuleTests.swift +++ b/Tests/BuiltInRulesTests/UnneededOverrideRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class UnneededOverrideRuleTests: SwiftLintTestCase { func testIncludeAffectInits() { diff --git a/Tests/SwiftLintFrameworkTests/UnusedDeclarationConfigurationTests.swift b/Tests/BuiltInRulesTests/UnusedDeclarationConfigurationTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/UnusedDeclarationConfigurationTests.swift rename to Tests/BuiltInRulesTests/UnusedDeclarationConfigurationTests.swift diff --git a/Tests/SwiftLintFrameworkTests/UnusedOptionalBindingRuleTests.swift b/Tests/BuiltInRulesTests/UnusedOptionalBindingRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/UnusedOptionalBindingRuleTests.swift rename to Tests/BuiltInRulesTests/UnusedOptionalBindingRuleTests.swift index e210a3c337..801efc8842 100644 --- a/Tests/SwiftLintFrameworkTests/UnusedOptionalBindingRuleTests.swift +++ b/Tests/BuiltInRulesTests/UnusedOptionalBindingRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers final class UnusedOptionalBindingRuleTests: SwiftLintTestCase { func testDefaultConfiguration() { diff --git a/Tests/SwiftLintFrameworkTests/VerticalWhitespaceRuleTests.swift b/Tests/BuiltInRulesTests/VerticalWhitespaceRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/VerticalWhitespaceRuleTests.swift rename to Tests/BuiltInRulesTests/VerticalWhitespaceRuleTests.swift index deba0b0844..7f8589f401 100644 --- a/Tests/SwiftLintFrameworkTests/VerticalWhitespaceRuleTests.swift +++ b/Tests/BuiltInRulesTests/VerticalWhitespaceRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class VerticalWhitespaceRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/XCTSpecificMatcherRuleTests.swift b/Tests/BuiltInRulesTests/XCTSpecificMatcherRuleTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/XCTSpecificMatcherRuleTests.swift rename to Tests/BuiltInRulesTests/XCTSpecificMatcherRuleTests.swift index 90c78cfada..9b5a034f20 100644 --- a/Tests/SwiftLintFrameworkTests/XCTSpecificMatcherRuleTests.swift +++ b/Tests/BuiltInRulesTests/XCTSpecificMatcherRuleTests.swift @@ -1,4 +1,5 @@ @testable import SwiftLintBuiltInRules +import TestHelpers import XCTest final class XCTSpecificMatcherRuleTests: SwiftLintTestCase { @@ -182,7 +183,7 @@ final class XCTSpecificMatcherRuleTests: SwiftLintTestCase { private func violations(_ example: Example) -> [StyleViolation] { guard let config = makeConfig(nil, XCTSpecificMatcherRule.identifier) else { return [] } - return SwiftLintFrameworkTests.violations(example, config: config) + return TestHelpers.violations(example, config: config) } private func noViolation(in example: String) -> Bool { diff --git a/Tests/ExtraRulesTests/ExtraRulesTests.swift b/Tests/ExtraRulesTests/ExtraRulesTests.swift index c3b39c6871..ee63d3f8e6 100644 --- a/Tests/ExtraRulesTests/ExtraRulesTests.swift +++ b/Tests/ExtraRulesTests/ExtraRulesTests.swift @@ -1,5 +1,5 @@ @testable import SwiftLintExtraRules -import SwiftLintTestHelpers +import TestHelpers final class ExtraRulesTests: SwiftLintTestCase { func testWithDefaultConfiguration() { diff --git a/Tests/SwiftLintFrameworkTests/AccessControlLevelTests.swift b/Tests/FrameworkTests/AccessControlLevelTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/AccessControlLevelTests.swift rename to Tests/FrameworkTests/AccessControlLevelTests.swift diff --git a/Tests/SwiftLintFrameworkTests/BaselineTests.swift b/Tests/FrameworkTests/BaselineTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/BaselineTests.swift rename to Tests/FrameworkTests/BaselineTests.swift diff --git a/Tests/SwiftLintFrameworkTests/CodeIndentingRewriterTests.swift b/Tests/FrameworkTests/CodeIndentingRewriterTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/CodeIndentingRewriterTests.swift rename to Tests/FrameworkTests/CodeIndentingRewriterTests.swift diff --git a/Tests/SwiftLintFrameworkTests/CollectingRuleTests.swift b/Tests/FrameworkTests/CollectingRuleTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/CollectingRuleTests.swift rename to Tests/FrameworkTests/CollectingRuleTests.swift index f3c7836772..3ff16a1dd6 100644 --- a/Tests/SwiftLintFrameworkTests/CollectingRuleTests.swift +++ b/Tests/FrameworkTests/CollectingRuleTests.swift @@ -1,5 +1,5 @@ @testable import SwiftLintFramework -import SwiftLintTestHelpers +import TestHelpers import XCTest final class CollectingRuleTests: SwiftLintTestCase { diff --git a/Tests/SwiftLintFrameworkTests/CommandTests.swift b/Tests/FrameworkTests/CommandTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/CommandTests.swift rename to Tests/FrameworkTests/CommandTests.swift diff --git a/Tests/SwiftLintFrameworkTests/ConfigurationAliasesTests.swift b/Tests/FrameworkTests/ConfigurationAliasesTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/ConfigurationAliasesTests.swift rename to Tests/FrameworkTests/ConfigurationAliasesTests.swift diff --git a/Tests/SwiftLintFrameworkTests/ConfigurationTests+Mock.swift b/Tests/FrameworkTests/ConfigurationTests+Mock.swift similarity index 92% rename from Tests/SwiftLintFrameworkTests/ConfigurationTests+Mock.swift rename to Tests/FrameworkTests/ConfigurationTests+Mock.swift index 02513c1d91..212a5391cc 100644 --- a/Tests/SwiftLintFrameworkTests/ConfigurationTests+Mock.swift +++ b/Tests/FrameworkTests/ConfigurationTests+Mock.swift @@ -6,7 +6,7 @@ import SwiftLintFramework internal extension ConfigurationTests { enum Mock { // MARK: Test Resources Path - static let testResourcesPath: String = TestResources.path + static let testResourcesPath: String = TestResources.path() // MARK: Directory Paths enum Dir { @@ -82,16 +82,3 @@ internal extension ConfigurationTests { } } } - -struct RuleMock: Rule { - var configuration = SeverityConfiguration(.warning) - var configurationDescription: some Documentable { RuleConfigurationOption.noOptions } - - static let description = RuleDescription(identifier: "RuleMock", name: "", - description: "", kind: .style) - - init() { /* conformance for test */ } - init(configuration _: Any) throws { self.init() } - - func validate(file _: SwiftLintFile) -> [StyleViolation] { [] } -} diff --git a/Tests/SwiftLintFrameworkTests/ConfigurationTests+MultipleConfigs.swift b/Tests/FrameworkTests/ConfigurationTests+MultipleConfigs.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/ConfigurationTests+MultipleConfigs.swift rename to Tests/FrameworkTests/ConfigurationTests+MultipleConfigs.swift diff --git a/Tests/SwiftLintFrameworkTests/ConfigurationTests.swift b/Tests/FrameworkTests/ConfigurationTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/ConfigurationTests.swift rename to Tests/FrameworkTests/ConfigurationTests.swift diff --git a/Tests/SwiftLintFrameworkTests/CustomRulesTests.swift b/Tests/FrameworkTests/CustomRulesTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/CustomRulesTests.swift rename to Tests/FrameworkTests/CustomRulesTests.swift index 56f3e1f9bd..87691f4e79 100644 --- a/Tests/SwiftLintFrameworkTests/CustomRulesTests.swift +++ b/Tests/FrameworkTests/CustomRulesTests.swift @@ -1,6 +1,7 @@ import SourceKittenFramework @testable import SwiftLintCore @testable import SwiftLintFramework +import TestHelpers import XCTest // swiftlint:disable file_length @@ -8,7 +9,7 @@ import XCTest final class CustomRulesTests: SwiftLintTestCase { private typealias Configuration = RegexConfiguration - private var testFile: SwiftLintFile { SwiftLintFile(path: "\(testResourcesPath)/test.txt")! } + private var testFile: SwiftLintFile { SwiftLintFile(path: "\(TestResources.path())/test.txt")! } func testCustomRuleConfigurationSetsCorrectlyWithMatchKinds() { let configDict = [ @@ -544,7 +545,7 @@ final class CustomRulesTests: SwiftLintTestCase { "custom_rules": customRules, ] let configuration = try SwiftLintFramework.Configuration(dict: configDict) - return SwiftLintTestHelpers.violations( + return TestHelpers.violations( example.skipWrappingInCommentTest(), config: configuration ) diff --git a/Tests/SwiftLintFrameworkTests/DisableAllTests.swift b/Tests/FrameworkTests/DisableAllTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/DisableAllTests.swift rename to Tests/FrameworkTests/DisableAllTests.swift diff --git a/Tests/SwiftLintFrameworkTests/ExampleTests.swift b/Tests/FrameworkTests/ExampleTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/ExampleTests.swift rename to Tests/FrameworkTests/ExampleTests.swift diff --git a/Tests/SwiftLintFrameworkTests/Exports.swift b/Tests/FrameworkTests/Exports.swift similarity index 75% rename from Tests/SwiftLintFrameworkTests/Exports.swift rename to Tests/FrameworkTests/Exports.swift index e9e69760b6..f1bf033a9e 100644 --- a/Tests/SwiftLintFrameworkTests/Exports.swift +++ b/Tests/FrameworkTests/Exports.swift @@ -1,3 +1,3 @@ // These imports are re-exported to make them available implicitly to all files. // swiftlint:disable:next unused_import -@_exported import SwiftLintTestHelpers +@_exported import TestHelpers diff --git a/Tests/SwiftLintFrameworkTests/ExtendedNSStringTests.swift b/Tests/FrameworkTests/ExtendedNSStringTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/ExtendedNSStringTests.swift rename to Tests/FrameworkTests/ExtendedNSStringTests.swift diff --git a/Tests/SwiftLintFrameworkTests/ExtendedStringTests.swift b/Tests/FrameworkTests/ExtendedStringTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/ExtendedStringTests.swift rename to Tests/FrameworkTests/ExtendedStringTests.swift diff --git a/Tests/SwiftLintFrameworkTests/GlobTests.swift b/Tests/FrameworkTests/GlobTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/GlobTests.swift rename to Tests/FrameworkTests/GlobTests.swift index 81b53677b2..11b1e17730 100644 --- a/Tests/SwiftLintFrameworkTests/GlobTests.swift +++ b/Tests/FrameworkTests/GlobTests.swift @@ -1,9 +1,10 @@ @testable import SwiftLintFramework +import TestHelpers import XCTest final class GlobTests: SwiftLintTestCase { private var mockPath: String { - testResourcesPath.stringByAppendingPathComponent("ProjectMock") + TestResources.path().stringByAppendingPathComponent("ProjectMock") } func testNonExistingDirectory() { diff --git a/Tests/SwiftLintFrameworkTests/LineEndingTests.swift b/Tests/FrameworkTests/LineEndingTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/LineEndingTests.swift rename to Tests/FrameworkTests/LineEndingTests.swift diff --git a/Tests/SwiftLintFrameworkTests/LintOrAnalyzeOptionsTests.swift b/Tests/FrameworkTests/LintOrAnalyzeOptionsTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/LintOrAnalyzeOptionsTests.swift rename to Tests/FrameworkTests/LintOrAnalyzeOptionsTests.swift diff --git a/Tests/SwiftLintFrameworkTests/LinterCacheTests.swift b/Tests/FrameworkTests/LinterCacheTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/LinterCacheTests.swift rename to Tests/FrameworkTests/LinterCacheTests.swift diff --git a/Tests/SwiftLintFrameworkTests/ModifierOrderTests.swift b/Tests/FrameworkTests/ModifierOrderTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/ModifierOrderTests.swift rename to Tests/FrameworkTests/ModifierOrderTests.swift diff --git a/Tests/SwiftLintFrameworkTests/ParserDiagnosticsTests.swift b/Tests/FrameworkTests/ParserDiagnosticsTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/ParserDiagnosticsTests.swift rename to Tests/FrameworkTests/ParserDiagnosticsTests.swift diff --git a/Tests/SwiftLintFrameworkTests/RegexConfigurationTests.swift b/Tests/FrameworkTests/RegexConfigurationTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/RegexConfigurationTests.swift rename to Tests/FrameworkTests/RegexConfigurationTests.swift diff --git a/Tests/SwiftLintFrameworkTests/RegionTests.swift b/Tests/FrameworkTests/RegionTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/RegionTests.swift rename to Tests/FrameworkTests/RegionTests.swift diff --git a/Tests/SwiftLintFrameworkTests/ReporterTests.swift b/Tests/FrameworkTests/ReporterTests.swift similarity index 97% rename from Tests/SwiftLintFrameworkTests/ReporterTests.swift rename to Tests/FrameworkTests/ReporterTests.swift index b6c30be294..369eeb1be6 100644 --- a/Tests/SwiftLintFrameworkTests/ReporterTests.swift +++ b/Tests/FrameworkTests/ReporterTests.swift @@ -2,6 +2,7 @@ import Foundation import SourceKittenFramework @testable import SwiftLintBuiltInRules @testable import SwiftLintFramework +import TestHelpers import XCTest final class ReporterTests: SwiftLintTestCase { @@ -41,7 +42,7 @@ final class ReporterTests: SwiftLintTestCase { } private func stringFromFile(_ filename: String) -> String { - SwiftLintFile(path: "\(testResourcesPath)/\(filename)")!.contents + SwiftLintFile(path: "\(TestResources.path())/\(filename)")!.contents } func testXcodeReporter() throws { @@ -208,7 +209,7 @@ final class ReporterTests: SwiftLintTestCase { let convertedReference = try stringConverter(reference) let convertedReporterOutput = try stringConverter(reporterOutput) if convertedReference != convertedReporterOutput { - let referenceURL = URL(fileURLWithPath: "\(testResourcesPath)/\(referenceFile)") + let referenceURL = URL(fileURLWithPath: "\(TestResources.path())/\(referenceFile)") try reporterOutput.replacingOccurrences( of: FileManager.default.currentDirectoryPath, with: "${CURRENT_WORKING_DIRECTORY}" diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedCSVReporterOutput.csv b/Tests/FrameworkTests/Resources/CannedCSVReporterOutput.csv similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedCSVReporterOutput.csv rename to Tests/FrameworkTests/Resources/CannedCSVReporterOutput.csv diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedCheckstyleReporterOutput.xml b/Tests/FrameworkTests/Resources/CannedCheckstyleReporterOutput.xml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedCheckstyleReporterOutput.xml rename to Tests/FrameworkTests/Resources/CannedCheckstyleReporterOutput.xml diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedCodeClimateReporterOutput.json b/Tests/FrameworkTests/Resources/CannedCodeClimateReporterOutput.json similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedCodeClimateReporterOutput.json rename to Tests/FrameworkTests/Resources/CannedCodeClimateReporterOutput.json diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedEmojiReporterOutput.txt b/Tests/FrameworkTests/Resources/CannedEmojiReporterOutput.txt similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedEmojiReporterOutput.txt rename to Tests/FrameworkTests/Resources/CannedEmojiReporterOutput.txt diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedGitHubActionsLoggingReporterOutput.txt b/Tests/FrameworkTests/Resources/CannedGitHubActionsLoggingReporterOutput.txt similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedGitHubActionsLoggingReporterOutput.txt rename to Tests/FrameworkTests/Resources/CannedGitHubActionsLoggingReporterOutput.txt diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedGitLabJUnitReporterOutput.xml b/Tests/FrameworkTests/Resources/CannedGitLabJUnitReporterOutput.xml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedGitLabJUnitReporterOutput.xml rename to Tests/FrameworkTests/Resources/CannedGitLabJUnitReporterOutput.xml diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedHTMLReporterOutput.html b/Tests/FrameworkTests/Resources/CannedHTMLReporterOutput.html similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedHTMLReporterOutput.html rename to Tests/FrameworkTests/Resources/CannedHTMLReporterOutput.html diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedJSONReporterOutput.json b/Tests/FrameworkTests/Resources/CannedJSONReporterOutput.json similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedJSONReporterOutput.json rename to Tests/FrameworkTests/Resources/CannedJSONReporterOutput.json diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedJunitReporterOutput.xml b/Tests/FrameworkTests/Resources/CannedJunitReporterOutput.xml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedJunitReporterOutput.xml rename to Tests/FrameworkTests/Resources/CannedJunitReporterOutput.xml diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedMarkdownReporterOutput.md b/Tests/FrameworkTests/Resources/CannedMarkdownReporterOutput.md similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedMarkdownReporterOutput.md rename to Tests/FrameworkTests/Resources/CannedMarkdownReporterOutput.md diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedRelativePathReporterOutput.txt b/Tests/FrameworkTests/Resources/CannedRelativePathReporterOutput.txt similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedRelativePathReporterOutput.txt rename to Tests/FrameworkTests/Resources/CannedRelativePathReporterOutput.txt diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedSARIFReporterOutput.json b/Tests/FrameworkTests/Resources/CannedSARIFReporterOutput.json similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedSARIFReporterOutput.json rename to Tests/FrameworkTests/Resources/CannedSARIFReporterOutput.json diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedSonarQubeReporterOutput.json b/Tests/FrameworkTests/Resources/CannedSonarQubeReporterOutput.json similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedSonarQubeReporterOutput.json rename to Tests/FrameworkTests/Resources/CannedSonarQubeReporterOutput.json diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedSummaryReporterNoViolationsOutput.txt b/Tests/FrameworkTests/Resources/CannedSummaryReporterNoViolationsOutput.txt similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedSummaryReporterNoViolationsOutput.txt rename to Tests/FrameworkTests/Resources/CannedSummaryReporterNoViolationsOutput.txt diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedSummaryReporterOutput.txt b/Tests/FrameworkTests/Resources/CannedSummaryReporterOutput.txt similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedSummaryReporterOutput.txt rename to Tests/FrameworkTests/Resources/CannedSummaryReporterOutput.txt diff --git a/Tests/SwiftLintFrameworkTests/Resources/CannedXcodeReporterOutput.txt b/Tests/FrameworkTests/Resources/CannedXcodeReporterOutput.txt similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/CannedXcodeReporterOutput.txt rename to Tests/FrameworkTests/Resources/CannedXcodeReporterOutput.txt diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle1/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle1/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle1/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle1/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle2/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle2/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle2/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle2/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle2/child.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle2/child.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle2/child.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle2/child.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/Folder/child2.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/Folder/child2.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/Folder/child2.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/Folder/child2.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/child1.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/child1.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/child1.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/Main/child1.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/child3.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/child3.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/child3.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle3/child3.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle4/child.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle4/child.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle4/child.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle4/child.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle4/main.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle4/main.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Cycle4/main.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Cycle4/main.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/Folder/child3.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/Folder/child3.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/Folder/child3.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/Folder/child3.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/child1.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/child1.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/child1.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/child1.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/child2.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/child2.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/child2.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/child2.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/expected.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/expected.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/expected.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/expected.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/main.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/main.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/main.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/Main/main.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/child4.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/child4.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test1/child4.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test1/child4.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test2/child1.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test2/child1.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test2/child1.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test2/child1.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test2/child2.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test2/child2.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test2/child2.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test2/child2.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test2/expected.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test2/expected.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test2/expected.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test2/expected.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test2/main.yml b/Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test2/main.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ChildConfig/Test2/main.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ChildConfig/Test2/main.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Directory.swift/DirectoryLevel1.swift b/Tests/FrameworkTests/Resources/ProjectMock/Directory.swift/DirectoryLevel1.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Directory.swift/DirectoryLevel1.swift rename to Tests/FrameworkTests/Resources/ProjectMock/Directory.swift/DirectoryLevel1.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/EmptyFolder/.gitkeep b/Tests/FrameworkTests/Resources/ProjectMock/EmptyFolder/.gitkeep similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/EmptyFolder/.gitkeep rename to Tests/FrameworkTests/Resources/ProjectMock/EmptyFolder/.gitkeep diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level0.swift b/Tests/FrameworkTests/Resources/ProjectMock/Level0.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level0.swift rename to Tests/FrameworkTests/Resources/ProjectMock/Level0.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level1.swift b/Tests/FrameworkTests/Resources/ProjectMock/Level1/Level1.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level1.swift rename to Tests/FrameworkTests/Resources/ProjectMock/Level1/Level1.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/Level2.swift b/Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/Level2.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/Level2.swift rename to Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/Level2.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/Level3/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/Level3/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/Level3/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/Level3/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/Level3/Level3.swift b/Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/Level3/Level3.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/Level3/Level3.swift rename to Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/Level3/Level3.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules.yml b/Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules.yml rename to Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_disabled.yml b/Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_disabled.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_disabled.yml rename to Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_disabled.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_only.yml b/Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_only.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_only.yml rename to Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_only.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_reconfig.yml b/Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_reconfig.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_reconfig.yml rename to Tests/FrameworkTests/Resources/ProjectMock/Level1/Level2/custom_rules_reconfig.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/NestedConfig/Test/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/NestedConfig/Test/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/NestedConfig/Test/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/NestedConfig/Test/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/NestedConfig/Test/Main.swift b/Tests/FrameworkTests/Resources/ProjectMock/NestedConfig/Test/Main.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/NestedConfig/Test/Main.swift rename to Tests/FrameworkTests/Resources/ProjectMock/NestedConfig/Test/Main.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/NestedConfig/Test/Sub/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/NestedConfig/Test/Sub/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/NestedConfig/Test/Sub/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/NestedConfig/Test/Sub/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/NestedConfig/Test/Sub/Sub.swift b/Tests/FrameworkTests/Resources/ProjectMock/NestedConfig/Test/Sub/Sub.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/NestedConfig/Test/Sub/Sub.swift rename to Tests/FrameworkTests/Resources/ProjectMock/NestedConfig/Test/Sub/Sub.swift diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Cycle1/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Cycle1/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Cycle1/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Cycle1/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Cycle2/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Cycle2/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Cycle2/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Cycle2/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Cycle2/parent.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Cycle2/parent.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Cycle2/parent.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Cycle2/parent.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Cycle3/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Cycle3/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Cycle3/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Cycle3/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Cycle3/parent.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Cycle3/parent.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Cycle3/parent.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Cycle3/parent.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test1/expected.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test1/expected.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test1/expected.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test1/expected.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test1/main.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test1/main.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test1/main.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test1/main.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test1/parent1.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test1/parent1.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test1/parent1.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test1/parent1.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test1/parent2.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test1/parent2.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test1/parent2.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test1/parent2.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test2/expected.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test2/expected.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test2/expected.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test2/expected.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test2/main.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test2/main.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test2/main.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test2/main.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test2/parent1.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test2/parent1.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test2/parent1.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test2/parent1.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test2/parent2.yml b/Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test2/parent2.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/ParentConfig/Test2/parent2.yml rename to Tests/FrameworkTests/Resources/ProjectMock/ParentConfig/Test2/parent2.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Child/child.yml b/Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Child/child.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Child/child.yml rename to Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Child/child.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Child/expected.yml b/Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Child/expected.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Child/expected.yml rename to Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Child/expected.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Child/main.yml b/Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Child/main.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Child/main.yml rename to Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Child/main.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Cycle/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Cycle/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Cycle/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Cycle/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/.swiftlint.yml b/Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/.swiftlint.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/.swiftlint.yml rename to Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/.swiftlint.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/child1.yml b/Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/child1.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/child1.yml rename to Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/child1.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/child2.yml b/Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/child2.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/child2.yml rename to Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/LocalRef/child2.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/expected.yml b/Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/expected.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/expected.yml rename to Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/expected.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/main.yml b/Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/main.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/main.yml rename to Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/main.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/parent.yml b/Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/parent.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/parent.yml rename to Tests/FrameworkTests/Resources/ProjectMock/RemoteConfig/Parent/parent.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/custom.yml b/Tests/FrameworkTests/Resources/ProjectMock/custom.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/custom.yml rename to Tests/FrameworkTests/Resources/ProjectMock/custom.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/custom_included_excluded.yml b/Tests/FrameworkTests/Resources/ProjectMock/custom_included_excluded.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/custom_included_excluded.yml rename to Tests/FrameworkTests/Resources/ProjectMock/custom_included_excluded.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/custom_rules.yml b/Tests/FrameworkTests/Resources/ProjectMock/custom_rules.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/custom_rules.yml rename to Tests/FrameworkTests/Resources/ProjectMock/custom_rules.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/ProjectMock/custom_rules_only.yml b/Tests/FrameworkTests/Resources/ProjectMock/custom_rules_only.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/ProjectMock/custom_rules_only.yml rename to Tests/FrameworkTests/Resources/ProjectMock/custom_rules_only.yml diff --git a/Tests/SwiftLintFrameworkTests/Resources/test.txt b/Tests/FrameworkTests/Resources/test.txt similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/test.txt rename to Tests/FrameworkTests/Resources/test.txt diff --git a/Tests/SwiftLintFrameworkTests/Resources/test.yml b/Tests/FrameworkTests/Resources/test.yml similarity index 100% rename from Tests/SwiftLintFrameworkTests/Resources/test.yml rename to Tests/FrameworkTests/Resources/test.yml diff --git a/Tests/SwiftLintFrameworkTests/RuleConfigurationDescriptionTests.swift b/Tests/FrameworkTests/RuleConfigurationDescriptionTests.swift similarity index 99% rename from Tests/SwiftLintFrameworkTests/RuleConfigurationDescriptionTests.swift rename to Tests/FrameworkTests/RuleConfigurationDescriptionTests.swift index c3a00722fd..8e15565c37 100644 --- a/Tests/SwiftLintFrameworkTests/RuleConfigurationDescriptionTests.swift +++ b/Tests/FrameworkTests/RuleConfigurationDescriptionTests.swift @@ -1,5 +1,5 @@ @testable import SwiftLintCore -import SwiftLintTestHelpers +import TestHelpers import XCTest // swiftlint:disable file_length diff --git a/Tests/SwiftLintFrameworkTests/RuleConfigurationTests.swift b/Tests/FrameworkTests/RuleConfigurationTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/RuleConfigurationTests.swift rename to Tests/FrameworkTests/RuleConfigurationTests.swift diff --git a/Tests/SwiftLintFrameworkTests/RuleTests.swift b/Tests/FrameworkTests/RuleTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/RuleTests.swift rename to Tests/FrameworkTests/RuleTests.swift diff --git a/Tests/SwiftLintFrameworkTests/RulesTests.swift b/Tests/FrameworkTests/RulesTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/RulesTests.swift rename to Tests/FrameworkTests/RulesTests.swift diff --git a/Tests/SwiftLintFrameworkTests/SourceKitCrashTests.swift b/Tests/FrameworkTests/SourceKitCrashTests.swift similarity index 98% rename from Tests/SwiftLintFrameworkTests/SourceKitCrashTests.swift rename to Tests/FrameworkTests/SourceKitCrashTests.swift index 320ef5c47b..fbb429c92b 100644 --- a/Tests/SwiftLintFrameworkTests/SourceKitCrashTests.swift +++ b/Tests/FrameworkTests/SourceKitCrashTests.swift @@ -47,7 +47,7 @@ final class SourceKitCrashTests: SwiftLintTestCase { } func testRulesWithFileThatCrashedSourceKitService() throws { - let file = try XCTUnwrap(SwiftLintFile(path: "\(TestResources.path)/ProjectMock/Level0.swift")) + let file = try XCTUnwrap(SwiftLintFile(path: "\(TestResources.path())/ProjectMock/Level0.swift")) file.sourcekitdFailed = true file.assertHandler = { XCTFail("If this called, rule's SourceKitFreeRule is not properly configured") diff --git a/Tests/SwiftLintFrameworkTests/StringExtensionTests.swift b/Tests/FrameworkTests/StringExtensionTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/StringExtensionTests.swift rename to Tests/FrameworkTests/StringExtensionTests.swift diff --git a/Tests/SwiftLintFrameworkTests/StringViewExtensionTests.swift b/Tests/FrameworkTests/StringViewExtensionTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/StringViewExtensionTests.swift rename to Tests/FrameworkTests/StringViewExtensionTests.swift diff --git a/Tests/SwiftLintFrameworkTests/SwiftLintFileTests.swift b/Tests/FrameworkTests/SwiftLintFileTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/SwiftLintFileTests.swift rename to Tests/FrameworkTests/SwiftLintFileTests.swift diff --git a/Tests/SwiftLintFrameworkTests/SwiftVersionTests.swift b/Tests/FrameworkTests/SwiftVersionTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/SwiftVersionTests.swift rename to Tests/FrameworkTests/SwiftVersionTests.swift diff --git a/Tests/SwiftLintFrameworkTests/YamlParserTests.swift b/Tests/FrameworkTests/YamlParserTests.swift similarity index 100% rename from Tests/SwiftLintFrameworkTests/YamlParserTests.swift rename to Tests/FrameworkTests/YamlParserTests.swift diff --git a/Tests/SwiftLintFrameworkTests/YamlSwiftLintTests.swift b/Tests/FrameworkTests/YamlSwiftLintTests.swift similarity index 96% rename from Tests/SwiftLintFrameworkTests/YamlSwiftLintTests.swift rename to Tests/FrameworkTests/YamlSwiftLintTests.swift index a001de08d4..23d9bfb2f8 100644 --- a/Tests/SwiftLintFrameworkTests/YamlSwiftLintTests.swift +++ b/Tests/FrameworkTests/YamlSwiftLintTests.swift @@ -39,6 +39,6 @@ final class YamlSwiftLintTests: SwiftLintTestCase { } private func getTestYaml() throws -> String { - try String(contentsOfFile: "\(testResourcesPath)/test.yml", encoding: .utf8) + try String(contentsOfFile: "\(TestResources.path())/test.yml", encoding: .utf8) } } diff --git a/Tests/GeneratedTests/GeneratedTests.swift b/Tests/GeneratedTests/GeneratedTests.swift index 6ef660cb4d..e5b5625317 100644 --- a/Tests/GeneratedTests/GeneratedTests.swift +++ b/Tests/GeneratedTests/GeneratedTests.swift @@ -2,7 +2,7 @@ // DO NOT EDIT @testable import SwiftLintBuiltInRules @testable import SwiftLintCore -import SwiftLintTestHelpers +import TestHelpers // swiftlint:disable:next blanket_disable_command // swiftlint:disable file_length single_test_class type_name diff --git a/Tests/IntegrationTests/IntegrationTests.swift b/Tests/IntegrationTests/IntegrationTests.swift index 54e12ec8fc..f195393ea9 100644 --- a/Tests/IntegrationTests/IntegrationTests.swift +++ b/Tests/IntegrationTests/IntegrationTests.swift @@ -1,6 +1,6 @@ import Foundation import SwiftLintFramework -import SwiftLintTestHelpers +import TestHelpers import XCTest private let config: Configuration = { diff --git a/Tests/SwiftLintFrameworkTests/XCTestCase+BundlePath.swift b/Tests/SwiftLintFrameworkTests/XCTestCase+BundlePath.swift deleted file mode 100644 index f20eb5b175..0000000000 --- a/Tests/SwiftLintFrameworkTests/XCTestCase+BundlePath.swift +++ /dev/null @@ -1,20 +0,0 @@ -import Foundation -import XCTest - -enum TestResources { - static var path: String { - if let rootProjectDirectory = ProcessInfo.processInfo.environment["BUILD_WORKSPACE_DIRECTORY"] { - return "\(rootProjectDirectory)/Tests/SwiftLintFrameworkTests/Resources" - } - - return URL(fileURLWithPath: #filePath, isDirectory: false) - .deletingLastPathComponent() - .appendingPathComponent("Resources") - .path - .absolutePathStandardized() - } -} - -extension XCTestCase { - var testResourcesPath: String { TestResources.path } -} diff --git a/Tests/SwiftLintTestHelpers/RuleDescription+Examples.swift b/Tests/TestHelpers/RuleDescription+Examples.swift similarity index 100% rename from Tests/SwiftLintTestHelpers/RuleDescription+Examples.swift rename to Tests/TestHelpers/RuleDescription+Examples.swift diff --git a/Tests/TestHelpers/RuleMock.swift b/Tests/TestHelpers/RuleMock.swift new file mode 100644 index 0000000000..b1b15d131a --- /dev/null +++ b/Tests/TestHelpers/RuleMock.swift @@ -0,0 +1,19 @@ +import SwiftLintCore + +public struct RuleMock: Rule { + var configurationDescription: some Documentable { RuleConfigurationOption.noOptions } + + public var configuration = SeverityConfiguration(.warning) + + public static let description = RuleDescription( + identifier: "RuleMock", + name: "", + description: "", + kind: .style + ) + + public init() { /* conformance for test */ } + public init(configuration _: Any) throws { self.init() } + + public func validate(file _: SwiftLintFile) -> [StyleViolation] { [] } +} diff --git a/Tests/SwiftLintTestHelpers/SwiftLintTestCase.swift b/Tests/TestHelpers/SwiftLintTestCase.swift similarity index 100% rename from Tests/SwiftLintTestHelpers/SwiftLintTestCase.swift rename to Tests/TestHelpers/SwiftLintTestCase.swift diff --git a/Tests/SwiftLintTestHelpers/TestHelpers.swift b/Tests/TestHelpers/TestHelpers.swift similarity index 100% rename from Tests/SwiftLintTestHelpers/TestHelpers.swift rename to Tests/TestHelpers/TestHelpers.swift diff --git a/Tests/TestHelpers/TestResources.swift b/Tests/TestHelpers/TestResources.swift new file mode 100644 index 0000000000..69de7e6a56 --- /dev/null +++ b/Tests/TestHelpers/TestResources.swift @@ -0,0 +1,14 @@ +import Foundation + +public enum TestResources { + public static func path(_ calleePath: String = #filePath) -> String { + let folder = URL(fileURLWithPath: calleePath, isDirectory: false).deletingLastPathComponent() + if let rootProjectDirectory = ProcessInfo.processInfo.environment["BUILD_WORKSPACE_DIRECTORY"] { + return "\(rootProjectDirectory)/Tests/\(folder.lastPathComponent)/Resources" + } + return folder + .appendingPathComponent("Resources") + .path + .absolutePathStandardized() + } +}