Starting test-driven development (TDD) with Unity
- Using PlatformIO's embedded unit testing with native environment - mbed-dependent .cpp files escaped with #ifndef UNIT_TEST - First tests for charger module added under test/ directory
This commit is contained in:
+7
-3
@@ -1,5 +1,5 @@
|
||||
/* LibreSolar MPPT charge controller firmware
|
||||
* Copyright (c) 2016-2018 Martin Jäger (www.libre.solar)
|
||||
/* LibreSolar charge controller firmware
|
||||
* Copyright (c) 2016-2019 Martin Jäger (www.libre.solar)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef UNIT_TEST
|
||||
|
||||
#include "pwm_switch.h"
|
||||
#include "config.h"
|
||||
#include "pcb.h"
|
||||
@@ -179,4 +181,6 @@ void pwm_switch_init(pwm_switch_t *pwm_switch) {}
|
||||
void pwm_switch_control(pwm_switch_t *pwm_switch, power_port_t *solar_port, power_port_t *bat_port) {}
|
||||
void pwm_switch_duty_cycle_step(int delta) {}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* UNIT_TEST */
|
||||
|
||||
Reference in New Issue
Block a user