diff --git a/src/functTest/groovy/com/verificationgentleman/gradle/hdvl/svunit/SVUnitPluginSpec.groovy b/src/functTest/groovy/com/verificationgentleman/gradle/hdvl/svunit/SVUnitPluginSpec.groovy index 5d62d87..52155de 100644 --- a/src/functTest/groovy/com/verificationgentleman/gradle/hdvl/svunit/SVUnitPluginSpec.groovy +++ b/src/functTest/groovy/com/verificationgentleman/gradle/hdvl/svunit/SVUnitPluginSpec.groovy @@ -368,6 +368,33 @@ class SVUnitPluginSpec extends Specification { dummyLog.text.contains "-f ${testProjectDir.root}/build/full_test_xrun_args.f" } + def "'testWithXrun' uses args file for source set dependency"() { + File testSv = testProjectDir.newFolder('src', 'test', 'sv') + + File mainSv = testProjectDir.newFolder('src', 'mocks', 'sv') + new File(mainSv, 'dummy_mocks.sv').createNewFile() + + buildFile << """ + sourceSets.register('mocks') + + dependencies { + testCompile files(genMocksXrunArgsFile.destination) + } + """ + + when: + def result = newGradleRunnerWithFakeRunSVunit() + .withProjectDir(testProjectDir.root) + .withPluginClasspath() + .withArguments('testWithXrun') + .build() + + then: + result.task(":testWithXrun").outcome == SUCCESS + def testFullXrunArgsFile = new File(testProjectDir.root, 'build/full_test_xrun_args.f') + testFullXrunArgsFile.text.contains "-f ${testProjectDir.root}/build/mocks_xrun_args.f" + } + def "'check' task executes test tasks"() { File testSv = testProjectDir.newFolder('src', 'test', 'sv') new File(testSv, 'dummy_test.sv').createNewFile() diff --git a/src/main/java/com/verificationgentleman/gradle/hdvl/svunit/SVUnitPlugin.java b/src/main/java/com/verificationgentleman/gradle/hdvl/svunit/SVUnitPlugin.java index dcf2f88..ab4610c 100644 --- a/src/main/java/com/verificationgentleman/gradle/hdvl/svunit/SVUnitPlugin.java +++ b/src/main/java/com/verificationgentleman/gradle/hdvl/svunit/SVUnitPlugin.java @@ -96,7 +96,7 @@ private void configureSVUnitRootConfiguration(Project project) { } private boolean isSVUnit(Dependency dependency) { - return dependency.getGroup().equals("org.svunit") && dependency.getName().equals("svunit"); + return "org.svunit".equals(dependency.getGroup()) && "svunit".equals(dependency.getName()); } private void configureArgsFilesConfiguration(Project project, SourceSet testSourceSet, String toolName) {