How to run a single compiler spec

Hello,

Is there a canonical way to run a single compiler spec?

I would like to just run parser_spec.cr, but I didn’t find any option in make compiler_spec to run a single spec.

Note: as a workaround I updated spec/compiler/compilers_spec.cr to include just the spec I want to run

# require "./compiler/**"
require "./compiler/parser/parser_spec.cr"

Should be able to do it just like you would with a normal spec file. E.g. ./bin/crystal spec spec/compiler/parser/parser_spec.cr.

Also just doing crystal your_spec_file.cr should work fine too

Thanks!

All these work:

./bin/crystal spec spec/compiler/parser/parser_spec.cr
./bin/crystal spec/compiler/parser/parser_spec.cr
crystal spec/compiler/parser/parser_spec.cr

You can also specify a line number to avoid re-running everything (ref)