# \[pre-ANN-RFC\] TestExtras.jl

**URL:** <https://discourse.julialang.org/t/pre-ann-rfc-testextras-jl/46487>\
**Category:** Package Announcements\
**Created:** [September 12, 2020, 12:03am UTC](https://discourse.julialang.org/t/pre-ann-rfc-testextras-jl/46487 "2020-09-12T00:03:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![juthohaegeman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juthohaegeman/32/8620_2.png) [@juthohaegeman](https://discourse.julialang.org/u/juthohaegeman)\
**Post date:** [September 12, 2020, 12:03am UTC](https://discourse.julialang.org/t/pre-ann-rfc-testextras-jl/46487/1 "2020-09-12T00:03:24Z")

</div>

In one of my packages, I often wanted to test for type stability and inferrability of the return type, but while relying on the mechanism of constant propagation. Unfortunately this is not covered by `Test.@inferred`, so I decided to write my own adaption of that macro. Not only does it deal with constant propagation, the successful or failed inference also contributes to the actual passed or failed test count, rather than just throwing a generic error.

Another addition to the standard library `Test` that I wanted is a `TestSet` type that records the total execution time of a given testset.

I’ve now wrapped up both functionalities in the (not-yet-registered) package [TestExtras.jl](https://github.com/Jutho/TestExtras.jl). Before registering this, I wanted to probe

- whether there is some general interest in this functionality,
- whether this could benefit from being moved to some more central Julia organisation,
- whether there are other common additions to the standard Test library that people use, have implemented or want to see, and if so, if there is any interest in bundling them together in this package, or a similar package with a different name,
- whether this could in time be considered as a PR to Test?

---

<div class="post-metadata">

**Author:** ![helgee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/helgee/32/2022_2.png) [@helgee](https://discourse.julialang.org/u/helgee)\
**Post date:** [September 12, 2020, 6:11am UTC](https://discourse.julialang.org/t/pre-ann-rfc-testextras-jl/46487/2 "2020-09-12T06:11:12Z")

</div>

> **[GitHub - YingboMa/SafeTestsets.jl](https://github.com/YingboMa/SafeTestsets.jl)**
>
> Contribute to YingboMa/SafeTestsets.jl development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![ric.cioffi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ric.cioffi/32/18373_2.png) [@ric.cioffi](https://discourse.julialang.org/u/ric.cioffi)\
**Post date:** [September 12, 2020, 9:25am UTC](https://discourse.julialang.org/t/pre-ann-rfc-testextras-jl/46487/3 "2020-09-12T09:25:39Z")

</div>

> [@juthohaegeman](#):
>
> Not only does it deal with constant propagation, the successful or failed inference also contributes to the actual passed or failed test count, rather than just throwing a generic error.

FYI, I recently stumbled on a [PR](https://github.com/JuliaLang/julia/pull/23426) about this that was never implemented. Not sure what the problem was with that PR, but I’d definitely be interested in a version of `@inferred` that contributes to the test count.

---

<div class="post-metadata">

**Author:** ![juthohaegeman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juthohaegeman/32/8620_2.png) [@juthohaegeman](https://discourse.julialang.org/u/juthohaegeman)\
**Post date:** [September 12, 2020, 12:32pm UTC](https://discourse.julialang.org/t/pre-ann-rfc-testextras-jl/46487/4 "2020-09-12T12:32:20Z")

</div>

Thanks for the pointer @ric.cioffi . That’s slightly different (as it returns the result of the inference tests as a `Bool`) but indeed very similar in underlying motivation/goal. I’ve posted a small note in that PR to also point out the current possibility.

@helgee, thanks for the link. Maybe there is some interest with @YingboMa to join our efforts and have all functionality together in one package?
