test_root.h.ftl 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. [#ftl]
  2. [#--
  3. ChibiOS/RT - Copyright (C) 2006..2018 Giovanni Di Sirio
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. --]
  14. [#import "/@ftllibs/libutils.ftl" as utils /]
  15. [#list xml.*.application.instances.instance as inst]
  16. [#if inst.@id?string == "org.chibios.spc5.components.portable.chibios_unitary_tests_engine"]
  17. [#assign instance = inst /]
  18. [#break]
  19. [/#if]
  20. [/#list]
  21. [#assign conf = {"instance":instance} /]
  22. [#assign prefix_lower = conf.instance.global_data_and_code.code_prefix.value[0]?trim?lower_case /]
  23. [#assign prefix_upper = conf.instance.global_data_and_code.code_prefix.value[0]?trim?upper_case /]
  24. [@pp.dropOutputFile /]
  25. [@pp.changeOutputFile name=prefix_lower+"test_root.h" /]
  26. [@utils.EmitIndentedCCode "" 2 conf.instance.description.copyright.value[0] /]
  27. /**
  28. * @file ${prefix_lower}test_root.h
  29. * @brief Test Suite root structures header.
  30. */
  31. #ifndef ${prefix_upper}TEST_ROOT_H
  32. #define ${prefix_upper}TEST_ROOT_H
  33. #include "ch_test.h"
  34. [#list conf.instance.sequences.sequence as sequence]
  35. #include "${prefix_lower}test_sequence_${(sequence_index + 1)?string("000")}.h"
  36. [/#list]
  37. #if !defined(__DOXYGEN__)
  38. /*===========================================================================*/
  39. /* External declarations. */
  40. /*===========================================================================*/
  41. extern const testsuite_t ${prefix_lower}test_suite;
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. /*===========================================================================*/
  49. /* Shared definitions. */
  50. /*===========================================================================*/
  51. [#if conf.instance.global_data_and_code.global_definitions.value[0]?trim?length > 0]
  52. [@utils.EmitIndentedCCode "" 2 conf.instance.global_data_and_code.global_definitions.value[0] /]
  53. [/#if]
  54. #endif /* !defined(__DOXYGEN__) */
  55. #endif /* ${prefix_upper}TEST_ROOT_H */