2021-11-01 09:18:23 +08:00
|
|
|
#ifndef OJPROBLEMCASESRUNNER_H
|
|
|
|
#define OJPROBLEMCASESRUNNER_H
|
|
|
|
|
|
|
|
#include "runner.h"
|
|
|
|
#include <QVector>
|
2021-11-01 20:44:08 +08:00
|
|
|
#include "../problems/ojproblemset.h"
|
2021-11-01 09:18:23 +08:00
|
|
|
|
|
|
|
class OJProblemCasesRunner : public Runner
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit OJProblemCasesRunner(const QString& filename, const QString& arguments, const QString& workDir,
|
|
|
|
const QVector<POJProblemCase>& problemCases, QObject *parent = nullptr);
|
|
|
|
explicit OJProblemCasesRunner(const QString& filename, const QString& arguments, const QString& workDir,
|
|
|
|
POJProblemCase problemCase, QObject *parent = nullptr);
|
|
|
|
signals:
|
2021-11-02 01:07:37 +08:00
|
|
|
void caseStarted(const QString& id, int current, int total);
|
|
|
|
void caseFinished(const QString& id, int current, int total);
|
2021-11-01 09:18:23 +08:00
|
|
|
private:
|
|
|
|
void runCase(int index, POJProblemCase problemCase);
|
|
|
|
private:
|
|
|
|
QVector<POJProblemCase> mProblemCases;
|
|
|
|
|
|
|
|
// QThread interface
|
|
|
|
protected:
|
|
|
|
void run() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // OJPROBLEMCASESRUNNER_H
|