Newer
Older
lambda-avr / lambda-test / avrjunit.h
/*
 * avrjunit.h
 *
 *  Created on: 06.03.2015
 *      Author: dode@luniks.net
 */

/**
 * A test case with its name and pointer to the test function,
 * which should return true on success and false on failure.
 */
typedef struct {
	char* name;
	uint8_t (*test)(void);
} test;

/**
 * Runs the test cases in the given array and prints the results
 * via USART in JUnit XML format, using the given test suite and
 * test class names. The size of the array needs to be passed
 * along.
 * The printed JUnit XML can be read and written to a file
 * on the receiving side with a command like:
 * (stty sane; cat > tests.xml) < /dev/ttyUSB0
 */
void runTests(char* suite, char* class, test tests[], uint16_t count);