mirror of https://github.com/djcb/mu.git
mu-guile: fix guile-test build
upgrade to the new formatting code. Fixes: #2540
This commit is contained in:
parent
b2918e2bea
commit
28b779efb8
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2012-2022 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2012-2023 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** This program is free software; you can redistribute it and/or modify it
|
||||||
** under the terms of the GNU General Public License as published by the
|
** under the terms of the GNU General Public License as published by the
|
||||||
|
@ -38,22 +38,22 @@ static std::string test_dir;
|
||||||
static std::string
|
static std::string
|
||||||
fill_database(void)
|
fill_database(void)
|
||||||
{
|
{
|
||||||
const auto cmdline = format(
|
const auto cmdline = mu_format(
|
||||||
"/bin/sh -c '"
|
"/bin/sh -c '"
|
||||||
"%s init --muhome=%s --maildir=%s --quiet; "
|
"{} init --muhome={} --maildir={} --quiet; "
|
||||||
"%s index --muhome=%s --quiet'",
|
"{} index --muhome={} --quiet'",
|
||||||
MU_PROGRAM,
|
MU_PROGRAM,
|
||||||
test_dir.c_str(),
|
test_dir,
|
||||||
MU_TESTMAILDIR2,
|
MU_TESTMAILDIR2,
|
||||||
MU_PROGRAM,
|
MU_PROGRAM,
|
||||||
test_dir.c_str());
|
test_dir);
|
||||||
|
|
||||||
if (g_test_verbose())
|
if (g_test_verbose())
|
||||||
g_print("%s\n", cmdline.c_str());
|
mu_println("{}", cmdline);
|
||||||
|
|
||||||
GError *err{};
|
GError *err{};
|
||||||
if (!g_spawn_command_line_sync(cmdline.c_str(), NULL, NULL, NULL, &err)) {
|
if (!g_spawn_command_line_sync(cmdline.c_str(), NULL, NULL, NULL, &err)) {
|
||||||
g_printerr("Error: %s\n", err ? err->message : "?");
|
mu_printerrln("Error: {}", err ? err->message : "?");
|
||||||
g_clear_error(&err);
|
g_clear_error(&err);
|
||||||
g_assert(0);
|
g_assert(0);
|
||||||
}
|
}
|
||||||
|
@ -72,20 +72,19 @@ test_something(const char* what)
|
||||||
g_print("GUILE_LOAD_PATH: %s\n", GUILE_LOAD_PATH);
|
g_print("GUILE_LOAD_PATH: %s\n", GUILE_LOAD_PATH);
|
||||||
|
|
||||||
const auto dir = fill_database();
|
const auto dir = fill_database();
|
||||||
const auto cmdline = format("%s -q -e main %s/test-mu-guile.scm "
|
const auto cmdline = mu_format("{} -q -e main {}/test-mu-guile.scm "
|
||||||
"--muhome=%s --test=%s",
|
"--muhome={} --test={}",
|
||||||
GUILE_BINARY,
|
GUILE_BINARY, ABS_SRCDIR,
|
||||||
ABS_SRCDIR,
|
dir, what);
|
||||||
dir.c_str(), what);
|
|
||||||
|
|
||||||
if (g_test_verbose())
|
if (g_test_verbose())
|
||||||
g_print("cmdline: %s\n", cmdline.c_str());
|
mu_println("cmdline: {}", cmdline);
|
||||||
|
|
||||||
GError *err{};
|
GError *err{};
|
||||||
int status{};
|
int status{};
|
||||||
if (!g_spawn_command_line_sync(cmdline.c_str(), NULL, NULL, &status, &err) ||
|
if (!g_spawn_command_line_sync(cmdline.c_str(), NULL, NULL, &status, &err) ||
|
||||||
status != 0) {
|
status != 0) {
|
||||||
g_printerr("Error: %s\n", err ? err->message : "something went wrong");
|
mu_printerrln("Error: {}", err ? err->message : "something went wrong");
|
||||||
g_clear_error(&err);
|
g_clear_error(&err);
|
||||||
g_assert(0);
|
g_assert(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue