1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-01-24 03:07:03 +00:00
Paul Mackerras c13c73f1ae tests: Adjust header inclusions and Makefile.test
This fixes the decrementer, illegal and sc tests to compile
successfully with cross-compilers that don't provide unistd.h
or string.h.  Instead of those headers we include stddef.h.

This also fixes tests/Makefile.test to do what one expects
when CROSS_COMPILE is defined in the environment.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2020-04-03 13:46:36 +11:00

37 lines
519 B
C

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "console.h"
#define TEST "Test "
#define PASS "PASS\r\n"
#define FAIL "FAIL\r\n"
extern int ill_test_1(void);
// i < 100
void print_test_number(int i)
{
putstr(TEST, strlen(TEST));
putchar(48 + i/10);
putchar(48 + i%10);
putstr(":", 1);
}
int main(void)
{
int fail = 0;
potato_uart_init();
print_test_number(1);
if (ill_test_1() != 0) {
fail = 1;
putstr(FAIL, strlen(FAIL));
} else
putstr(PASS, strlen(PASS));
return fail;
}