add tests
authorLaurent MAZET <laurent.mazet@thalesgroup.com>
Thu, 2 May 2024 15:30:17 +0000 (17:30 +0200)
committerLaurent MAZET <laurent.mazet@thalesgroup.com>
Thu, 2 May 2024 15:30:17 +0000 (17:30 +0200)
cmd.c
cmore.c

diff --git a/cmd.c b/cmd.c
index 06a3b2a325dbcff742c2b42e9ef970da17e4c106..11238c3c6cfc716f63680cf3c4ca132045097c90 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -35,6 +35,7 @@ char *exec_cmd (char *cmd)
     }
 
     if (status == -1) {
+        VERBOSE (ERROR, fprintf (stderr, "can't exec command: %s\n", cmd));
         free (buffer);
         buffer = NULL;
     }
@@ -55,6 +56,7 @@ char *load_file (char *name)
     }
 
     if (status == -1) {
+        VERBOSE (ERROR, fprintf (stderr, "can't load file: %s\n", name));
         free (buffer);
         buffer = NULL;
     }
diff --git a/cmore.c b/cmore.c
index 89054e1a20b3a8f1f53a9ebffc8ee09c13f720c8..983e636cdea03be4dd802b87c8ae7d8a307712d8 100644 (file)
--- a/cmore.c
+++ b/cmore.c
@@ -225,7 +225,9 @@ int main (int argc, char *argv[])
 
 /* test: cmore.exe -h | grep usage */
 /* test: cmore.exe -c 2>&1 | grep error */
+/* test: cmore.exe -c notAnExistingCommand 2>&1 | grep can\'t */
 /* test: cmore.exe -f 2>&1 | grep error */
+/* test: cmore.exe -f notAnExistingFile 2>&1 | grep can\'t */
 /* test: (sleep 1; echo -n q) | cmore.exe -c 'ip addr' */
 /* test: (sleep 1; echo -ne '\e\e') | cmore.exe -f tui.c */
 /* test: (sleep 1; echo -n kkkkk; sleep 1; echo -n i; sleep 1; echo -n q) | cmore.exe -c 'ip addr' */