Stream: beginners

Topic: Testing bulk Roc files


view this post on Zulip Luke Boswell (Mar 07 2023 at 09:29):

Is there an easy way to test more than one .roc file at a time? I assume this could be done with a bash script, but I was hoping I could use roc test /files/*.roc.

view this post on Zulip Hannes (Mar 07 2023 at 09:54):

Probably not the solution you were looking for, but Fish shell will expand globs for you, so if you have two files a.roc and b.roc then roc test *.roc is equivalent to running roc test a.roc b.roc.

view this post on Zulip Richard Feldman (Mar 07 2023 at 13:12):

if you do roc test main.roc (or just roc test) it should find them all

view this post on Zulip Richard Feldman (Mar 07 2023 at 13:12):

it should test not just the file you specified, but also everything it imports (which from main.roc should be everything)

view this post on Zulip Brendan Hansknecht (Mar 07 2023 at 15:14):

Maybe you can also specify a folder? I am pretty sure we do something of that nature for testing all of the builtins, but i could be mixed up.

If not, would be a great pr to add

view this post on Zulip Richard Feldman (Mar 07 2023 at 18:30):

yeah that seems reasonable :thumbs_up:

view this post on Zulip Richard Feldman (Mar 07 2023 at 18:35):

all of the following seem like reasonable things to support:

one important trick would be that when doing this we'd need to avoid duplicates - e.g. if multiple specified .roc files import the same (potentially unspecified) .roc file, we need to not run its tests more than once

view this post on Zulip Luke Boswell (Mar 08 2023 at 05:02):

Added as an Issue #5103.


Last updated: Jul 05 2025 at 12:14 UTC