2017-12-21 15:09:27 +00:00
|
|
|
sourceSets.test {
|
2017-12-26 21:54:35 +00:00
|
|
|
java.srcDirs = ['source']
|
2017-12-26 23:00:54 +00:00
|
|
|
resources.srcDirs = [
|
|
|
|
'data',
|
2018-01-17 03:23:36 +00:00
|
|
|
project(':com.ibm.wala.core.testdata').compileTestJava,
|
2017-12-26 23:00:54 +00:00
|
|
|
]
|
2017-12-18 18:24:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2018-01-11 03:56:27 +00:00
|
|
|
testCompile(
|
|
|
|
'com.google.android.tools:dx:1.7',
|
|
|
|
'junit:junit:4.11',
|
|
|
|
'org.osgi:org.osgi.core:4.2.0',
|
|
|
|
project(':com.ibm.wala.core'),
|
|
|
|
project(':com.ibm.wala.dalvik'),
|
|
|
|
project(':com.ibm.wala.shrike'),
|
|
|
|
project(':com.ibm.wala.util'),
|
|
|
|
project(configuration: 'testArchives', path: ':com.ibm.wala.core.tests'),
|
|
|
|
)
|
2018-01-18 23:22:43 +00:00
|
|
|
testRuntime 'com.google.android:android:4.1.1.4'
|
2017-12-18 18:24:02 +00:00
|
|
|
}
|
2018-01-17 16:39:27 +00:00
|
|
|
|
|
|
|
task cloneDroidBench(type: Exec) {
|
|
|
|
// TODO: download to somewhere private to this build tree; update code that looks in "/tmp" accordingly
|
2018-01-17 20:57:56 +00:00
|
|
|
def destDir = file('/tmp/DroidBench')
|
2018-01-17 16:39:27 +00:00
|
|
|
inputs.property('repository', 'https://github.com/secure-software-engineering/DroidBench.git')
|
|
|
|
outputs.dirs destDir
|
|
|
|
doFirst { delete destDir }
|
|
|
|
commandLine 'git', 'clone', '--depth=1', inputs.properties.repository, destDir
|
|
|
|
// TODO: should check out a specific tag or hash
|
|
|
|
}
|
|
|
|
|
2018-01-18 23:22:43 +00:00
|
|
|
// TODO: can Gradle's dependency system manage this download for us?
|
|
|
|
task downloadAndroidJar(type: de.undercouch.gradle.tasks.download.Download) {
|
|
|
|
src 'http://central.maven.org/maven2/com/google/android/android/4.1.1.4/android-4.1.1.4.jar'
|
|
|
|
dest new File(temporaryDir, 'android.jar')
|
|
|
|
overwrite false
|
|
|
|
}
|
|
|
|
|
|
|
|
task verifyAndroidJar(type: VerifyWithStamp, dependsOn: downloadAndroidJar) {
|
|
|
|
src files(downloadAndroidJar)[0]
|
|
|
|
checksum '88be04f4d84d58fadee2e780a322fdb9'
|
|
|
|
}
|
|
|
|
|
2018-01-17 16:39:27 +00:00
|
|
|
processTestResources {
|
|
|
|
dependsOn cloneDroidBench
|
|
|
|
|
2018-01-18 23:22:43 +00:00
|
|
|
dependsOn verifyAndroidJar
|
|
|
|
from downloadAndroidJar
|
|
|
|
|
2018-01-17 16:39:27 +00:00
|
|
|
def testdata = project(':com.ibm.wala.core.testdata')
|
|
|
|
dependsOn testdata.verifyJavaCup
|
|
|
|
from testdata.collectJLex
|
|
|
|
from testdata.downloadJavaCup
|
|
|
|
}
|
2018-01-17 20:59:22 +00:00
|
|
|
|
|
|
|
test {
|
2018-01-17 23:37:16 +00:00
|
|
|
maxHeapSize = '800M'
|
|
|
|
|
2018-01-17 20:59:22 +00:00
|
|
|
// https://github.com/liblit/WALA/issues/5 and possibly https://github.com/wala/WALA/issues/268
|
|
|
|
exclude '**/DalvikAnnotationsTest.class'
|
|
|
|
exclude '**/DynamicDalvikComparisonJavaLibsTest.class'
|
|
|
|
exclude '**/DynamicDalvikComparisonTestForAndroidLibs.class'
|
|
|
|
exclude '**/JVMLDalvikComparisonTest.class'
|
|
|
|
}
|