# \[ANN\] bbt 0.0.5

**URL:** <https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352>\
**Category:** Releases\
**Tags:** tests, tool, ada\
**Created:** [October 19, 2024, 11:47am UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352 "2024-10-19T11:47:54Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![LionelDraghi](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lioneldraghi/32/416_2.png) [@LionelDraghi](https://forum.ada-lang.io/u/LionelDraghi)\
**Post date:** [October 19, 2024, 11:47am UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/1 "2024-10-19T11:47:54Z")

</div>

I am pleased to make this first announce of **bbt**.

[bbt](https://github.com/LionelDraghi/bbt/tree/main) 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.

Here is an example of test scenario (but I could say of behavior description) : [bbt/docs/tests/examples/hello\_word.md at 11dffae8e35f2ad7245c036b2063563e9e376aeb · LionelDraghi/bbt · GitHub](https://github.com/LionelDraghi/bbt/blob/11dffae8e35f2ad7245c036b2063563e9e376aeb/docs/tests/examples/hello_word.md)

This documentation file is the only input for btt.  
No preprocessing, no scripting, no manual adjustment, just “run the doc”.

Version 0.0.5 is available in Alire :

```ada
alr get bbt
cd bbt
alr run

```

I run the tests only on Linux yet, but it is supposed to be platform independant.

Any feedback is welcomed!

Lionel

---

<div class="post-metadata">

**Author:** ![Micronian2](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/m/e56c9b/32.png) [@Micronian2](https://forum.ada-lang.io/u/Micronian2)\
**Post date:** [October 19, 2024, 3:19pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/2 "2024-10-19T15:19:26Z")

</div>

That looks like a really nice and useful tool. I definitely need to try that out. BTW, your Archicheck tool also looks like a very handy tool as well.

---

<div class="post-metadata">

**Author:** ![pyj](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/pyj/32/5_2.png) [@pyj](https://forum.ada-lang.io/u/pyj)\
**Post date:** [November 25, 2024, 5:48am UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/3 "2024-11-25T05:48:19Z")

</div>

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](https://github.com/LionelDraghi/bbt/blob/8b0591780f0cc9b94dbb11c358dec3f17f940d15/docs/features/A080_Output_equal_to_file.md), 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:

```ada
- When I run `foo`
- Then `output_file.html` is equal to `expected/reference.html`

```

---

<div class="post-metadata">

**Author:** ![LionelDraghi](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lioneldraghi/32/416_2.png) [@LionelDraghi](https://forum.ada-lang.io/u/LionelDraghi)\
**Post date:** [November 25, 2024, 9:11pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/4 "2024-11-25T21:11:14Z")

</div>

Hi Paul, sounds like a reasonable expectation, I’m on it!

---

<div class="post-metadata">

**Author:** ![LionelDraghi](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lioneldraghi/32/416_2.png) [@LionelDraghi](https://forum.ada-lang.io/u/LionelDraghi)\
**Post date:** [November 25, 2024, 9:13pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/5 "2024-11-25T21:13:50Z")

</div>

But first of all, I’m happy to have a feedback on windows, thank you.

(especially if it works!)

---

<div class="post-metadata">

**Author:** ![LionelDraghi](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lioneldraghi/32/416_2.png) [@LionelDraghi](https://forum.ada-lang.io/u/LionelDraghi)\
**Post date:** [November 25, 2024, 10:56pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/6 "2024-11-25T22:56:12Z")

</div>

Done!  
The code was ready for it, I just had to add a single line of code (in the grammar definition). 😀  
And the test, obviously.

Due to the fact that there is no syntax difference between strings and file name, the keyword **file** must be used :

- Then `file1` is `string` → check that file1 contains exactly `string`  
versus
- Then `file1` is **file** `file2` → check that file1 and file2 are equal

(Cf. the first Warning in [bbt/docs/UG.md at e9ba55452863ce4e04e1583906b06a39d1acd6d6 · LionelDraghi/bbt · GitHub](https://github.com/LionelDraghi/bbt/blob/e9ba55452863ce4e04e1583906b06a39d1acd6d6/docs/UG.md) on this topic)

---

<div class="post-metadata">

**Author:** ![pyj](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/pyj/32/5_2.png) [@pyj](https://forum.ada-lang.io/u/pyj)\
**Post date:** [December 14, 2024, 1:28pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/7 "2024-12-14T13:28:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![LionelDraghi](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lioneldraghi/32/416_2.png) [@LionelDraghi](https://forum.ada-lang.io/u/LionelDraghi)\
**Post date:** [December 14, 2024, 6:38pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/8 "2024-12-14T18:38:59Z")

</div>

Happy to read that!

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)

---

<div class="post-metadata">

**Author:** ![LionelDraghi](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lioneldraghi/32/416_2.png) [@LionelDraghi](https://forum.ada-lang.io/u/LionelDraghi)\
**Post date:** [December 14, 2024, 6:46pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/9 "2024-12-14T18:46:12Z")

</div>

Isn’t the --exec\_dir option doing the job ?

If you run

> bbt -ed .bbt scenario.md

you could put .bbt in your .gitignore?

---

<div class="post-metadata">

**Author:** ![pyj](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/pyj/32/5_2.png) [@pyj](https://forum.ada-lang.io/u/pyj)\
**Post date:** [December 14, 2024, 6:52pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/10 "2024-12-14T18:52:25Z")

</div>

> [@LionelDraghi](#):
>
> g

When I do this it changes into that directory before running any of my commands so none of my sample files I use as inputs can be found.

I really need to be able to run in one directory, and have test output files get put into a different directory.

---

<div class="post-metadata">

**Author:** ![pyj](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/pyj/32/5_2.png) [@pyj](https://forum.ada-lang.io/u/pyj)\
**Post date:** [December 14, 2024, 6:59pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/11 "2024-12-14T18:59:13Z")

</div>

I added you as a collaborator to my repo so you can see what I’m doing.

---

<div class="post-metadata">

**Author:** ![LionelDraghi](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lioneldraghi/32/416_2.png) [@LionelDraghi](https://forum.ada-lang.io/u/LionelDraghi)\
**Post date:** [December 14, 2024, 7:02pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/12 "2024-12-14T19:02:51Z")

</div>

Yes, it’s the expected behavior : [bbt/docs/features/B020\_Exec\_dir.md at 05a0abb3d4dc162ae3b72e8e0953c2d604319835 · LionelDraghi/bbt · GitHub](https://github.com/LionelDraghi/bbt/blob/05a0abb3d4dc162ae3b72e8e0953c2d604319835/docs/features/B020_Exec_dir.md)

And it’s not what you’re asking for.

To understand, when you says “output files”, it’s not THE output file that is provided on the command line with “-o”?

---

<div class="post-metadata">

**Author:** ![LionelDraghi](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lioneldraghi/32/416_2.png) [@LionelDraghi](https://forum.ada-lang.io/u/LionelDraghi)\
**Post date:** [December 14, 2024, 7:03pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/13 "2024-12-14T19:03:52Z")

</div>

Ok, thanks, I have a look.

---

<div class="post-metadata">

**Author:** ![LionelDraghi](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lioneldraghi/32/416_2.png) [@LionelDraghi](https://forum.ada-lang.io/u/LionelDraghi)\
**Post date:** [December 15, 2024, 5:56pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/14 "2024-12-15T17:56:07Z")

</div>

After private discussion with Paul : --tmp\_dir added in the latest on github

---

<div class="post-metadata">

**Author:** ![pyj](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/pyj/32/5_2.png) [@pyj](https://forum.ada-lang.io/u/pyj)\
**Post date:** [December 15, 2024, 6:08pm UTC](https://forum.ada-lang.io/t/ann-bbt-0-0-5/1352/15 "2024-12-15T18:08:56Z")

</div>

Many thanks to @LionelDraghi for the quick updates! `bbt` has been super useful on my project.
