aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangtools/readexporteddiagnosticstest.h
blob: 973c66cd6b12583174fc69a6f1bc73596d4bd6d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <QObject>
#include <QString>

namespace CppEditor::Tests { class TemporaryCopiedDir; }
namespace Utils { class FilePath; }

namespace ClangTools::Internal {

class ReadExportedDiagnosticsTest : public QObject
{
    Q_OBJECT
public:
    ReadExportedDiagnosticsTest();
    ~ReadExportedDiagnosticsTest();

private slots:
    void initTestCase();
    void init();

    void testNonExistingFile();
    void testEmptyFile();
    void testUnexpectedFileContents();
    void testTidy();
    void testAcceptDiagsFromFilePaths_None();
    void testTidy_ClangAnalyzer();
    void testClazy();

    void testOffsetInvalidText();
    void testOffsetInvalidOffset_EmptyInput();
    void testOffsetInvalidOffset_Before();
    void testOffsetInvalidOffset_After();
    void testOffsetInvalidOffset_NotFirstByteOfMultiByte();
    void testOffsetStartOfFirstLine();
    void testOffsetEndOfFirstLine();
    void testOffsetOffsetPointingToLineSeparator_unix();
    void testOffsetOffsetPointingToLineSeparator_dos();
    void testOffsetStartOfSecondLine();
    void testOffsetMultiByteCodePoint1();
    void testOffsetMultiByteCodePoint2();

private:
    QString createFile(const QString &yamlFilePath, const QString &filePathToInject) const;
    Utils::FilePath filePath(const QString &fileName) const;

    CppEditor::Tests::TemporaryCopiedDir * const m_baseDir;
    QString m_message;
};

} // namespace ClangTools::Internal