mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 14:56:39 +02:00
tests: display an error if the required locale en_US.UTF-8 is not installed
This commit is contained in:
+13
-1
@@ -47,6 +47,8 @@ extern "C"
|
||||
|
||||
#include "CppUTest/CommandLineTestRunner.h"
|
||||
|
||||
#define LOCALE_TESTS "en_US.UTF-8"
|
||||
|
||||
/* import tests from libs */
|
||||
IMPORT_TEST_GROUP(Plugins);
|
||||
IMPORT_TEST_GROUP(Arraylist);
|
||||
@@ -129,9 +131,19 @@ main (int argc, char *argv[])
|
||||
struct t_gui_buffer *ptr_core_buffer;
|
||||
|
||||
/* setup environment: English language, no specific timezone */
|
||||
setenv ("LC_ALL", "en_US.UTF-8", 1);
|
||||
setenv ("LC_ALL", LOCALE_TESTS, 1);
|
||||
setenv ("TZ", "", 1);
|
||||
|
||||
/* check if locale exists */
|
||||
if (!setlocale (LC_ALL, ""))
|
||||
{
|
||||
fprintf (stderr,
|
||||
"ERROR: the locale %s must be installed to run WeeChat "
|
||||
"tests.\n",
|
||||
LOCALE_TESTS);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* build arguments for WeeChat */
|
||||
weechat_tests_args = getenv ("WEECHAT_TESTS_ARGS");
|
||||
length = strlen (argv[0]) +
|
||||
|
||||
Reference in New Issue
Block a user