Skip to content

Commit cd1baca

Browse files
committed
Merge branch 'sh/enable-native-tests' into sh/release-docs
# Conflicts: # .github/workflows/build.yml
2 parents 4e40ffe + f22b3f5 commit cd1baca

3 files changed

Lines changed: 37 additions & 16 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
with:
3333
msystem: MINGW64
3434
update: true
35-
install: git mingw-w64-x86_64-toolchain libsqlite
35+
install: mingw-w64-x86_64-sqlite3
36+
release: false
3637

3738
- name: Update Environment Variables
3839
if: matrix.os == 'windows-latest'

‎sqliter-driver/build.gradle.kts‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ kotlin {
5050
target.compilerOptions {
5151
freeCompilerArgs.addAll(
5252
when {
53+
// lld's default --no-allow-shlib-undefined fails the link with K/N's glibc. The symbols are
54+
// only referenced by libsqlite3 itself and the system loader resolves them at runtime.
5355
HostManager.hostIsLinux -> listOf(
5456
"-linker-options",
55-
"-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib"
57+
"-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib --allow-shlib-undefined"
5658
)
5759

5860
HostManager.hostIsMingw -> listOf("-linker-options", "-lsqlite3 -Lc:\\msys64\\mingw64\\lib")
@@ -83,11 +85,14 @@ mavenPublishing {
8385
publishToMavenCentral(automaticRelease = true)
8486
}
8587

86-
listOf(
87-
"linuxX64Test",
88-
"linuxArm64Test",
89-
"linkDebugTestLinuxX64",
90-
"linkDebugTestLinuxArm64",
91-
"mingwX64Test",
92-
"linkDebugTestMingwX64",
93-
).forEach { tasks.findByName(it)?.enabled = false }
88+
val disabledTestLinks = mutableListOf("linkDebugTestLinuxArm64")
89+
90+
if (!HostManager.hostIsLinux) {
91+
disabledTestLinks += "linkDebugTestLinuxX64"
92+
}
93+
94+
if (!HostManager.hostIsMingw) {
95+
disabledTestLinks += "linkDebugTestMingwX64"
96+
}
97+
98+
disabledTestLinks.forEach { tasks.findByName(it)?.enabled = false }

‎sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt‎

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,35 @@ class DatabaseConfigurationTest : BaseDatabaseTest(){
2828

2929
@Test
3030
fun databasePathRemovesExtraSlashes() {
31-
val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "//tmp//")
32-
assertEquals("/tmp/$TEST_DB_NAME", dbPathString)
31+
if (Platform.osFamily != OsFamily.WINDOWS) {
32+
val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "//tmp//")
33+
assertEquals("/tmp/$TEST_DB_NAME", dbPathString)
34+
} else {
35+
// On Windows: produces "//tmp//\testdb" there, not "/tmp/testdb".
36+
println("Skipped for windows see issue #140")
37+
}
3338
}
3439

3540
@Test
3641
fun databasePathRemovesFileUrlPrefix() {
37-
val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "file:///tmp/")
38-
assertEquals("/tmp/$TEST_DB_NAME", dbPathString)
42+
if (Platform.osFamily != OsFamily.WINDOWS) {
43+
val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "file:///tmp/")
44+
assertEquals("/tmp/$TEST_DB_NAME", dbPathString)
45+
} else {
46+
// On Windows: produces "/tmp/\testdb" there, not "/tmp/testdb".
47+
println("Skipped for windows see issue #140")
48+
}
3949
}
4050

4151
@Test
4252
fun databasePathRemovesFileUrlPrefixInCaps() {
43-
val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "FILE:///tmp/")
44-
assertEquals("/tmp/$TEST_DB_NAME", dbPathString)
53+
if (Platform.osFamily != OsFamily.WINDOWS) {
54+
val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "FILE:///tmp/")
55+
assertEquals("/tmp/$TEST_DB_NAME", dbPathString)
56+
} else {
57+
// On Windows: produces "/tmp/\testdb" there, not "/tmp/testdb".
58+
println("Skipped for windows see issue #140")
59+
}
4560
}
4661

4762
@Test

0 commit comments

Comments
 (0)