tarantool / test-run

Tarantool functional testing framework
14 stars 15 forks source link

Fix detection of debug builds #356

Closed NickVolynkin closed 1 year ago

NickVolynkin commented 1 year ago

The tarantool -v output is a single multiline string. Flag re.MULTILINE is required to match it with start of line (^) or end of line ($) characters. The .* in the middle of the pattern does not match start/end of lines, so this expression can not match something like this:

Target: Darwin-x86_64-Release
Build options: ... -Debug ...

The re.IGNORECASE is not required, because the build mode is always spelled in one particular way: -Debug.

Follow-up to #352 Fixes #355

Co-authored-by: Serge Petrenko sergepetrenko@tarantool.org

coveralls commented 1 year ago

Coverage Status

Coverage increased (+0.006%) to 63.134% when pulling 6d5de0c96589ddb4c35b564bd0c092776a25fd73 on NickVolynkin:nickvolynkin/fix-debug-detection into 83a12f4820ba0ea7454da80ae5545ab208b30f1d on tarantool:master.

Totktonada commented 1 year ago

It was merged so fast that I had no change to point to https://github.com/tarantool/test-run/pull/353#discussion_r997015987. Anyway, that's minor.

Totktonada commented 1 year ago

I didn't get it initially, but understood now.

^ (Caret.) Matches the start of the string, and in MULTILINE mode also matches immediately after each newline.

$ Matches the end of the string or just before the newline at the end of the string, and in MULTILINE mode also matches before a newline. <...>

https://docs.python.org/3/library/re.html

IOW, ^ and $ do not match start and end of a line without the multiline mode.

The problem was introduced in PR #353.