Skip to content

Commit 13fb954

Browse files
committed
add a more --allow-no-tests flag in tests
1 parent cfd2fb6 commit 13fb954

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

stdlib-candidate/testing.nu

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export def run-tests [
282282
--exclude: string, # Pattern to use to exclude tests. Default: no tests are excluded
283283
--exclude-module: string, # Pattern to use to exclude test modules. Default: No modules are excluded
284284
--list, # list the selected tests without running them.
285+
--allow-no-tests,
285286
--threads: int@"nu-complete threads", # Amount of threads to use for parallel execution. Default: All threads are utilized
286287
] {
287288
let available_threads = (sys cpu | length)
@@ -355,7 +356,9 @@ export def run-tests [
355356
}
356357

357358
if ($modules | is-empty) {
358-
error make --unspanned {msg: "no test to run"}
359+
if (not $allow_no_tests) {
360+
error make --unspanned {msg: "no test to run"}
361+
}
359362
}
360363

361364
let results = (

toolkit.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export def "check pr" [
3838

3939
export def test-stdlib-candidate [] {
4040
use stdlib-candidate/testing.nu
41-
testing run-tests --path stdlib-candidate/
41+
testing run-tests --allow-no-tests --path stdlib-candidate
4242
}
4343

4444
# View subcommands.

0 commit comments

Comments
 (0)