mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 22:46:21 +00:00
fix(tests): update functional tests to use regex assertions and increase timeout for expect operations
This commit is contained in:
@@ -297,13 +297,16 @@ tests_unittests_unittests_LDADD = -lcmocka
|
|||||||
#
|
#
|
||||||
# Note: Debian/Ubuntu's libexpect requires -ltcl8.6 for linkage.
|
# Note: Debian/Ubuntu's libexpect requires -ltcl8.6 for linkage.
|
||||||
|
|
||||||
|
if HAVE_STABBER
|
||||||
|
if HAVE_EXPECT
|
||||||
TESTS += tests/functionaltests/functionaltests
|
TESTS += tests/functionaltests/functionaltests
|
||||||
check_PROGRAMS += tests/functionaltests/functionaltests
|
check_PROGRAMS += tests/functionaltests/functionaltests
|
||||||
tests_functionaltests_functionaltests_SOURCES = $(functionaltest_sources)
|
tests_functionaltests_functionaltests_SOURCES = $(functionaltest_sources)
|
||||||
tests_functionaltests_functionaltests_CPPFLAGS = -Itests/
|
tests_functionaltests_functionaltests_CPPFLAGS = -Itests/
|
||||||
tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS) -I/usr/include/tcl8.6 -I/usr/include/tcl8.5
|
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
|
tests_functionaltests_functionaltests_LDADD = -lcmocka -lstabber -lexpect -ltcl8.6
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
man1_MANS = $(man1_sources)
|
man1_MANS = $(man1_sources)
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,9 @@ _cleanup_dirs(void)
|
|||||||
void
|
void
|
||||||
prof_start(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
|
// helper script sets terminal columns, avoids assertions failing
|
||||||
// based on the test runner terminal size
|
// based on the test runner terminal size
|
||||||
fd = exp_spawnl("sh",
|
fd = exp_spawnl("sh",
|
||||||
@@ -169,36 +172,36 @@ init_prof_test(void **state)
|
|||||||
_create_logs_dir();
|
_create_logs_dir();
|
||||||
|
|
||||||
prof_start();
|
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
|
// set UI options to make expect assertions faster and more reliable
|
||||||
prof_input("/inpblock timeout 5");
|
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");
|
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");
|
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");
|
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");
|
prof_input("/wrap off");
|
||||||
assert_true(prof_output_exact("Word wrap disabled"));
|
assert_true(prof_output_regex("Word wrap disabled"));
|
||||||
prof_input("/roster hide");
|
prof_input("/roster hide");
|
||||||
assert_true(prof_output_exact("Roster disabled"));
|
assert_true(prof_output_regex("Roster disabled"));
|
||||||
prof_input("/occupants default hide");
|
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");
|
||||||
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");
|
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");
|
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");
|
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");
|
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");
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user