# Any way to test .wrap files without compiling?

**URL:** https://discourse.itk.org/t/any-way-to-test-wrap-files-without-compiling/1841
**Category:** Engineering
**Created:** [May 6, 2019, 11:49am UTC](https://discourse.itk.org/t/any-way-to-test-wrap-files-without-compiling/1841 "2019-05-06T11:49:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ujhik](https://discourse.itk.org/user_avatar/discourse.itk.org/ujhik/32/703_2.png) [@Ujhik](https://discourse.itk.org/u/Ujhik)
#### Post date: [May 6, 2019, 11:49am UTC](https://discourse.itk.org/t/any-way-to-test-wrap-files-without-compiling/1841/1 "2019-05-06T11:49:13Z")

</div>

Compiling is a lot of time even compiling only the modified module, so detecting an error in a .wrap file when trying to change python wrappers is a pain.

Is there any way to test .wrap files without compiling?  
If not, any way to detecting the error faster?

---

<div class="post-metadata">

### Author: ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)
#### Post date: [May 6, 2019, 12:33pm UTC](https://discourse.itk.org/t/any-way-to-test-wrap-files-without-compiling/1841/2 "2019-05-06T12:33:22Z")

</div>

Hi,

There is not way to fully test the wrap file without compiling it. It would be great to have such a mechanism, but it needs to be implemented. One thing you can do though is to try to debug it without the compilation being fully done.

1. Add `message()` statements in the file to see at configuration time if the filter types expand to what you expect.
2. Find the `cxx` file(s) corresponding to your filter(s) in the build directory. The files that are generated are created in the `Wrapping` subfolder. Looking at this file will allow you to see if you are wrapping the types you expect.

Hope this helps,  
Francois  
2)

---

<div class="post-metadata">

### Author: ![Ujhik](https://discourse.itk.org/user_avatar/discourse.itk.org/ujhik/32/703_2.png) [@Ujhik](https://discourse.itk.org/u/Ujhik)
#### Post date: [May 6, 2019, 2:15pm UTC](https://discourse.itk.org/t/any-way-to-test-wrap-files-without-compiling/1841/3 "2019-05-06T14:15:02Z")

</div>

Thanks for the tips.

1. message() inside .wrap files is working and really useful. It’s output can be seen when configuring with cmake, so it afford a lot of time.
2. Found the cxx files and it’s really useful to see c++ templates generated for wrapping, detected some errors there too.

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [May 10, 2019, 9:40pm UTC](https://discourse.itk.org/t/any-way-to-test-wrap-files-without-compiling/1841/4 "2019-05-10T21:40:01Z")

</div>

It is helpful to just build a module and its dependencies. There is a makefile target called `<module-name>-all` for all ITK modules. For example:

```auto
make ITKCommon-all

```

or

```auto
ninja ITKCommon-all

```

will just build the tests and wrapping for the `ITKCommon` module.
