[tracker: 1/2] tests: Fix libtracker-sparql/tracker-serialize-test on macOS




commit ec22893b818378444a83799d2defd4e99bd8b622
Author: Daniele Nicolodi <daniele grinta net>
Date:   Sat Mar 26 22:13:00 2022 +0100

    tests: Fix libtracker-sparql/tracker-serialize-test on macOS
    
    echo -n is not portable and most notably it is not implemented by the
    bultin echo in the old version of bash used to implement /bin/sh on
    macOS. Use printf to supprtess the newline character.

 tests/libtracker-sparql/tracker-serialize-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/tests/libtracker-sparql/tracker-serialize-test.c 
b/tests/libtracker-sparql/tracker-serialize-test.c
index f33a83b96..7caa21caa 100644
--- a/tests/libtracker-sparql/tracker-serialize-test.c
+++ b/tests/libtracker-sparql/tracker-serialize-test.c
@@ -84,7 +84,7 @@ check_result (GInputStream *istream,
 
        /* compare results with reference output */
        quoted_results = g_shell_quote (output);
-       command_line = g_strdup_printf ("echo -n %s | grep -v -e nrl:modified -e nrl:added | diff -u %s -", 
quoted_results, results_filename);
+       command_line = g_strdup_printf ("printf %%s %s | grep -v -e nrl:modified -e nrl:added | diff -u %s 
-", quoted_results, results_filename);
        quoted_command_line = g_shell_quote (command_line);
        shell = g_strdup_printf ("sh -c %s", quoted_command_line);
        g_spawn_command_line_sync (shell, &diff, NULL, NULL, &error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]