Refactored Unit Testing engine to resolve compiler warnings with "-Wpedantic" option // Resolve #4671

This commit is contained in:
Ivan Kravets
2023-06-19 16:49:14 +03:00
parent 425332040e
commit a5052433f2
2 changed files with 11 additions and 8 deletions

View File

@ -20,6 +20,7 @@ PlatformIO Core 6
* Enhanced the parsing of the |PIOCONF| to provide comprehensive diagnostic information
* Optimized project integration templates to address the issue of long paths on Windows (`issue #4652 <https://github.com/platformio/platformio-core/issues/4652>`_)
* Refactored |UNITTESTING| engine to resolve compiler warnings with "-Wpedantic" option (`pull #4671 <https://github.com/platformio/platformio-core/pull/4671>`_)
6.1.7 (2023-05-08)
~~~~~~~~~~~~~~~~~~

View File

@ -55,8 +55,8 @@ extern "C"
void unityOutputStart(unsigned long);
void unityOutputChar(unsigned int);
void unityOutputFlush();
void unityOutputComplete();
void unityOutputFlush(void);
void unityOutputComplete(void);
#define UNITY_OUTPUT_START() unityOutputStart((unsigned long) $baudrate)
#define UNITY_OUTPUT_CHAR(c) unityOutputChar(c)
@ -246,18 +246,20 @@ void unityOutputComplete(void) { unittest_uart_end(); }
unity_h = dst_dir / "unity_config.h"
if not unity_h.is_file():
unity_h.write_text(
string.Template(self.UNITY_CONFIG_H).substitute(
baudrate=self.get_test_speed()
),
string.Template(self.UNITY_CONFIG_H)
.substitute(baudrate=self.get_test_speed())
.strip()
+ "\n",
encoding="utf8",
)
framework_config = self.get_unity_framework_config()
unity_c = dst_dir / ("unity_config.%s" % framework_config.get("language", "c"))
if not unity_c.is_file():
unity_c.write_text(
string.Template(self.UNITY_CONFIG_C).substitute(
framework_config_code=framework_config["code"]
),
string.Template(self.UNITY_CONFIG_C)
.substitute(framework_config_code=framework_config["code"])
.strip()
+ "\n",
encoding="utf8",
)