# Testing using pre-existing input files

**URL:** <https://discourse.julialang.org/t/testing-using-pre-existing-input-files/19822>\
**Category:** General Usage\
**Tags:** package\
**Created:** [January 19, 2019, 4:53pm UTC](https://discourse.julialang.org/t/testing-using-pre-existing-input-files/19822 "2019-01-19T16:53:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 19, 2019, 4:53pm UTC](https://discourse.julialang.org/t/testing-using-pre-existing-input-files/19822/1 "2019-01-19T16:53:54Z")

</div>

I wonder what the “standard” approach might be to the following problem:

A package has tests which refer to pre-existing input files in the `package/test` folder. When the package is tested within a different folder, the input files would not be found when the tests are run unless they were referred to with a full relative or absolute path. How would that be done?

---

<div class="post-metadata">

**Author:** ![sostock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sostock/32/5546_2.png) [@sostock](https://discourse.julialang.org/u/sostock)\
**Post date:** [January 19, 2019, 5:21pm UTC](https://discourse.julialang.org/t/testing-using-pre-existing-input-files/19822/2 "2019-01-19T17:21:38Z")

</div>

Use `@ __DIR__ ` in the code to get the directory containing the source code file:

```julia
path_to_inputfile = joinpath(@ __DIR__ , "input.txt")

```
