From 3c83c52c707b8a60a75f710eb01eeff317055934 Mon Sep 17 00:00:00 2001 From: Johan Holmberg Date: Fri, 4 Nov 2016 22:26:05 +0100 Subject: [PATCH] --diff by default, new --no-diff option --- bin/cmdtest.rb | 12 +++++++++++- t/selftest_utils.rb | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/cmdtest.rb b/bin/cmdtest.rb index 05e2155..853568c 100755 --- a/bin/cmdtest.rb +++ b/bin/cmdtest.rb @@ -597,7 +597,8 @@ module Cmdtest pr.add("", "--version", "show version") pr.add("-q", "--quiet", "be more quiet") pr.add("-v", "--verbose", "be more verbose") - pr.add("", "--diff", "experimental diff output") + pr.add("", "--diff", "diff output (default)") + pr.add("", "--no-diff", "old non-diff output") pr.add("", "--fast", "run fast without waiting for unique mtime:s") pr.add("-j", "--parallel", "build in parallel", type: Integer, default: 1, metavar: "N") pr.add("", "--test", "only run named test", type: [String]) @@ -609,6 +610,15 @@ module Cmdtest pr.addpos("arg", "testfile or pattern", nargs: 0..999) opts = pr.parse_args(ARGV, patterns: [], ruby_s: Util.windows?) + + # default '--diff', reversed by --no-diff + if opts.diff and opts.no_diff + puts "ERROR: both --diff and --no-diff specified" + exit(1) + elsif ! opts.no_diff + opts.diff = true + end + if opts.help pr.print_usage() exit(0) diff --git a/t/selftest_utils.rb b/t/selftest_utils.rb index aaedce6..4fb9e9e 100644 --- a/t/selftest_utils.rb +++ b/t/selftest_utils.rb @@ -43,7 +43,7 @@ module SelftestUtils def cmd_cmdtest(*args) cmdtest = "#{TOP}/bin/cmdtest.rb" - command = "ruby %s --quiet" % _quote(cmdtest) + command = "ruby %s --quiet --no-diff" % _quote(cmdtest) cmd(command, *args) do comment "running local cmdtest" yield