# How to run specific testsets in a test script?

**URL:** <https://discourse.julialang.org/t/how-to-run-specific-testsets-in-a-test-script/38944>\
**Category:** General Usage\
**Tags:** question, testing\
**Created:** [May 7, 2020, 10:23am UTC](https://discourse.julialang.org/t/how-to-run-specific-testsets-in-a-test-script/38944 "2020-05-07T10:23:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JesperMartinsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jespermartinsson/32/34098_2.png) [@JesperMartinsson](https://discourse.julialang.org/u/JesperMartinsson)\
**Post date:** [May 7, 2020, 10:23am UTC](https://discourse.julialang.org/t/how-to-run-specific-testsets-in-a-test-script/38944/1 "2020-05-07T10:23:01Z")

</div>

Is there a build in or preferred way to run a specific testset in a script, based on e.g. the testset’s description, as opposed to running all testsets in the script?

In many packages, see e.g. [LightGraphs.jl](https://github.com/JuliaGraphs/LightGraphs.jl/blob/master/test/runtests.jl), seem to have different tests divided into separate scripts to handle this. However, it would be nice when doing test driven dev of specific parts to just run one or a few testsets in a script (I currently do this using inconvenient if-statements).

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 7, 2020, 3:29pm UTC](https://discourse.julialang.org/t/how-to-run-specific-testsets-in-a-test-script/38944/2 "2020-05-07T15:29:45Z")

</div>

There is some functionality for selectively running tests in

> **[GitHub - ssfrr/TestSetExtensions.jl: Extensions to Julia's Base.Test](https://github.com/ssfrr/TestSetExtensions.jl)**
>
> Extensions to Julia's Base.Test. Contribute to ssfrr/TestSetExtensions.jl development by creating an account on GitHub.

Making the test files self-contained scripts is also an option for interactive use, see eg the organization of tests in

> <https://github.com/JuliaArrays/StaticArrays.jl/tree/master/test>
>
> //github.com/JuliaArrays/StaticArrays.jl/tree/master/test

---

<div class="post-metadata">

**Author:** ![JesperMartinsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jespermartinsson/32/34098_2.png) [@JesperMartinsson](https://discourse.julialang.org/u/JesperMartinsson)\
**Post date:** [May 8, 2020, 9:12am UTC](https://discourse.julialang.org/t/how-to-run-specific-testsets-in-a-test-script/38944/3 "2020-05-08T09:12:14Z")

</div>

Thank you very much, just what I needed!
