Skip to content

Commit

Permalink
Fix cli-e.test.
Browse files Browse the repository at this point in the history
  • Loading branch information
0-wiz-0 committed Mar 5, 2024
1 parent 093a472 commit 5369354
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
1 change: 0 additions & 1 deletion regress/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
set(XFAIL_TESTS
cli-e.test
sort-dupes.test
)

Expand Down
8 changes: 5 additions & 3 deletions regress/cli-e.test
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
description test -e: write error log to file
return 0
arguments -eerror.log.txt -l dupe.zip
arguments -eerror.log -l dupe.zip
file dupe.zip dupe.zip dupe.zip
stdout
Rezipping - dupe.zip
--------------------------------------------------
Adding - abc (4 bytes)...Done
Not done
end-of-inline-data
stderr
Zip file "dupe.zip" contains more than one file named "abc"
!!!! There were problems! See "error.log" for details! !!!!
end-of-inline-data
file error.log.txt {} <inline>
[2024/03/05 - 21:41:30] Zip file "dupe.zip" contains more than one file named "abc"
file error.log {} <inline.log>
[timestamp] Zip file "dupe.zip" contains more than one file named "abc"
end-of-inline-data
3 changes: 3 additions & 0 deletions regress/nihtest.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ test-input-directories = @CMAKE_CURRENT_SOURCE_DIR@
program-directories = @PROJECT_BINARY_DIR@/src
default-program = trrntzip
default-stderr-replace = "^[^ :]*: " ""

[comparator-preprocessors]
log.log = @PYTHONBIN@ @CMAKE_CURRENT_SOURCE_DIR@/remove-timestamps
12 changes: 12 additions & 0 deletions regress/remove-timestamps
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python3

import fileinput
import re

timestamp_re = re.compile(r'\[\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d\]')

for line in fileinput.input():
line = line.rstrip()
line = re.sub(timestamp_re, '[timestamp]', line)
print(line)

0 comments on commit 5369354

Please sign in to comment.