# Using test/Project.toml

**URL:** https://discourse.julialang.org/t/using-test-project-toml/31406
**Category:** New to Julia
**Created:** [November 23, 2019, 1:28am UTC](https://discourse.julialang.org/t/using-test-project-toml/31406 "2019-11-23T01:28:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![venuur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/venuur/32/6493_2.png) [@venuur](https://discourse.julialang.org/u/venuur)
#### Post date: [November 23, 2019, 1:28am UTC](https://discourse.julialang.org/t/using-test-project-toml/31406/1 "2019-11-23T01:28:42Z")

</div>

Following the instructions from [Pkg docs](https://julialang.github.io/Pkg.jl/v1/creating-packages/), I ran the following commands to add two dependecies that I only need for tests:

```julia
Starting Julia...
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.2.0 (2019-08-20)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(v1.2) pkg> activate ./test

(test) pkg> add Test DataStructures
  Updating registry at `C:\Users\carlm\.juliapro\JuliaPro_v1.2.0-1\registries\JuliaPro`
  Updating git-repo `https://pkg.juliacomputing.com//registry/JuliaPro`
 Resolving package versions...
  Updating `C:\Users\carlm\workspace\montecarlo\MC\test\Project.toml`
 [no changes]
  Updating `C:\Users\carlm\workspace\montecarlo\MC\test\Manifest.toml`
 [no changes]

(test) pkg> activate .

(MC) pkg> test
   Testing MC
ERROR: target `test` has unlisted dependency `Test`

```

My `Project.toml` and `test/Project.toml` are as follows:

Project.toml

```julia
name = "MC"
uuid = "769ab3d0-0d7b-11ea-0685-592be65fdeeb"
authors = ["Carl Morris"]
version = "0.1.0"

[compat]
julia = "1"

[targets]
test = ["Test"]

```

test/Project.toml

```julia
[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

```

I create my project using `PkgTemplates` in case that’s relevant. Any pointer to where I went wrong?

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [November 23, 2019, 1:36am UTC](https://discourse.julialang.org/t/using-test-project-toml/31406/2 "2019-11-23T01:36:45Z")

</div>

```julia
[extras]
Test = #UUID here

```

---

<div class="post-metadata">

### Author: ![venuur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/venuur/32/6493_2.png) [@venuur](https://discourse.julialang.org/u/venuur)
#### Post date: [November 23, 2019, 1:51am UTC](https://discourse.julialang.org/t/using-test-project-toml/31406/3 "2019-11-23T01:51:29Z")

</div>

But the documents say

> To add a test-specific dependency, i.e. a dependency that is available only when testing, it is thus enough to add this dependency to the `test/Project.toml` project.

So the extras line is still needed even in 1.2?

---

<div class="post-metadata">

### Author: ![peterlane](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@peterlane](https://discourse.julialang.org/u/peterlane)
#### Post date: [November 23, 2019, 11:22am UTC](https://discourse.julialang.org/t/using-test-project-toml/31406/4 "2019-11-23T11:22:58Z")

</div>

I’m still relatively new to this myself, but looking at the documentation, I thought the use of test/Project.toml was for setting the dependencies for Julia 1.2, and the [targets] lines in the project’s Project.toml were for Julia 1.0?

I followed the Julia 1.2 instructions for my project, and there are no [targets] in my project Project.toml. The test/Project.toml was generated like you showed in your original post.

---

<div class="post-metadata">

### Author: ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)
#### Post date: [November 23, 2019, 8:22pm UTC](https://discourse.julialang.org/t/using-test-project-toml/31406/5 "2019-11-23T20:22:20Z")

</div>

You are mixing up both formats, so Pkg is using the “targets” based testing. Remove this section:

```julia
[targets]
test = ["Test"]

```

and Pkg will look for `test/Project.toml` instead.
