Le dim. 1 déc. 2019 à 06:09, Gerwin Klein <ge...@do...> a écrit :
> So, I’ve finally managed to take a closer look at Bazel and I really like
> its responsiveness.
>
> Will probably need to spend a bit more time with it for it to feel really
> familiar. I’ve managed to build and run jflex and the example through bazel
>
Cool. Just want to point out that I wrote a custom bazel rule to run JFlex.
The rule itself is defined in bazel_rules
<https://github.com/jflex-de/bazel_rules>
> but I haven’t figured out yet for instance how to get a list of all
> available test targets (or how to run them all).
>
Usually I just run them all [... is recursive]
bazel test //...
Or just the integration tests [and you can pick the directory of your
choice]
bazel test //javatests/jflex/testcase/...
There is also a query syntax
<https://docs.bazel.build/versions/master/query-how-to.html> which may be
useful to understand the dependencies, and can be used to answer your first
question (list all tests)
bazel query 'kind(".*test rule", //...)'
Speaking about the tests, I'm also migrating the test suite
<https://github.com/jflex-de/jflex/wiki/Migration-to-Bazel#migrate-testsuite>
to bazel. After moving a few by hand, I made a tool to automate the process
<https://github.com/jflex-de/jflex/tree/master/java/jflex/migration>.
In the process, I also make some cleanup, such as updating the sourceforge
bug to a github bug number.
Also, generally, I think the regression tests should be based on expected
*behavior* rather than the content of System.out. For instance, the
eofclose test can check whether the reader throws an exception
<https://github.com/jflex-de/jflex/pull/642/files#r352343386> rather
than printing
the exception
<https://github.com/jflex-de/jflex/blob/master/testsuite/testcases/src/test/cases/eofclose/eofclose.flex#L45>
and asserting that System.out contains this message
<https://github.com/jflex-de/jflex/blob/master/testsuite/testcases/src/test/cases/eofclose/eofclose-0.output>
.
I also wrote some small utility code. For instance, maybe we could offer
the ScannerFactory
<https://github.com/jflex-de/jflex/blob/master/java/jflex/util/scanner/ScannerFactory.java>
in
the main distribution. If offers utility methods to create a scanner from
different inputs (kind of rolls back #195 Remove InputStream-param
constructor <https://github.com/jflex-de/jflex/issues/195> in a more
elegant way)
Régis
>
> On 27 Nov 2019, at 09:42, Régis Décamps <re...@de...> wrote:
>
> Hey!
>
> I think Bazel really works well for JFlex.
>
> The build on Cirrus usually takes less than a minute.
>
> And the manual can be produced with the only dep of having python
> installed (and that's a bug in the rule, I'd say).
>
> The first time will be slow, though (well, Maven was also slow when it was
> fetching all deps)
>
> I tried to document things on the home page README and other directories.
> Let me know if you need help.
>
> Cheers,
>
> --
> Régis Décamps
>
> http://regis.decamps.info/
>
>
>
--
Régis Décamps
http://regis.decamps.info/
|