# Unit Testing Frameworks for Fortran

**URL:** <https://fortran-lang.discourse.group/t/unit-testing-frameworks-for-fortran/6944>\
**Category:** Poll\
**Created:** [December 7, 2023, 4:59am UTC](https://fortran-lang.discourse.group/t/unit-testing-frameworks-for-fortran/6944 "2023-12-07T04:59:38Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![RonShepard](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@RonShepard](https://fortran-lang.discourse.group/u/RonShepard)\
**Post date:** [December 10, 2023, 2:01am UTC](https://fortran-lang.discourse.group/t/unit-testing-frameworks-for-fortran/6944/19 "2023-12-10T02:01:42Z")

</div>

> [@Carltoffel](#):
>
> Instead, you can use the ISO C Binding feature of Fortran to call the C `isatty` function.

The `isatty()` function is an operating system call, not a C library call. It is a POSIX function, so the use should be portable to any posix-compliant OS. Of course, the API is defined in C, as all POSIX functions are defined. The two choices are to try to call the OS function directly from fortran, or to write a wrapper in C and then call that from fortran. In this case, there are some error codes that are set, and those are easiest to reference from C, so maybe the wrapper approach is indicated. Also, the argument to the function is a file descriptor, so there is the issue of associating a fortran unit with a C file descriptor.

edit: I also noticed the previous discussion topic. [Should INQUIRE have an ISATTY parameter?](https://fortran-lang.discourse.group/t/should-inquire-have-an-isatty-parameter/301)

---

_[View the full topic](https://fortran-lang.discourse.group/t/unit-testing-frameworks-for-fortran/6944)._
