# Test running (especially in Debug mode)

**URL:** <https://forum.cadet-web.de/t/test-running-especially-in-debug-mode/885>\
**Category:** Programming Diary\
**Tags:** development, guide\
**Created:** [February 26, 2024, 9:28am UTC](https://forum.cadet-web.de/t/test-running-especially-in-debug-mode/885 "2024-02-26T09:28:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronald.jaepel](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/ronald.jaepel/32/986_2.png) [@ronald.jaepel](https://forum.cadet-web.de/u/ronald.jaepel)\
**Post date:** [February 26, 2024, 9:28am UTC](https://forum.cadet-web.de/t/test-running-especially-in-debug-mode/885/1 "2024-02-26T09:28:36Z")

</div>

If you want to run tests in CADET-Core you need to ensure that in the `CMakeSettings.json` file:

1. the “cmakeCommandArgs” contain:
  1. `-DENABLE_TESTS=ON` to enable building the test runner
  2. `-DENABLE_STATIC_LINK_LAPACK=ON -DENABLE_STATIC_LINK_DEPS=ON` to create statically linked dependencies

2. `"variables"` contains:

```auto
  {
    "name": "HDF5_USE_STATIC_LIBRARIES",
    "value": "1",
    "type": "STRING"
  },
  {
    "name": "BUILD_SHARED_LIBS",
    "value": "0",
    "type": "STRING"
  },

```

Then you can find the testRunner(.exe) in `CADET-root/build/test/Debug` or `CADET-root/build/test/Release`

---

<div class="post-metadata">

**Author:** ![ronald.jaepel](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/ronald.jaepel/32/986_2.png) [@ronald.jaepel](https://forum.cadet-web.de/u/ronald.jaepel)\
**Post date:** [March 11, 2024, 3:34pm UTC](https://forum.cadet-web.de/t/test-running-especially-in-debug-mode/885/2 "2024-03-11T15:34:30Z")

</div>

If the breakpoints aren’t catching:

check the files in `build\src\libcadet` and place breakpoints in those.

---

<div class="post-metadata">

**Author:** ![ortler](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/o/54ee81/32.png) [@ortler](https://forum.cadet-web.de/u/ortler)\
**Post date:** [April 22, 2024, 11:37am UTC](https://forum.cadet-web.de/t/test-running-especially-in-debug-mode/885/3 "2024-04-22T11:37:27Z")

</div>

Hey @ronald.jaepel ,

could you please elaborate on how you would debug Cadet-Core?

After the code-adjustments in your first post,  
do you run certain Cadet test-files in the command line, or python, or do you eg. use Cadet-Process?  
Are there log-files?

A rough step-by-step guide for us C++ newbies would be great!

---

<div class="post-metadata">

**Author:** ![ronald.jaepel](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/ronald.jaepel/32/986_2.png) [@ronald.jaepel](https://forum.cadet-web.de/u/ronald.jaepel)\
**Post date:** [April 22, 2024, 12:50pm UTC](https://forum.cadet-web.de/t/test-running-especially-in-debug-mode/885/4 "2024-04-22T12:50:35Z")

</div>

I’ve turned this into a post [here](https://forum.cadet-web.de/t/how-to-debug-cadet-on-windows-with-visual-studio/933)

---

<div class="post-metadata">

**Author:** ![ortler](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/o/54ee81/32.png) [@ortler](https://forum.cadet-web.de/u/ortler)\
**Post date:** [April 26, 2024, 11:55am UTC](https://forum.cadet-web.de/t/test-running-especially-in-debug-mode/885/5 "2024-04-26T11:55:05Z")

</div>

Hey @ronald.jaepel,

thank you for creating the step-by-step guide. This helped a lot!

You could add the creation of the h5 file using CADET-Process, eg.

```auto
from CADETProcess.simulator import Cadet
from CADETProcess import settings
from examples.batch_elution.process import process

simulator = Cadet()
simulator.install_path = "C:\\ProgramData\\Anaconda3\\envs\\cadet\\"
settings.working_directory = 'D:/workDir/cadet'

import os
full_path = os.path.join(settings.working_directory, 'ExampleProcessDebugFile.h5')
simulator.save_to_h5(process, full_path)

```
