diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-07-18 14:58:31 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-07-18 13:04:08 +0000 |
commit | 4a7ec2d9b0c353d40ab9702e8d7b7fdab52dfd0e (patch) | |
tree | 8be173f40a8baf692f1dc5562c49c42fe4359adb | |
parent | c08dc1e04f4e9301621223d64b5b34ee9bbad84a (diff) |
testlib: Allow tailing comments in blacklist files
Task-number: QTBUG-61987
Change-Id: I27219a6d06d7a81514e3f7b2ad5469676f724e04
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r-- | src/testlib/qtestblacklist.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index 75186d93ae..57661bb389 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE /* The BLACKLIST file format is a grouped listing of keywords. - Blank lines and lines starting with # are simply ignored. An initial #-line + Blank lines and everything after # is simply ignored. An initial #-line referring to this documentation is kind to readers. Comments can also be used to indicate the reasons for ignoring particular cases. @@ -247,8 +247,12 @@ void parseBlackList() QByteArray function; while (!ignored.atEnd()) { - QByteArray line = ignored.readLine().simplified(); - if (line.isEmpty() || line.startsWith('#')) + QByteArray line = ignored.readLine(); + const int commentPosition = line.indexOf('#'); + if (commentPosition >= 0) + line.truncate(commentPosition); + line = line.simplified(); + if (line.isEmpty()) continue; if (line.startsWith('[')) { function = line.mid(1, line.length() - 2); |