Просмотр исходного кода

test: make the patch command silent

The POSIX standard says that the patch command should not use stdout,
but GNU patch writes the message:
patching file patches/healed/xxx.zig (read from exercises/xxx.zig).

Add the -s flag to suppress these messages.

Note that the heal function from test/tests.zig is called when running
`zig build -Dhealed` because it is executed in the configure phase.
Manlio Perillo 2 лет назад
Родитель
Сommit
11d2279f4f
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      test/tests.zig

+ 1 - 1
test/tests.zig

@@ -333,7 +333,7 @@ fn heal(allocator: Allocator, exercises: []const Exercise, outdir: []const u8) !
         };
         };
         const output = try join(allocator, &.{ outdir, ex.main_file });
         const output = try join(allocator, &.{ outdir, ex.main_file });
 
 
-        const argv = &.{ "patch", "-i", patch, "-o", output, file };
+        const argv = &.{ "patch", "-i", patch, "-o", output, "-s", file };
 
 
         var child = std.process.Child.init(argv, allocator);
         var child = std.process.Child.init(argv, allocator);
         _ = try child.spawnAndWait();
         _ = try child.spawnAndWait();