Skip to content

[Fix] Export CPP Tests

Axel Farrugia requested to merge fix_export_kernels_to_copy into dev

Context

This MR broke the Export CPP tests (and probably other exports too).

This was caused by the changes made on the kernels_to_copy variable within the ExportNodeCPP class (node_export.py).
This variable used to be a list of strings holding the source paths of all the needed kernels files for a given export node.
These files would then be copied into the export then automatically included into the generated forward.cpp file.

However it is quite limited as the destination path is not configurable and some files do need to be copied into the export without being included into the forward.cpp file.

The new approach changes the type of the kernels_to_copy variable from a list of string to a list of dict holding :

  • The source path;
  • The destination path (kernels_path by default);
  • A boolean to indicate wether the file should be included in the forward or not (True by default).

It also provides a function to simplify the process of adding implementation files : add_kernel_to_copy().

The tests broke because of this type change.

Also, the generate_main() function were not behaving the same way as they were storing the input data wether in the ROOT folder or in a data folder. This as been changed for the inputs to always be stored in a data folder.

Modified files

In order to solve the type compatibity issue and to wait for the various exports to implement the change without breaking, a deprecation function has been introduced.
It basically checks the type of the kernels_to_copy variable and update it so that it matches the new approach, displaying a deprecation warning in the process.

  • node_export.py : Deprecation function;
  • main_generation.py : Input storage normalization.
Edited by Axel Farrugia

Merge request reports

Loading