Re: [PATCH 6/6] tests: Add tests for automatic use of pager

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

 



On Sun, Feb 14, 2010 at 06:13:00AM -0600, Jonathan Nieder wrote:

> They does not yet test:
> 
>  - use of pager by scripted commands (git svn and git am);
>  - effect of the pager.* configuration variables;
>  - setting of the LESS variable.
> 
> Some features require stdout to be a terminal to be testable without
> a (not written) shim using pseudo-terminals.  Thus about half of these
> tests are skipped unless $GIT_TEST_OPTS includes --verbose.

I am a little lukewarm on tests that require --verbose, since they will
not be caught by 99% of the runs of the test suite. Which means they
sneak through things like Junio's automated testing of maint, master,
and next.

Still, perhaps something is better than nothing. I wonder if we can do
better, though, with something like:

  int xisatty(int fd)
  {
    static int fake[3];

    if (fd > ARRAY_SIZE(pretend))
      return isatty(fd);

    if (fake[fd] == -1) {
      const char *x = getenv("GIT_PRETEND_TTY");
      if (x && strchr(x, '0' + fd))
        fake[fd] = 1;
      else
        fake[fd] = isatty(fd);
    }
    return fake[fd];
  }

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]