Commit Graph

15 Commits

Author SHA1 Message Date
Matt Harbison
7d8bebd9c1 tests: remove (glob) annotations that were only for '\' matches
# skip-blame because this was mechanically rewritten the following script.  I
ran it on both *.t and *.py, but none of the *.py changes were proper.  All *.t
ones appear to be, and they run without addition failures on both Windows and
Linux.

  import argparse
  import os
  import re

  ap = argparse.ArgumentParser()
  ap.add_argument('path', nargs='+')
  opts = ap.parse_args()

  globre = re.compile(r'^(.*) \(glob\)(.*)$')

  for p in opts.path:
      tmp = p + '.tmp'
      with open(p, 'rb') as src, open(tmp, 'wb') as dst:
          for line in src:
              m = globre.match(line)
              if not m or '$LOCALIP' in line or '*' in line:
                  dst.write(line)
                  continue
              if '?' in line[:-3] or ('?' in line[:-3] and line[-3:] != '(?)'):
                  dst.write(line)
                  continue
              dst.write(m.group(1) + m.group(2) + '\n')
      os.unlink(p)
      os.rename(tmp, p)
2017-12-10 22:50:57 -05:00
Matt Harbison
376884a01f test-tools: conditionalize output instead of tests 2017-07-08 14:21:11 -04:00
Augie Fackler
e5d7bd82c5 cleanup: use $PYTHON to run python in many more tests
Spotted one of these, then wrote a check-code rule that caught them
all. It will be the next change.
2017-06-20 09:45:02 -04:00
Matt Harbison
cbc163de28 tests: make 'f' tool open files in binary mode when hexdumping
On Windows, the various bundle hexdumps were being truncated at the first
occurrence of 0x1a.  The line endings in the sequence generation then needs to
be standardized on LF so that the file is the same for the tool tests.
2015-11-09 12:49:31 -05:00
Matt Harbison
9741c43e48 tests: replace uses of 'seq' with portable 'seq.py' 2015-03-17 21:47:47 -04:00
Matt Mackall
81a40bb2be test-tools: portability tweak 2015-01-25 20:13:54 -06:00
Matt Harbison
29a41ca7e1 test-tools: update for platforms without symlink support after 8b3d80bb3890
The change was triggered by removing the 'baz' hardlink.
2015-01-18 16:38:56 -05:00
Matt Mackall
062f7143b4 test-tools: another vfat fix 2015-01-17 17:59:30 -08:00
Matt Mackall
6a5f375092 test-tools: check for unix permissions for hardlinking 2015-01-17 15:54:03 -08:00
Matt Mackall
a465711f55 tests: more fixes for f 2015-01-17 15:28:56 -08:00
Matt Mackall
733026a365 tests: teach f not to report symlink mode bits
They're not meaningful or portable
2015-01-17 13:53:56 -08:00
Matt Mackall
f958134a57 tests: teach f not to report directory size
It's not meaningful or portable
2015-01-17 13:53:16 -08:00
Matt Mackall
43dd91c6b3 test-tools: fix portability issues 2015-01-17 13:38:17 -08:00
Matt Harbison
07fa08825f tests: conditionalize test-tools.t for Windows support
I still get the following diff on Windows 7 with NTFS.  I'm not sure if it is
expected and we should wildcard the link count, or if something needs to be
fixed.

  @@ -58,7 +58,7 @@

     $ ln bar baz
     $ f bar -n baz -l --hexdump -t --sha1 --lines=9 -B 20
  -  bar: file, links=2, newer than baz, sha1=612ca68d0305c821750a
  +  bar: file, links=0, newer than baz, sha1=612ca68d0305c821750a\r (esc)
     0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
     0010: 39 0a                                           |9.|
2015-01-14 22:40:39 -05:00
Mads Kiilerich
de81c27e94 tests: add 'f' tool for cross platform file operations in the tests
This tool is like the collection of tools found in a unix environment but are
cross platform and stable and suitable for our needs in the test suite.

The main reason it is "needed" now is for hexdump of revision branch cache to
keep an eye on how it changes and make sure the format is stable.

It is a very generic tool that can end up being used a lot in tests, so I gave
it very generic name.
2015-01-14 01:15:26 +01:00