# Is gnattest usable?

**URL:** <https://forum.ada-lang.io/t/is-gnattest-usable/1272>\
**Category:** General\
**Tags:** ada, gnat, test\
**Created:** [September 30, 2024, 11:50am UTC](https://forum.ada-lang.io/t/is-gnattest-usable/1272 "2024-09-30T11:50:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![evanescente-ondine](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/evanescente-ondine/32/451_2.png) [@evanescente-ondine](https://forum.ada-lang.io/u/evanescente-ondine)\
**Post date:** [September 30, 2024, 11:50am UTC](https://forum.ada-lang.io/t/is-gnattest-usable/1272/1 "2024-09-30T11:50:43Z")

</div>

Hi,  
I would like to learn about automated unit testing, because I’m lazy and hate writing the same code over and over, but I read that GNATTest has been dead for four years because it uses ASIS ?  
So its menu entry has been sitting there in plain sight in gnatstudio, doing nothing, for years ?

---

<div class="post-metadata">

**Author:** ![simonjwright](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/simonjwright/32/11_2.png) [@simonjwright](https://forum.ada-lang.io/u/simonjwright)\
**Post date:** [September 30, 2024, 1:37pm UTC](https://forum.ada-lang.io/t/is-gnattest-usable/1272/2 "2024-09-30T13:37:50Z")

</div>

You can get it via Alire in `libadalang_tools` (along with gnatmetric, gnatpp, and gnatstub).

---

<div class="post-metadata">

**Author:** ![Max](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/max/32/21_2.png) [@Max](https://forum.ada-lang.io/u/Max)\
**Post date:** [September 30, 2024, 1:49pm UTC](https://forum.ada-lang.io/t/is-gnattest-usable/1272/3 "2024-09-30T13:49:17Z")

</div>

gnattest has been rewritten with Libadalang. You can install it with alire:

```shell
alr install --prefix=where_you_want_it libadalang_tools

```

---

<div class="post-metadata">

**Author:** ![evanescente-ondine](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/evanescente-ondine/32/451_2.png) [@evanescente-ondine](https://forum.ada-lang.io/u/evanescente-ondine)\
**Post date:** [September 30, 2024, 2:23pm UTC](https://forum.ada-lang.io/t/is-gnattest-usable/1272/5 "2024-09-30T14:23:30Z")

</div>

Not at easy to handle as gnatprove…  
I tried `gnattest --harness-dir=. -P spreadsheet.gpr` as in their “simple example” [here](https://docs.adacore.com/gnatcov-docs/gnattest/gnattest_part.html) and I get those messages:

> gnattest: spreadsheet\_config.gpr:2:06: imported project file “ansiada.gpr” not found  
> gnattest: spreadsheet\_config.gpr:2:06: imported by “/home/drm/Documents/Administration/Ada/spreadsheet/config/spreadsheet\_config.gpr”  
> gnattest: spreadsheet\_config.gpr:2:06: imported by “/home/drm/Documents/Administration/Ada/spreadsheet/spreadsheet.gpr”  
> gnattest: spreadsheet\_config.gpr:3:06: imported project file “gnatcoll.gpr” not found  
> gnattest: spreadsheet\_config.gpr:3:06: imported by “/home/drm/Documents/Administration/Ada/spreadsheet/config/spreadsheet\_config.gpr”  
> gnattest: spreadsheet\_config.gpr:3:06: imported by “/home/drm/Documents/Administration/Ada/spreadsheet/spreadsheet.gpr”  
> try “gnattest --help” for more information.

Even if the program runs fine. Does it look like a bug ? No test or harness is created either
