File indexing completed on 2024-04-28 04:37:34

0001 /*
0002     SPDX-FileCopyrightText: 2014 Sergey Kalinichev <kalinichev.so.0@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #ifndef PROJECTSGENERATOR_H
0008 #define PROJECTSGENERATOR_H
0009 
0010 #include "testsexport.h"
0011 
0012 namespace KDevelop
0013 {
0014 class IProject;
0015 
0016 
0017 /// Simple class for generating projects at runtime for testing purposes.
0018 class KDEVPLATFORMTESTS_EXPORT ProjectsGenerator
0019 {
0020 public:
0021     /**
0022      * Generates a pointer to a project with the following directory structure:
0023      * ./simpleproject.kdev4
0024      * ./src/main.cpp
0025      * ./.kdev4/simpleproject.kdev4
0026      *
0027      * Files are located in the OS temporary folder, subfolder 'simpleproject'
0028      */
0029     static KDevelop::IProject* GenerateSimpleProject();
0030 
0031     /**
0032      * This actually creates the same directory structure as GenerateSimpleProject().
0033      * However, the .kdev_include_paths file is also included in this project, so the structure
0034      * becomes:
0035      * ./simpleproject.kdev4
0036      * ./.kdev_include_paths
0037      * ./src/main.cpp
0038      * ./.kdev4/simpleproject.kdev4
0039      *
0040      * Files are located in the OS temporary folder, subfolder 'simpleproject'
0041      */
0042     static KDevelop::IProject* GenerateSimpleProjectWithOutOfProjectFiles();
0043 
0044     /**
0045      * Generates a pointer to a project with the following directory structure:
0046      * ./multipathproject.kdev4
0047      * ./src/main.cpp
0048      * ./anotherFolder/tst.h
0049      * ./.kdev4/multipathproject.kdev4
0050      *
0051      * Files are located in the OS temporary folder, subfolder 'multipathproject'
0052      */
0053     static KDevelop::IProject* GenerateMultiPathProject();
0054 
0055     /**
0056      * Generates a pointer to a project with the following directory structure:
0057      * ./emptyproject.kdev4
0058      * ./.kdev4/emptyproject.kdev4
0059      *
0060      * Files are located in the OS temporary folder, subfolder 'emptyproject'
0061      */
0062     static KDevelop::IProject* GenerateEmptyProject();
0063 
0064     /**
0065      * Generates a pointer to a project with the following directory structure:
0066      * ./emptybuilddirproject.kdev4
0067      * ./src/main.cpp
0068      * ./.kdev4/emptybuilddirproject.kdev4
0069      *
0070      * Files are located in the OS temporary folder, subfolder 'emptybuilddirproject'
0071      */
0072     static KDevelop::IProject* GenerateEmptyBuildDirProject();
0073 };
0074 
0075 }
0076 #endif // PROJECTSGENERATOR_H