From 53693541b7aa25cea7fac95b54b3e7a846bbfddb Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Wed, 6 Mar 2024 00:46:22 +0100 Subject: [PATCH] Fix cli-e.test. --- regress/CMakeLists.txt | 1 - regress/cli-e.test | 8 +++++--- regress/nihtest.conf.in | 3 +++ regress/remove-timestamps | 12 ++++++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100755 regress/remove-timestamps diff --git a/regress/CMakeLists.txt b/regress/CMakeLists.txt index 1e37607..a9e949d 100644 --- a/regress/CMakeLists.txt +++ b/regress/CMakeLists.txt @@ -1,5 +1,4 @@ set(XFAIL_TESTS - cli-e.test sort-dupes.test ) diff --git a/regress/cli-e.test b/regress/cli-e.test index 8078d15..6e19042 100644 --- a/regress/cli-e.test +++ b/regress/cli-e.test @@ -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 {} -[2024/03/05 - 21:41:30] Zip file "dupe.zip" contains more than one file named "abc" +file error.log {} +[timestamp] Zip file "dupe.zip" contains more than one file named "abc" end-of-inline-data diff --git a/regress/nihtest.conf.in b/regress/nihtest.conf.in index 736c707..52be68c 100644 --- a/regress/nihtest.conf.in +++ b/regress/nihtest.conf.in @@ -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 \ No newline at end of file diff --git a/regress/remove-timestamps b/regress/remove-timestamps new file mode 100755 index 0000000..2ce3dd7 --- /dev/null +++ b/regress/remove-timestamps @@ -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) +