They were disabled in 171b6e73c9.
Enable the functional test suite and replaces the
dependency on libexpect with a custom solution.
The native solution allows for specific optimizations like automatic
ANSI code stripping, which is essential for reliable pattern matching in
an ncurses interface.
Custom PTY management via libutil provides full control over the process
lifecycle, resolving issues where tests would hang indefinitely.
We use forkpty from libutil.
Addiiotnally this commit implements automatic ANSI escape sequence
filtering to improve matching consistency.
This will get rid of the colors in matches. It's still something that we
need to think about more since basically we will not test out
color/theme system this way.
We also add non-blocking poll() and SIGKILL based teardown logic to
ensure clean test termination.
We added the functional tests to both autotools and meson.
They are only build when tests are enabled and stabber + libutil are
present.
Meson will print this out nicely in the summary.
Regards https://github.com/profanity-im/profanity/issues/789
33 lines
730 B
C
33 lines
730 B
C
#ifndef __H_PROFTEST
|
|
#define __H_PROFTEST
|
|
|
|
#define XDG_CONFIG_HOME "./tests/functionaltests/files/xdg_config_home"
|
|
#define XDG_DATA_HOME "./tests/functionaltests/files/xdg_data_home"
|
|
|
|
enum prof_expect_type {
|
|
prof_expect_end = 0,
|
|
prof_expect_exact,
|
|
prof_expect_regexp
|
|
};
|
|
|
|
extern int prof_expect_timeout;
|
|
extern int prof_pid;
|
|
|
|
int init_prof_test(void** state);
|
|
int close_prof_test(void** state);
|
|
|
|
void prof_start(void);
|
|
void prof_connect(void);
|
|
void prof_connect_with_roster(const char* roster);
|
|
void prof_input(const char* input);
|
|
|
|
int prof_output_exact(const char* text);
|
|
int prof_output_regex(const char* text);
|
|
|
|
void prof_timeout(int timeout);
|
|
void prof_timeout_reset(void);
|
|
|
|
int prof_expect(int fd, ...);
|
|
|
|
#endif
|