From c3473cc626467dc86bf34af0d6fe5e09f4ec29f3 Mon Sep 17 00:00:00 2001 From: translatenix <119817707+translatenix@users.noreply.github.com> Date: Wed, 14 Feb 2024 06:14:21 -0800 Subject: [PATCH] Add Gradle task "testNative" Support running native tests with "gw testNative" for consistency with "gw test". --- DEVELOPMENT.adoc | 3 ++- buildSrc/src/main/kotlin/pklNativeBuild.gradle.kts | 6 +++++- pkl-core/pkl-core.gradle.kts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DEVELOPMENT.adoc b/DEVELOPMENT.adoc index f0d5ee59..792b05c8 100644 --- a/DEVELOPMENT.adoc +++ b/DEVELOPMENT.adoc @@ -28,7 +28,8 @@ jenv enable-plugin export [source,shell] ---- gw clean -gw test +gw test # run all tests except native executable tests +gw testNative # run native executable tests gw spotlessApply # fix code formatting gw build # build everything except native executables gw buildNative # build macOS executable on macOS, diff --git a/buildSrc/src/main/kotlin/pklNativeBuild.gradle.kts b/buildSrc/src/main/kotlin/pklNativeBuild.gradle.kts index 78c2a2ff..60d5d72e 100644 --- a/buildSrc/src/main/kotlin/pklNativeBuild.gradle.kts +++ b/buildSrc/src/main/kotlin/pklNativeBuild.gradle.kts @@ -1,6 +1,10 @@ val assembleNative by tasks.registering {} -val checkNative by tasks.registering {} +val testNative by tasks.registering {} + +val checkNative by tasks.registering { + dependsOn(testNative) +} val buildNative by tasks.registering { dependsOn(assembleNative, checkNative) diff --git a/pkl-core/pkl-core.gradle.kts b/pkl-core/pkl-core.gradle.kts index 569ba83f..fe3daa73 100644 --- a/pkl-core/pkl-core.gradle.kts +++ b/pkl-core/pkl-core.gradle.kts @@ -271,7 +271,7 @@ val testAlpineExecutableAmd64 by tasks.registering(Test::class) { } } -tasks.checkNative { +tasks.testNative { dependsOn(testLinuxExecutableAmd64) dependsOn(testLinuxExecutableAarch64) dependsOn(testMacExecutableAmd64)