-
Notifications
You must be signed in to change notification settings - Fork 7
Introduce DocTest #3
Conversation
Diff with RFC 52 is that we are now relying on a real PHP parser with an AST instead of the tokenizer, this is less error-prone and easier to manipulate the code. Also this is more a “all-batteries included” approach, which I think is better. |
Oh, to test it: |
@Hywan Nice, I have just look at it quickly for now and it works well. They show me an error in documentation in entity file PR will come. OK PR done. You can also add an option to overwrite all tests created. After tests, it looks really cool and they have raised some error on documentation or code it's cool :D |
@Hywan tests are generated and they don't need to be committed (as there already exists in documentation) so for me we need to add it in |
Great feature! The only thing that i don't really like here is that the user has to run a second command to run the generated tests. Something seems wrong to me here. Imagine I write the doc blocks, with code snippets, and I build the doc only. I don't run the tests. I'll end up publishing a doc which is probably false. Some tests may fail but I did not run them. It would be really awesome if tests were run directly in during the build process to ensure everything is correct. |
@jubianchi OK. I will address that in another PR. |
The goal of this failure field is to hide paths where test suites are stored. Another goal is to simplify the output with no useless information in this particular context.
So the goal is to basically merge RFC 52 into this RFC. With this patch, Kitab is able to compile the documentation into HTML+CSS+JS, but also able to test it!
This is still a work in progress, but it works!
cc @jubianchi @vonglasow