Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: NathanNeff/gradle-examples
base: 13021061a0
...
head fork: NathanNeff/gradle-examples
compare: 91072ca4fd
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
1  testwithvim/.gitignore
@@ -0,0 +1 @@
+testresults
View
2  testwithvim/Foo.java
@@ -3,7 +3,7 @@ public String foo() {
return "foo";
}
public String bar() {
- return "bar";
+ return "Bar";
}
public String baz() {
return "baz";
View
34 testwithvim/build.gradle
@@ -1,52 +1,32 @@
apply plugin: "java"
-import org.codehaus.groovy.runtime.StackTraceUtils
-import org.gradle.api.internal.tasks.testing.logging.StackTraceFilter
repositories {
mavenCentral()
}
dependencies {
- testCompile 'junit:junit:4.8.2'
- compile 'junit:junit:4.8.2'
+ compile 'junit:junit:4.8.2'
}
-sourceSets.main.java.srcDirs = [".", "src/main/java", "src"]
-
compileTestJava {
- source "src"
source "."
}
test {
delete 'testresults'
- def myFile = file("testresults")
- def msgs = [ ]
+ def testresults = file("testresults")
include "**/Test*.class"
- include "TestFoo.class"
- // TestDescriptor and TestEvent
- onOutput { descriptor, event ->
- logger.lifecycle("\n\nTest: " + descriptor + " produced standard out/err: " + event.message )
- msgs << event.message
- }
-
afterTest { desc, result ->
- // println result.getClass().getName()
- // println "\n\nExecuting test ${desc.name} [${desc.className}] with result: ${result.resultType}"
if (result.resultType == TestResult.ResultType.FAILURE) {
- result.getExceptions().each {
- //jdef s = new StackTraceFilter()
+ result.getException().each {
it.getStackTrace().each { el ->
- if (el.getFileName() && !(el.getClassName() =~ /^(java.lang|java.util|junit.framework|org.gradle|org.junit|sun.reflect)/)) {
- myFile << el.getFileName() + ":" + el.getLineNumber() + ":"
- // println el.getClassName()
- // println el.getMethodName()
- // myFile << el.getMethodName()
+ if (el.getFileName() && !(el.getClassName() =~
+ /^(java.lang|java.util|junit.framework|org.gradle|org.junit|sun.reflect)/)) {
+ testresults << el.getFileName() + ":" + el.getLineNumber() + ":"
}
}
- myFile << it
- myFile << "\n"
+ testresults << it.toString() + "\n"
}
}
}
View
3  testwithvim/runthis.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+gradle test
+vim -q testresults

No commit comments for this range

Something went wrong with that request. Please try again.