# How to test all sub-packages from the root package?

**URL:** <https://discourse.julialang.org/t/how-to-test-all-sub-packages-from-the-root-package/103498>\
**Category:** General Usage\
**Tags:** question, testing\
**Created:** [September 4, 2023, 9:16am UTC](https://discourse.julialang.org/t/how-to-test-all-sub-packages-from-the-root-package/103498 "2023-09-04T09:16:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thinnerichs](https://avatars.discourse-cdn.com/v4/letter/t/7ab992/32.png) [@thinnerichs](https://discourse.julialang.org/u/thinnerichs)\
**Post date:** [September 4, 2023, 9:16am UTC](https://discourse.julialang.org/t/how-to-test-all-sub-packages-from-the-root-package/103498/1 "2023-09-04T09:16:55Z")

</div>

Hello,

We are currently developing a package with multiple sub-packages, all registered.

I would like to jointly test all sub-packages when running the tests of the main package. However, I cannot find a neat way of doing that. The naive

```julia
using Test
import Pkg

@testset verbose=true "MainPackage" begin
   Pkg.test("SubPackage_1")
   Pkg.test("SubPackage_2")
   Pkg.test("SubPackage_3")
end

```

creates a test environment for every single sub-package, thus creating quite an ugly output.

Is there any better way of approaching this?

Thanks a lot for your help!
