Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter for test/Benchmarks #8391

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions test/Benchmarks/src/Main.enso
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,23 @@ all_benchmarks =

builder.to_vector

main =
benchmarks = all_benchmarks
main filter=Nothing =
benchmarks = if filter.is_nothing then all_benchmarks else
no_nothing x = x.is_nothing.not

filter_benchmarks (b:Bench) = case b of
Bench.All groups ->
vec = groups.map filter_benchmarks . filter no_nothing
if vec.is_empty then Nothing else
Bench.All vec
Bench.Group n opts specs -> if n.contains filter then b else
vec = specs.map filter_benchmarks . filter no_nothing
if vec.is_empty then Nothing else
Bench.Group n opts vec
Bench.Spec n _ -> if n.contains filter then b else Nothing

all_benchmarks.map filter_benchmarks . filter no_nothing

total_specs = benchmarks.map .total_specs . fold 0 (+)
IO.println "Found "+benchmarks.length.to_text+" benchmark suites, containing "+total_specs.to_text+" specs in total."
estimated_duration = benchmarks.map .estimated_runtime . fold Duration.zero (+)
Expand Down
Loading