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

Test case doesn't work anymore #54

Closed
david542542 opened this issue Oct 19, 2022 · 2 comments
Closed

Test case doesn't work anymore #54

david542542 opened this issue Oct 19, 2022 · 2 comments

Comments

@david542542
Copy link

It seems perhaps the format was updated to accept two different files, one for lexing and one for parsing. Running the default example I get:

LA-DEV-IM-MM:grammarinator david$ grammarinator-process examples/grammars/HTMLLexer.g4 examples/grammars/HTMLParser.g4 \
>   -o examples/fuzzer/
LA-DEV-IM-MM:grammarinator david$ grammarinator-generate HTMLCustomGenerator.HTMLCustomGenerator -r htmlDocument -d 20 \
>   -o examples/tests/test_%d.html -n 100 \
>   -s HTMLGenerator.html_space_serializer \
>   --sys-path examples/fuzzer/
usage: grammarinator-generate [-h] -p FILE -l FILE [-r NAME]
                              [-t LIST [LIST ...]]
                              [--test-transformers LIST [LIST ...]]
                              [-d NUM] [-c NUM] [--population DIR]
                              [--no-generate] [--no-mutate]
                              [--no-recombine] [--keep-trees]
                              [-j NUM] [-o FILE] [--encoding ENC]
                              [--log-level LEVEL] [-n NUM]
                              [--sys-recursion-limit NUM] [--version]
grammarinator-generate: error: the following arguments are required: -p/--unparser, -l/--unlexer

Actually, I wasn't able to get this to work with the separated files (the tree itself would always error). Any feedback or update on how to use this would be great. Thanks

@david542542 david542542 changed the title Test case doesn't even work anymore Test case doesn't work anymore Oct 19, 2022
@renatahodovan
Copy link
Owner

@david542542 Hi! You are right, the expected input format has changed since the latest release, but in the opposite direction as you might think: defining --unlexer and --unparser is the old way, now we are using fully qualified names (like HTMLCustomGenerator.HTMLCustomGenerator in the example).

The problem with the failing setup above is that you probably installed the latest release of Grammarinator (e.g., from PyPI with pip install grammarinator) but you are executing the example of the latest master.

You have two options the fix the issue:

  1. Install the latest master (pip install . from the root directory of Grammarinator) and repeat the commands above.
  2. Keep your current install but update the grammarinator-generate command to follow the old style CLI as suggested in the old README:
grammarinator-generate -l examples/fuzzer/HTMLCustomUnlexer.py \
-p examples/fuzzer/HTMLCustomUnparser.py -r htmlDocument \
-o examples/tests/test_%d.html -t HTMLUnparser.html_space_transformer -n 100 -d 20

@david542542
Copy link
Author

@renatahodovan fantastic, thanks so much for the response and such an awesome project! I've gotten it to work based on your above feedback -- I ended up just installing it from Github source, instead of pip. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants