From bc93a5deed5d903035e431b86a9a6fe19a8a50b9 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Tue, 28 Mar 2023 18:50:48 +0530 Subject: [PATCH] Renamed compile_and_run_test.sh to run_test.sh as now this script is only for running test cases, removed unnecessary check for directory in run_test.sh --- lib/build.gradle | 2 +- .../{compile_and_run_test.sh => run_test.sh} | 23 +++---------------- 2 files changed, 4 insertions(+), 21 deletions(-) rename lib/src/test/{compile_and_run_test.sh => run_test.sh} (56%) diff --git a/lib/build.gradle b/lib/build.gradle index 861b268..fdcaee7 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -281,7 +281,7 @@ task renameLibkiwixSoFile(type: Copy) { task createCodeCoverageReport(type: Exec) { workingDir "${projectDir}/src/test/" - commandLine 'sh', '-c', "bash 'compile_and_run_test.sh' ${buildDir}/libs/*lib*.jar $buildDir" + commandLine 'sh', '-c', "bash 'run_test.sh' ${buildDir}/libs/*lib*.jar $buildDir" } task checkCurrentJavaVersion() { diff --git a/lib/src/test/compile_and_run_test.sh b/lib/src/test/run_test.sh similarity index 56% rename from lib/src/test/compile_and_run_test.sh rename to lib/src/test/run_test.sh index 97fc6d4..141c822 100755 --- a/lib/src/test/compile_and_run_test.sh +++ b/lib/src/test/run_test.sh @@ -1,6 +1,6 @@ #!/usr/bin/bash -# This script compiles and runs the unit test to test the java wrapper. +# This script runs the unit test to test the java wrapper. # This is not integrated in meson because ... this is not so easy. die() @@ -9,25 +9,8 @@ die() exit 1 } -# Copy generated .so file to build directory to run test cases -cd ../../../ -./gradlew copyBuildKiwixSoFile -cd lib/src/test - -KIWIX_LIB_JAR=$1 -if [ -z $KIWIX_LIB_JAR ] -then - die "You must give the path to the kiwixlib.jar as first argument" -fi - -KIWIX_LIB_DIR=$2 -if [ -z $KIWIX_LIB_DIR ] -then - die "You must give the path to directory containing libkiwix.so as second argument" -fi - -KIWIX_LIB_JAR=$(readlink -f "$KIWIX_LIB_JAR") -KIWIX_LIB_DIR=$(readlink -f "$KIWIX_LIB_DIR") +KIWIX_LIB_JAR=$(readlink -f "$1") +KIWIX_LIB_DIR=$(readlink -f "$2") TEST_SOURCE_DIR=$(dirname "$(readlink -f $0)") cd "$TEST_SOURCE_DIR"