diff options
author | Alin Gabriel Serdean <aserdean@ovn.org> | 2019-03-19 00:43:00 +0200 |
---|---|---|
committer | Alin Gabriel Serdean <aserdean@ovn.org> | 2019-04-03 17:47:29 +0300 |
commit | 241bc88a2dd76a80b9f8dcc572e82ebe1a265b29 (patch) | |
tree | 94c325e46802c673a2b1154c7e3ed087c9344694 /tests | |
parent | c4f8dc7a9c5c1802f6b185b2440f9245a719f73b (diff) | |
download | openvswitch-241bc88a2dd76a80b9f8dcc572e82ebe1a265b29.tar.gz |
checkpatch: Normalize exit code for Windows
Using python `sys.exit(-1)` on Windows produces mixed results.
Let's take the following results from different shells:
CMD
>python -c "import sys; sys.exit(-1)" & echo %errorlevel%
1
MSYS
$ python -c "import sys; sys.exit(-1)" && echo $?
0
WSL
$ python -c "import sys; sys.exit(-1)"; echo $?
255
this results in the following tests to fail:
checkpatch
10: checkpatch - sign-offs FAILED (checkpatch.at:32)
11: checkpatch - parenthesized constructs FAILED (checkpatch.at:32)
12: checkpatch - parenthesized constructs - for FAILED (checkpatch.at:32)
13: checkpatch - comments FAILED (checkpatch.at:32)
because of:
./checkpatch.at:32: exit code was 0, expected 255
This patch introduces a positive constant for the default exit code (1)
similar to other OVS utilities.
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/checkpatch.at | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/checkpatch.at b/tests/checkpatch.at index 9a72bc279..07f4b137c 100755 --- a/tests/checkpatch.at +++ b/tests/checkpatch.at @@ -30,7 +30,7 @@ try_checkpatch__() { : elif test -s expout; then AT_CHECK([$2 $top_srcdir/utilities/checkpatch.py -q test.patch], - [255], [stdout]) + [1], [stdout]) AT_CHECK([sed '/^Lines checked:/,$d' stdout], [0], [expout]) else AT_CHECK([$2 $top_srcdir/utilities/checkpatch.py -q test.patch]) |