1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-18 19:41:01 -05:00

Run test_lineedit and test_terminal in the main build.

These seem likely to carry on being useful, so let's make sure they
pass before allowing any build to complete successfully. I've added
code to both test programs to return a sensible exit status indicating
pass/fail, and added runs of both to Buildscr.
This commit is contained in:
Simon Tatham
2023-03-05 10:21:16 +00:00
parent ed5bf9b3b8
commit 259de04636
3 changed files with 29 additions and 2 deletions

View File

@ -34,6 +34,8 @@ typedef struct Mock {
strbuf *context;
bool any_test_failed;
TermWin tw;
} Mock;
@ -118,6 +120,7 @@ static void report_fail(Mock *mk, const char *file, int line,
vprintf(fmt, ap);
va_end(ap);
printf("\n");
mk->any_test_failed = true;
}
static inline void check_iequal(Mock *mk, const char *file, int line,
@ -492,6 +495,14 @@ int main(void)
test_wrap(mk);
test_nonwrap(mk);
bool failed = mk->any_test_failed;
mock_free(mk);
return 0;
if (failed) {
printf("Test suite FAILED!\n");
return 1;
} else {
printf("Test suite passed\n");
return 0;
}
}