diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-05-12 22:33:25 +0200 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-05-14 12:56:52 +0200 |
commit | a4d4aad793561ee3e397595f8a1db71651bc1b1b (patch) | |
tree | 7185b0957c4c6076fb6f6572c2a6ea5f275b2f18 /tests/auto/qdoc/generatedoutput/testdata | |
parent | 5364f88463bca65cd7ba1a1f48f6c444586957eb (diff) |
qdoc: Fix regression in HeaderNode name handling
Node::plainFullName() constructs a fully qualified name for a node,
traversing the chain of parents until it comes across the root
namespace or a HeaderNode - but if the start node was already a header,
it incorrectly returned an empty string as the node name.
Fix the issue and add a test for output generated by \headerfile command.
Pick-to: 5.15
Fixes: QTBUG-84070
Change-Id: Ib214c53be8ed0eea98708219a00ba43970cd4177
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'tests/auto/qdoc/generatedoutput/testdata')
3 files changed, 111 insertions, 0 deletions
diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/headerfile.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/headerfile.qdocconf new file mode 100644 index 000000000..b270556d1 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testdata/configs/headerfile.qdocconf @@ -0,0 +1,17 @@ +project = HeaderFile +moduleheader = testheader.h + +{includepaths,sourcedirs,headerdirs} += ../headerfile + +sources.fileextensions = "*.cpp *.qdoc" +headers.fileextensions = "*.h" + +outputformats = HTML DocBook +HTML.nosubdirs = true +HTML.outputsubdir = headerfile +DocBook.nosubdirs = true +DocBook.outputsubdir = headerfile-docbook + +# zero warning tolerance +warninglimit = 0 +warninglimit.enabled = true diff --git a/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.cpp b/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.cpp new file mode 100644 index 000000000..3a85b169c --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "testheader.h" + +/*! + \headerfile <TestHeader> + \title Test Header + \inmodule TestCPP + \brief A header file. + \ingroup headers +*/ + +/*! + \group headers + \title Headers +*/ + +/*! + \fn void globalFunc() + \brief Global function. + \relates <TestHeader> +*/ + +/*! + \variable globalVar + \brief Global variable. + \relates <TestHeader> +*/ + +/*! + \enum Globals + \relates <TestHeader> + \value Glo + \value Bal +*/ diff --git a/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.h b/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.h new file mode 100644 index 000000000..94c625157 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.h @@ -0,0 +1,33 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#pragma once + +void globalFunc() {}; +enum Globals { Glo, Bal }; +const int globalVar; |