info-cleanup: Add test for info-cleanup

To make it easier to see whether our changes had the intended effect.
This commit is contained in:
Bastien Nocera 2022-12-02 10:45:05 +01:00 committed by Georges Basile Stavracas Neto
parent a9ff350dbf
commit 6b97d27ea3
2 changed files with 26 additions and 0 deletions

View file

@ -52,6 +52,14 @@ print_renderer_deps = [
epoxy_dep
]
executable(
'test-info-cleanup',
[ 'info-cleanup.c', 'test-info-cleanup.c' ],
include_directories: [ top_inc ],
dependencies: [ print_renderer_deps ],
c_args: cflags,
)
executable(
'gnome-control-center-print-renderer',
'gnome-control-center-print-renderer.c',

View file

@ -0,0 +1,18 @@
#include <locale.h>
#include <info-cleanup.h>
int main (int argc, char **argv)
{
g_autofree char *str = NULL;
setlocale (LC_ALL, "");
if (argc != 2) {
g_print ("Usage: %s DEVICE-NAME\n", argv[0]);
return 1;
}
str = info_cleanup (argv[1]);
g_print ("%s ➯ %s\n", argv[1], str);
return 0;
}