From 0e78c24fd231d5ee67ccd271bfa317faa963281c Mon Sep 17 00:00:00 2001 From: sethp Date: Mon, 2 Oct 2023 08:20:09 -0700 Subject: feat: treat non-seekable files as pipes (#2309) Previously, attempting to read from a pipe would result in an error: 'not a regular file', disallowing use of files like /dev/stdin or /dev/fd/3, named fifos, sockets, etc. The tools already understand how to (try to) read from non-regular files, so this change attempts to do so when the input is not seek-able (the "regular file" capability that's in use here). Additionally, this adds a test for the new behavior using a bash herestring and process substitution (the latter of which shows up in argv as something like `/dev/fd/NN`). Since bash isn't commonly installed on Windows, this change also introduces a new capability to filter tests to specific platforms (sorry). --- test/run-tests.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/run-tests.py') diff --git a/test/run-tests.py b/test/run-tests.py index 0bd241ea..370f75ef 100755 --- a/test/run-tests.py +++ b/test/run-tests.py @@ -20,6 +20,7 @@ import difflib import fnmatch import multiprocessing import os +import platform import re import shlex import shutil @@ -505,6 +506,8 @@ class TestInfo(object): elif key == 'ENV': # Pattern: FOO=1 BAR=stuff self.env = dict(x.split('=') for x in value.split()) + elif key == 'PLATFORMS': + self.skip = platform.system() not in value.split() else: raise Error('Unknown directive: %s' % key) -- cgit v1.2.3