Initial commit of the unit testing framework
This commit is contained in:
parent
76ef814847
commit
b2c27b7eb0
|
@ -124,7 +124,8 @@ void canCommand()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Q': // send code version
|
case 'Q': // send code version
|
||||||
for (unsigned int revn = 0; revn < sizeof( TSfirmwareVersion) - 1; revn++)
|
//for (unsigned int revn = 0; revn < sizeof( TSfirmwareVersion) - 1; revn++)
|
||||||
|
for (unsigned int revn = 0; revn < 10 - 1; revn++)
|
||||||
{
|
{
|
||||||
CANSerial.write( TSfirmwareVersion[revn]);
|
CANSerial.write( TSfirmwareVersion[revn]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,8 @@ void sendPageASCII();
|
||||||
void receiveCalibration(byte);
|
void receiveCalibration(byte);
|
||||||
void sendToothLog();
|
void sendToothLog();
|
||||||
void testComm();
|
void testComm();
|
||||||
void commandButtons();
|
void commandButtons(int16_t);
|
||||||
|
void sendCompositeLog();
|
||||||
byte getPageValue(byte, uint16_t);
|
byte getPageValue(byte, uint16_t);
|
||||||
|
|
||||||
#endif // COMMS_H
|
#endif // COMMS_H
|
||||||
|
|
|
@ -93,6 +93,7 @@ void triggerSec_Miata9905();
|
||||||
uint16_t getRPM_Miata9905();
|
uint16_t getRPM_Miata9905();
|
||||||
int getCrankAngle_Miata9905();
|
int getCrankAngle_Miata9905();
|
||||||
void triggerSetEndTeeth_Miata9905();
|
void triggerSetEndTeeth_Miata9905();
|
||||||
|
int getCamAngle_Miata9905();
|
||||||
|
|
||||||
void triggerSetup_MazdaAU();
|
void triggerSetup_MazdaAU();
|
||||||
void triggerPri_MazdaAU();
|
void triggerPri_MazdaAU();
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
#include <globals.h>
|
||||||
|
#include <init.h>
|
||||||
|
#include <unity.h>
|
||||||
|
#include "tests_init.h"
|
||||||
|
|
||||||
|
|
||||||
|
void testInitialisation()
|
||||||
|
{
|
||||||
|
RUN_TEST(test_initialisation_complete);
|
||||||
|
RUN_TEST(test_initialisation_ports);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_initialisation_complete(void)
|
||||||
|
{
|
||||||
|
initialiseAll(); //Run the main initialise function
|
||||||
|
TEST_ASSERT_EQUAL(true, initialisationComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_initialisation_ports(void)
|
||||||
|
{
|
||||||
|
initialiseAll(); //Run the main initialise function
|
||||||
|
TEST_ASSERT_NOT_EQUAL(0, inj1_pin_port);
|
||||||
|
TEST_ASSERT_NOT_EQUAL(0, inj2_pin_port);
|
||||||
|
TEST_ASSERT_NOT_EQUAL(0, inj3_pin_port);
|
||||||
|
TEST_ASSERT_NOT_EQUAL(0, inj4_pin_port);
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
void testInitialisation();
|
||||||
|
void test_initialisation_complete(void);
|
||||||
|
void test_initialisation_ports(void);
|
|
@ -0,0 +1,26 @@
|
||||||
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include "tests_init.h"
|
||||||
|
#include <unity.h>
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
// NOTE!!! Wait for >2 secs
|
||||||
|
// if board doesn't support software reset via Serial.DTR/RTS
|
||||||
|
delay(2000);
|
||||||
|
|
||||||
|
UNITY_BEGIN(); // IMPORTANT LINE!
|
||||||
|
|
||||||
|
pinMode(LED_BUILTIN, OUTPUT);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t i = 0;
|
||||||
|
uint8_t max_blinks = 5;
|
||||||
|
|
||||||
|
void loop()
|
||||||
|
{
|
||||||
|
testInitialisation();
|
||||||
|
|
||||||
|
UNITY_END(); // stop unit testing
|
||||||
|
}
|
Loading…
Reference in New Issue