From ee736c90b082da23291c461ebcb40bafca44e66c Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Fri, 14 Jul 2023 11:40:42 +0200 Subject: [PATCH] [K/N] Allow tweaking executionTimeout of RunGTest --- kotlin-native/HACKING.md | 9 +++++---- .../jetbrains/kotlin/bitcode/CompileToBitcodePlugin.kt | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/kotlin-native/HACKING.md b/kotlin-native/HACKING.md index 3035ee25d39..bfb226f78a5 100644 --- a/kotlin-native/HACKING.md +++ b/kotlin-native/HACKING.md @@ -141,12 +141,13 @@ To run Kotlin/Native target-specific tests use (takes time): case of targets that are tricky to execute tests on. ### Runtime unit tests - -To run runtime unit tests on the host machine for both mimalloc and the standard allocator: + +To run all runtime unit tests on the host machine: ./gradlew :kotlin-native:runtime:hostRuntimeTests - -To run tests for only one of these two allocators, run `:kotlin-native:runtime:hostStdAllocRuntimeTests` or `:kotlin-native:runtime:hostMimallocRuntimeTests`. + +Use `-Pgtest_filter=` to filter which tests to run (uses Google Test filter syntax). +Use `-Pgtest_timeout=` to limit how much time each test executable can take (accepts values like `30s`, `1h15m20s`, and so on). We use [Google Test](https://github.com/google/googletest) to execute the runtime unit tests. The build automatically fetches the specified Google Test revision to `kotlin-native/runtime/googletest`. It is possible to manually modify the downloaded GTest sources for debug diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/bitcode/CompileToBitcodePlugin.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/bitcode/CompileToBitcodePlugin.kt index efd88a31b37..5c971899a1b 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/bitcode/CompileToBitcodePlugin.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/bitcode/CompileToBitcodePlugin.kt @@ -603,7 +603,10 @@ open class CompileToBitcodeExtension @Inject constructor(val project: Project) : filter.set(project.findProperty("gtest_filter") as? String) tsanSuppressionsFile.set(project.layout.projectDirectory.file("tsan_suppressions.txt")) this.target.set(target) - this.executionTimeout.set(Duration.ofMinutes(30)) // The tests binaries are big. + this.executionTimeout.set( + (project.findProperty("gtest_timeout") as? String)?.let { + Duration.parse("PT${it}") + } ?: Duration.ofMinutes(30)) // The tests binaries are big. usesService(runGTestSemaphore) }