diff options
author | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2017-06-08 20:03:06 +0200 |
---|---|---|
committer | Evgeny Mandrikov <Godin@users.noreply.github.com> | 2017-06-08 20:03:06 +0200 |
commit | 2a2f161920d7608630ba1163d45a858803cfef2e (patch) | |
tree | c7ab3642fa6bad331376003cf75321a2d2fea794 /org.jacoco.cli.test | |
parent | 817d0ae185106486dac2ba6dd229c1af5c42d03f (diff) | |
download | jacoco-2a2f161920d7608630ba1163d45a858803cfef2e.tar.gz |
Use dest argument as folder in any case (#543)
The instrument goal accepts folders as well as files as input. In case
of files the instrumented copy should be written to the folder given as
the dest option.
Diffstat (limited to 'org.jacoco.cli.test')
-rw-r--r-- | org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java index 5d70b48c..59594a76 100644 --- a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java +++ b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java @@ -54,7 +54,7 @@ public class InstrumentTest extends CommandTestBase { } @Test - public void should_instrument_class_files_and_copy_resources() + public void should_instrument_class_files_and_copy_resources_when_folder_is_given() throws Exception { File destdir = tmp.getRoot(); @@ -73,6 +73,25 @@ public class InstrumentTest extends CommandTestBase { } @Test + public void should_instrument_class_files_to_dest_folder_when_class_files_are_given() + throws Exception { + File destdir = tmp.getRoot(); + + File src = new File(getClassPath(), + "org/jacoco/cli/internal/commands/InstrumentTest.class"); + + execute("instrument", "--dest", destdir.getAbsolutePath(), + src.getAbsolutePath()); + + assertOk(); + assertContains( + "[INFO] 1 classes instrumented to " + destdir.getAbsolutePath(), + out); + + assertInstrumented(new File(destdir, "InstrumentTest.class")); + } + + @Test public void should_not_instrument_anything_when_no_source_is_given() throws Exception { File destdir = tmp.getRoot(); |