Skip to content

Commit 2bd7776

Browse files
authored
Allow running quicktest in --run-only (mostly for AI purpose) (#4430)
1 parent 61af16e commit 2bd7776

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ The build system is implemented in F# at `src/Fable.Build/`. All commands go thr
2525
./build.sh test python --skip-fable-library-core # Skip slow Rust extension + .pyi rebuild (Python only)
2626
./build.sh test python --type-check # Run Pyright type checking on Python output
2727

28-
# Quick iteration (watch mode on a minimal project)
29-
./build.sh quicktest javascript # Also: typescript, python, dart, rust, beam
28+
# Quick iteration (test on a minimal project)
29+
./build.sh quicktest javascript --run-only # Also: typescript, python, dart, rust, beam
3030
```
3131

3232
`--skip-fable-library` is safe when changes are only in `src/Fable.Transforms/` or other compiler code. If you modified runtime library source (e.g., `src/fable-library-py/`, `src/fable-library-ts/`), do not skip. If you already ran `./build.sh fable-library` separately, use `--skip-fable-library` when running tests right afterwards to avoid rebuilding.

src/Fable.Build/Quicktest/Core.fs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type QuicktestConfig =
2020

2121
let genericQuicktest (config: QuicktestConfig) (args: string list) =
2222
let skipFableLibrary = args |> List.contains "--skip-fable-library"
23+
let runOnly = args |> List.contains "--run-only"
2324

2425
config.FableLibBuilder.Run(skipFableLibrary)
2526

@@ -44,17 +45,19 @@ let genericQuicktest (config: QuicktestConfig) (args: string list) =
4445
workingDirectory = projectDir
4546
)
4647

47-
Command.WatchFableAsync(
48+
let fableArgs =
4849
CmdLine.empty
4950
|> CmdLine.appendRaw projectDir
5051
|> CmdLine.appendPrefix "--lang" config.Language
5152
|> CmdLine.appendPrefix "--extension" config.Extension
5253
|> CmdLine.appendPrefix "--exclude" "Fable.Core"
5354
|> CmdLine.appendRaw "--noCache"
5455
|> CmdLine.appendRaw "--verbose"
55-
|> CmdLine.appendRaw "--watch"
56-
|> appendRunMode,
57-
workingDirectory = projectDir
58-
)
59-
|> Async.AwaitTask
60-
|> Async.RunSynchronously
56+
|> appendRunMode
57+
58+
if runOnly then
59+
Command.Fable(fableArgs, workingDirectory = projectDir)
60+
else
61+
Command.WatchFableAsync(fableArgs |> CmdLine.appendRaw "--watch", workingDirectory = projectDir)
62+
|> Async.AwaitTask
63+
|> Async.RunSynchronously

0 commit comments

Comments
 (0)