fix(tests): update functional tests to use regex assertions and increase timeout for expect operations
Some checks failed
CI Code / Check spelling (pull_request) Successful in 27s
CI Code / Check coding style (pull_request) Successful in 33s
CI Code / Linux (ubuntu) (pull_request) Failing after 3m37s
CI Code / Linux (debian) (pull_request) Failing after 9m30s
CI Code / Linux (arch) (pull_request) Successful in 13m27s

This commit is contained in:
2025-12-21 13:53:02 +03:00
parent ecf78b26fd
commit b4dd64a0c9
2 changed files with 21 additions and 15 deletions

View File

@@ -297,13 +297,16 @@ tests_unittests_unittests_LDADD = -lcmocka
#
# Note: Debian/Ubuntu's libexpect requires -ltcl8.6 for linkage.
if HAVE_STABBER
if HAVE_EXPECT
TESTS += tests/functionaltests/functionaltests
check_PROGRAMS += tests/functionaltests/functionaltests
tests_functionaltests_functionaltests_SOURCES = $(functionaltest_sources)
tests_functionaltests_functionaltests_CPPFLAGS = -Itests/
tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS) -I/usr/include/tcl8.6 -I/usr/include/tcl8.5
tests_functionaltests_functionaltests_LDADD = -lcmocka -lstabber -lexpect -ltcl8.6
endif
endif
man1_MANS = $(man1_sources)

View File

@@ -122,6 +122,9 @@ _cleanup_dirs(void)
void
prof_start(void)
{
// Set timeout for expect operations (default is too short for CI)
exp_timeout = 30;
// helper script sets terminal columns, avoids assertions failing
// based on the test runner terminal size
fd = exp_spawnl("sh",
@@ -169,36 +172,36 @@ init_prof_test(void **state)
_create_logs_dir();
prof_start();
assert_true(prof_output_exact("CProof. Type /help for help information."));
assert_true(prof_output_regex("CProof\\. Type /help for help information\\."));
// set UI options to make expect assertions faster and more reliable
prof_input("/inpblock timeout 5");
assert_true(prof_output_exact("Input blocking set to 5 milliseconds"));
assert_true(prof_output_regex("Input blocking set to 5 milliseconds"));
prof_input("/inpblock dynamic off");
assert_true(prof_output_exact("Dynamic input blocking disabled"));
assert_true(prof_output_regex("Dynamic input blocking disabled"));
prof_input("/notify chat off");
assert_true(prof_output_exact("Chat notifications disabled"));
assert_true(prof_output_regex("Chat notifications disabled"));
prof_input("/notify room off");
assert_true(prof_output_exact("Room notifications disabled"));
assert_true(prof_output_regex("Room notifications disabled"));
prof_input("/wrap off");
assert_true(prof_output_exact("Word wrap disabled"));
assert_true(prof_output_regex("Word wrap disabled"));
prof_input("/roster hide");
assert_true(prof_output_exact("Roster disabled"));
assert_true(prof_output_regex("Roster disabled"));
prof_input("/occupants default hide");
assert_true(prof_output_exact("Occupant list disabled"));
assert_true(prof_output_regex("Occupant list disabled"));
prof_input("/time console off");
prof_input("/time console off");
assert_true(prof_output_exact("Console time display disabled."));
assert_true(prof_output_regex("Console time display disabled\\."));
prof_input("/time chat off");
assert_true(prof_output_exact("Chat time display disabled."));
assert_true(prof_output_regex("Chat time display disabled\\."));
prof_input("/time muc off");
assert_true(prof_output_exact("MUC time display disabled."));
assert_true(prof_output_regex("MUC time display disabled\\."));
prof_input("/time config off");
assert_true(prof_output_exact("Config time display disabled."));
assert_true(prof_output_regex("Config time display disabled\\."));
prof_input("/time private off");
assert_true(prof_output_exact("Private chat time display disabled."));
assert_true(prof_output_regex("Private chat time display disabled\\."));
prof_input("/time xml off");
assert_true(prof_output_exact("XML Console time display disabled."));
assert_true(prof_output_regex("XML Console time display disabled\\."));
return 0;
}