bbt is a simple tool to “black box” check the behavior of an executable (hence the name, bbt stands for Black Box Tester) in command line mode.
btt special feature is that it aims at directly using your behavior description as the test script.
The description is in Markdown, structured with the classical Gherkin Given / When / Then.
I’ve been trying this out a bit on Windows, and it seems like a great fit to test something that I’m working on.
Is there a way to test a written file against another file? I see output against a file, but not a created file against a pre-existing file. I want to specify a very large output file outside of the Markdown and have it diff’d against a file created when a program is run.
I’d trying to do something like:
- When I run `foo`
- Then `output_file.html` is equal to `expected/reference.html`
Been using BBT for a project for a few weeks, one thing that’d be really great, would be providing a directory for all of the temporary files when I’m not letting bbt do cleanup. This would allow me to add that directory to .gitignore but still inspect program runs manually when debugging.
Side note : consequence of you using it seriously on Windows, I decided to be more proactive on it, and to run the Makefile on Windows.
First result was kind of discouraging, with half of the tests failing!
But most of the failures where due to :
one function, File_Utilities.Short_Path, that was not able to process correctly DOS formatted PATH;
the “.exe” at the end of the exec name;
app I was using on Linux for the examples, or in the make file (rpl, gcc, mlc, etc.)
I found most of those apps on windows, modify the Makefile with some lines specifics to Windows, and modify Short_Path (and more than double the unit test volume).
Now, 62 out of 65 bbt tests are OK on Windows.Two of the still failing tests contains PATH in their expected results, and I don’t know for now how to specify with bbt that the expected result is /my/path on Linux and c:\my\path on Windows. And the last failing is a test on escaping character in the command line specific to sh/bash.
Nice experience for me, I was not used to such a multi-plateform context.
Anyhow, I pushed the result on github today with the v0.0.6 tag. (and it’s on the Alire pipe)