mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-04 13:02:47 -05:00
Move some tests into the test subdirectory.
Now testcrypt has _two_ header files, that's more files than I want at the top level, so I decided to move it. It has a good claim to live in either 'test' or 'crypto', but in the end I decided it wasn't quite specific enough to crypto (it already also tests things in keygen and proxy), and also, the Python half of the mechanism already lives in 'test', so it can live alongside that. Having done that, it seemed silly to leave testsc and testzlib at the top level: those have 'test' in the names as well, so they can go in the test subdir as well. While I'm renaming, also renamed testcrypt.h to testcrypt-func.h to distinguish it from the new testcrypt-enum.h.
This commit is contained in:
@ -313,7 +313,7 @@ def _lex_testcrypt_header(header):
|
||||
while pos < end:
|
||||
m = pat.match(header, pos)
|
||||
assert m is not None, (
|
||||
"Failed to lex testcrypt.h at byte position {:d}".format(pos))
|
||||
"Failed to lex testcrypt-func.h at byte position {:d}".format(pos))
|
||||
|
||||
pos = m.end()
|
||||
tok = m.group(1)
|
||||
@ -339,7 +339,7 @@ def _parse_testcrypt_header(tokens):
|
||||
description = lambda: "'"+what+"' "
|
||||
ok = tok == what
|
||||
if not ok:
|
||||
sys.exit("testcrypt.h:{:d}: expected {}{}".format(
|
||||
sys.exit("testcrypt-func.h:{:d}: expected {}{}".format(
|
||||
pos, description(), why))
|
||||
return tok
|
||||
|
||||
@ -392,7 +392,7 @@ def _setup(scope):
|
||||
arg = arg[:arg.index("_", len(valprefix))]
|
||||
return arg
|
||||
|
||||
with open(os.path.join(putty_srcdir, "testcrypt.h")) as f:
|
||||
with open(os.path.join(putty_srcdir, "test", "testcrypt-func.h")) as f:
|
||||
header = f.read()
|
||||
tokens = _lex_testcrypt_header(header)
|
||||
for function, rettype, arglist in _parse_testcrypt_header(tokens):
|
||||
|
Reference in New Issue
Block a user