From 4523e53c3efa78492a13a7b0012d98e78b0f389b Mon Sep 17 00:00:00 2001 From: qiaoyuang Date: Thu, 5 Dec 2024 09:44:02 +0000 Subject: [PATCH] Optimize the unit tests --- .../kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt | 2 +- .../kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt | 2 +- .../kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt | 2 +- .../kotlin/com/ctrip/sqllin/dsl/Platform.kt | 2 +- test_android.sh | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) rename sqllin-dsl/src/{appleMain => appleTest}/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt (96%) rename sqllin-dsl/src/{linuxMain => linuxTest}/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt (95%) rename sqllin-dsl/src/{mingwMain => mingwTest}/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt (95%) rename sqllin-dsl/src/{nativeMain => nativeTest}/kotlin/com/ctrip/sqllin/dsl/Platform.kt (95%) diff --git a/sqllin-dsl/src/appleMain/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt b/sqllin-dsl/src/appleTest/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt similarity index 96% rename from sqllin-dsl/src/appleMain/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt rename to sqllin-dsl/src/appleTest/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt index 66a1f2b..e11b152 100644 --- a/sqllin-dsl/src/appleMain/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt +++ b/sqllin-dsl/src/appleTest/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt @@ -30,4 +30,4 @@ import platform.Foundation.NSUserDomainMask internal actual fun getPlatformStringPath(): String = (NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true).firstOrNull() as? String ?: "") -// actual val pathSeparator: Char = '/' \ No newline at end of file +internal actual val pathSeparator: Char = '/' \ No newline at end of file diff --git a/sqllin-dsl/src/linuxMain/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt b/sqllin-dsl/src/linuxTest/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt similarity index 95% rename from sqllin-dsl/src/linuxMain/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt rename to sqllin-dsl/src/linuxTest/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt index 29ce773..80bd9ec 100644 --- a/sqllin-dsl/src/linuxMain/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt +++ b/sqllin-dsl/src/linuxTest/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt @@ -29,4 +29,4 @@ import platform.posix.getcwd internal actual fun getPlatformStringPath(): String = getcwd(null, 0u)?.toKString() ?: throw IllegalStateException("The temp path created error") -// actual val pathSeparator: Char = '/' \ No newline at end of file +internal actual val pathSeparator: Char = '/' \ No newline at end of file diff --git a/sqllin-dsl/src/mingwMain/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt b/sqllin-dsl/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt similarity index 95% rename from sqllin-dsl/src/mingwMain/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt rename to sqllin-dsl/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt index f3ae026..e87a3de 100644 --- a/sqllin-dsl/src/mingwMain/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt +++ b/sqllin-dsl/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt @@ -29,4 +29,4 @@ import platform.posix._wgetcwd internal actual fun getPlatformStringPath(): String = _wgetcwd(null, 0)?.toKString() ?: throw IllegalStateException("Get database path wrong") -// actual val pathSeparator: Char = '\\' \ No newline at end of file +internal actual val pathSeparator: Char = '\\' \ No newline at end of file diff --git a/sqllin-dsl/src/nativeMain/kotlin/com/ctrip/sqllin/dsl/Platform.kt b/sqllin-dsl/src/nativeTest/kotlin/com/ctrip/sqllin/dsl/Platform.kt similarity index 95% rename from sqllin-dsl/src/nativeMain/kotlin/com/ctrip/sqllin/dsl/Platform.kt rename to sqllin-dsl/src/nativeTest/kotlin/com/ctrip/sqllin/dsl/Platform.kt index 1b7a5b3..b9a0505 100644 --- a/sqllin-dsl/src/nativeMain/kotlin/com/ctrip/sqllin/dsl/Platform.kt +++ b/sqllin-dsl/src/nativeTest/kotlin/com/ctrip/sqllin/dsl/Platform.kt @@ -29,4 +29,4 @@ internal expect fun getPlatformStringPath(): String /** * Get the file path separator, '\' in Windows, '/' in others */ -// expect val pathSeparator: Char \ No newline at end of file +internal expect val pathSeparator: Char \ No newline at end of file diff --git a/test_android.sh b/test_android.sh index b55b8ef..98c6f7b 100755 --- a/test_android.sh +++ b/test_android.sh @@ -1,5 +1,5 @@ #Run Android instrumented tests ./gradlew :sqllin-driver:connectedDebugAndroidTest --stacktrace ./gradlew :sqllin-dsl:connectedDebugAndroidTest --stacktrace -adb uninstall com.ctrip.sqllin.driver.test -adb uninstall com.ctrip.sqllin.dsl.test \ No newline at end of file +#adb uninstall com.ctrip.sqllin.driver.test +#adb uninstall com.ctrip.sqllin.dsl.test \ No newline at end of file