Running#
rbx provides a range of options to run your solutions. In the sections below, we'll go through each of them.
Running solutions on the whole testset#
You can use the rbx run command to run your solutions on the whole testset.
The command will run all selected solutions (or all declared solutions if none are selected) on all testcases, providing for each of them the solution outcome, and for the whole testset the timing and memory usage.
Below are some examples of how to use the command.
# Run all solutions on all testcases
rbx run
# Run a single solution (or a list of solutions) on all testcases
rbx run <solution-name> ...
# Run all AC solutions on all testcases
rbx run --outcome AC
# Run all WA solutions on all testcases
rbx run --outcome WA
# Run all solutions, and provide a table-like output instead
# of the default output
rbx run -d
# Interactively pick which solutions to run
rbx run -c
One can also set the verification level to be used when running the solutions.
You can read more about each verification level here.
By default, rbx will run solutions with the maximum verification level. This means tests will be built
and verified, and that all solutions will be run with twice the time limit, and a warning will show up if a TLE solution passed in 2*TL.
Solutions are also bounded by a configurable wall (real) time limit, derived from the CPU time limit — see Wall time limits.
The results of a rbx run command can be inspected through the rbx ui command, as shown in the
animation below.
Sharing a report#
Sometimes you want to send a run report (or a time-estimation report) to someone
else. The --share flag captures the report exactly as it appears in your
terminal and copies it to your clipboard, ready to paste into a chat, an
issue, or an email.
# Copy the run report to the clipboard as an image (PNG)
rbx run --share png
# Copy it as plain text instead
rbx run --share text
# Works for the time-estimation report too — this captures the run report
# *and* the per-language-group time limits table
rbx time --share png
A few things to keep in mind:
--share pngrequires an SVG-to-PNG converter on yourPATH. rbx looks forrsvg-convert, then ImageMagick (magick/convert), then macOSqlmanage. If none is found, the report is saved as an SVG file instead and its path is printed.- Copying an image to the clipboard is supported on macOS and Linux
(the latter needs
xcliporwl-copy). On other platforms — or when no clipboard tool is available — the report is written to a file in your build directory and its path is printed, so you never lose the artifact. --share textworks everywhere a clipboard tool is available, and falls back to a file otherwise.
Running tests with custom inputs#
You might want to run your solutions on a testcase that is not part of the testset, or even on a specific testcase of the testset.
You can do this with the rbx irun command. The command will select which solutions to run similar to rbx run.
This means you can specify with the following flags:
# Run a single solution (or a list of solutions) on a specific testcase
rbx irun <solution-name> ...
# Run all AC solutions on a specific testcase
rbx irun --outcome AC
# Interactively pick which solutions to run
rbx irun -c
By default, rbx irun will prompt you to type a testcase input. After you've finished typing it, you can press
Ctrl+D to tell rbx that you're done.
rbx will then run the solutions on the testcase you've provided, and print the results into files. You can
also use the -p flag to instruct it to print the results into the console instead.
When printing with -p, the solution's stderr is shown in its own colored section right after the output.
If you'd rather see it woven into the output in true line order — handy for debugging where each log line was
emitted relative to the program's output — add the --merge-stderr / -e flag. The interleaved stderr lines
are colored distinctly, and the clean output is left untouched so the checker still sees exactly what the
solution printed.
# Interleave stderr with the output in true line order (requires -p)
rbx irun <solution-name> -t sample/0 -p -e
For interactive (communication) problems, -e folds the solution's stderr
into the interaction view as a third stream, alongside the interactor and solution messages.
Tip
By default, the test you've written will be validated, so make sure you've typed it perfectly.
If you want to disable validation, you can pass the -v0 flag to set the verification level to 0.
You can also specify a certain testcase of the testset to run using the -t flag followed by the testcase notation, which
is composed of <testgroup-name>/<testcase-index>. For instance, samples/0 is the first testcase in the sample testgroup,
and secret/10 is the 11th testcase in the secret testgroup.
Last but not least, you can also specify a generator call to be used when generating the testcase.