/*
* Copyright (C) 2026, KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */

#ifndef TEST_QPROCESS_H
#define TEST_QPROCESS_H

#include <QString>
#include <QStringList>

class TestQProcess
{
public:
    static bool startDetached(const QString &program)
    {
        lastProgram = program;
        lastArguments.clear();
        ++startDetachedCount;
        return nextStartDetachedResult;
    }

    static bool startDetached(const QString &program, const QStringList &arguments)
    {
        lastProgram = program;
        lastArguments = arguments;
        ++startDetachedCount;
        return nextStartDetachedResult;
    }

    static void resetTestData()
    {
        nextStartDetachedResult = true;
        startDetachedCount = 0;
        lastProgram.clear();
        lastArguments.clear();
    }

    inline static bool nextStartDetachedResult = true;
    inline static int startDetachedCount = 0;
    inline static QString lastProgram;
    inline static QStringList lastArguments;
};

#endif // TEST_QPROCESS_H
