Skip to content

Commit

Permalink
Refactored Unit Testing engine to resolve compiler warnings with "-Wp…
Browse files Browse the repository at this point in the history
…edantic" option // Resolve #4671
  • Loading branch information
ivankravets committed Jun 19, 2023
1 parent 4253320 commit a505243
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
~~~~~~~~~~~~~~~~~~
Expand Down
18 changes: 10 additions & 8 deletions platformio/test/runners/unity.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class UnityTestRunner(TestRunnerBase):
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)
Expand Down Expand Up @@ -246,18 +246,20 @@ def generate_unity_extras(self, dst_dir):
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",
)

Expand Down

0 comments on commit a505243

Please sign in to comment.