Skip to content

Commit 92a22a6

Browse files
author
MohitMaliFtechiz
committed
run_test.sh script now mostly run java compilation and run java program for testing. In this commit we are compiling, running java test cases for gradle task, So we are removing the run_test.sh as it is unused now
1 parent c24ab23 commit 92a22a6

File tree

3 files changed

+14
-31
lines changed

3 files changed

+14
-31
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: |
3737
./gradlew assemble
3838
39-
- name: Genrate Source jar
39+
- name: Generate Source jar
4040
run: |
4141
./gradlew androidSourcesJar
4242

lib/build.gradle

+13-1
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,21 @@ task renameLibkiwixSoFile(type: Copy) {
281281
}
282282
}
283283

284+
task compileTestFile(type: Exec) {
285+
workingDir "${projectDir}/src/test/"
286+
commandLine 'javac', '-g', '-d', '.', '-s', '.', '-cp', 'junit-4.13.jar:' + buildDir.path +'/libs/*', 'test.java'
287+
}
288+
289+
task runTests(type: Exec) {
290+
workingDir "${projectDir}/src/test/"
291+
dependsOn compileTestFile
292+
commandLine 'java', '-Djava.library.path=' + buildDir.path, '-javaagent:jacoco-0.8.7/lib/jacocoagent.jar', '-cp', 'junit-4.13.jar:hamcrest-core-1.3.jar:' + buildDir.path +'/libs/*lib*.jar' + ':.', 'org.junit.runner.JUnitCore', 'test'
293+
}
294+
284295
task createCodeCoverageReport(type: Exec) {
285296
workingDir "${projectDir}/src/test/"
286-
commandLine 'sh', '-c', "bash 'run_test.sh' ${buildDir}/libs/*lib*.jar $buildDir"
297+
dependsOn runTests
298+
commandLine 'java', '-jar', 'jacoco-0.8.7/lib/jacococli.jar', 'report', 'jacoco.exec', '--classfiles', 'org/kiwix/libkiwix/', '--classfiles', 'org/kiwix/libzim/', '--html', '../../build/coverage-report', '--xml', 'coverage.xml'
287299
}
288300

289301
task checkCurrentJavaVersion() {

lib/src/test/run_test.sh

-29
This file was deleted.

0 commit comments

Comments
 (0)