diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2024-08-22 00:10:26 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2024-08-22 00:23:23 +0200 |
| commit | d7eefa8066b8e2ac70e0a4080c52bce20da24a23 (patch) | |
| tree | 2d2ccae50b30f82ced23363a17653e31c0d79804 /libs/samba/build.gradle.kts | |
| parent | 275de81f854be66f575e3c8e36a0c1b56281e788 (diff) | |
samba: Add docker server run by tests
Current user needs to be in docker group (or in some other way have
access to the docker.socket) for this to work.
Two current problems:
* listRoot() fails, no directories are found.
* gradle hangs after running the samba tests
Diffstat (limited to 'libs/samba/build.gradle.kts')
| -rw-r--r-- | libs/samba/build.gradle.kts | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/libs/samba/build.gradle.kts b/libs/samba/build.gradle.kts index 2fc5007..b7816c4 100644 --- a/libs/samba/build.gradle.kts +++ b/libs/samba/build.gradle.kts @@ -1,7 +1,12 @@ +import org.gradle.api.tasks.testing.logging.TestExceptionFormat + plugins { alias(libs.plugins.android.library) } +val shareDir = layout.buildDirectory.dir("test-share") +val dockerDir = layout.projectDirectory.dir("src/test/docker") + android { namespace = "org.the_jk.cleversync.samba" @@ -19,6 +24,24 @@ android { externalNativeBuild { cmake { cFlags += listOf("-O3") } } } } + + testOptions { + unitTests { + all { test -> + test.doFirst { + shareDir.get().asFile.mkdirs() + } + + test.systemProperty("dockerDir", dockerDir.toString()) + test.systemProperty("shareDir", shareDir.get().toString()) + + test.testLogging { + showStandardStreams = true + exceptionFormat = TestExceptionFormat.FULL + } + } + } + } } dependencies { @@ -26,7 +49,7 @@ dependencies { } listOf("Debug", "Release").forEach { buildType -> - val buildDir = project.layout.buildDirectory.dir("test/debug/build") + val buildDir = project.layout.buildDirectory.dir("test-cpp/debug/build") val configure by tasks.register( "configureLibsFor${buildType}UnitTest", |
