test: Use -t=auto to generate some screenshots, detect -t=auto failure more reliably, exercise setting the initial profile, and fix various bugs that fell out.

This commit is contained in:
2024-11-25 09:35:55 -05:00
parent 6e83c08535
commit eb12ba6ed2
7 changed files with 65 additions and 14 deletions

View File

@ -642,7 +642,7 @@ static void _tf_ssb_getActiveIdentity_visit(const char* identity, void* user_dat
active_identity_work_t* request = user_data;
if (!*request->identity)
{
snprintf(request->identity, sizeof(request->identity), "%s", identity);
snprintf(request->identity, sizeof(request->identity), "@%s", identity);
}
}
@ -657,6 +657,11 @@ static void _tf_ssb_getActiveIdentity_work(tf_ssb_t* ssb, void* user_data)
{
tf_ssb_db_identity_visit(ssb, request->name, _tf_ssb_getActiveIdentity_visit, request);
}
if (!*request->identity && tf_ssb_db_user_has_permission(ssb, request->name, "administration"))
{
tf_ssb_whoami(ssb, request->identity, sizeof(request->identity));
}
}
static void _tf_ssb_getActiveIdentity_after_work(tf_ssb_t* ssb, int status, void* user_data)

View File

@ -329,7 +329,7 @@ static void _taskstub_on_process_exit(uv_process_t* process, int64_t status, int
if (!JS_IsUndefined(stub->_on_exit))
{
JSValue ref = JS_DupValue(context, stub->_on_exit);
JSValue argv[] = { JS_NewInt32(context, status), JS_NewInt32(context, terminationSignal) };
JSValue argv[] = { JS_NewInt64(context, status), JS_NewInt32(context, terminationSignal) };
JSValue result = JS_Call(context, stub->_on_exit, JS_NULL, 2, argv);
tf_util_report_error(context, result);
JS_FreeValue(context, result);

View File

@ -10,6 +10,7 @@
#include "util.js.h"
#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@ -920,8 +921,8 @@ static void _test_pattern(const tf_test_options_t* options)
static void _test_auto_process_exit(uv_process_t* process, int64_t status, int termination_signal)
{
tf_printf("Process exit %d signal=%d.\n", (int)WEXITSTATUS(status), termination_signal);
assert(WEXITSTATUS(status) == 0);
tf_printf("Process exit %" PRId64 " signal=%d.\n", status, termination_signal);
assert(status == 0);
process->data = NULL;
uv_close((uv_handle_t*)process, NULL);
}
@ -958,6 +959,7 @@ static void _test_auto(const tf_test_options_t* options)
int spawn_result = uv_spawn(&loop, &process, &process_options);
if (spawn_result)
{
tf_printf("uv_spawn: %s\n", uv_strerror(spawn_result));
abort();
}
@ -970,6 +972,7 @@ static void _test_auto(const tf_test_options_t* options)
spawn_result = uv_spawn(&loop, &selenium, &process_options);
if (spawn_result)
{
tf_printf("uv_spawn: %s\n", uv_strerror(spawn_result));
abort();
}