fixed code style, removed unnecessary pragmas

This commit is contained in:
2023-12-03 13:09:16 +03:00
parent bd74d4684f
commit 6b7bde1471
12 changed files with 765 additions and 744 deletions

View File

@@ -1,47 +1,50 @@
#include "Task.h"
#pragma once
class CompilationTask: public Task {
String test_id;
String makefile_text;
public:
void setTestId(String * test_id_in){
test_id = String(test_id_in->getCharArray());
}
void setMakefileText(String * makefile_text_in){
makefile_text = String(makefile_text_in->getCharArray(), '|');
}
virtual void print(){
printf("id=%ld; maxtime=%d; test_id=%s\n", id, maxtime,
test_id.getCharArray());
printf("makefile_text=%s\n", makefile_text.getCharArray());
}
CompilationTask(Text * lines, int offset):Task(lines,offset) {
setTestId(lines->get(offset+2));
setMakefileText(lines->get(offset+3));
setState(Waiting);
kernels=1;
}
virtual void prepareWorkspace(){
String makeFilePath = String(id)+"/Makefile";
File makeFileFile = File(makeFilePath, this->makefile_text);
String tests = userWorkspace+"/projects";
String testPath= tests+"/"+test_id;
String copyCommand = "cp -r " + String::DQuotes(testPath + "/.") + " "+ String::DQuotes(workspace);
system(copyCommand.getCharArray());
}
virtual String getLaunchScriptText(){
String modules = userWorkspace+"/modules";
String starterCall = modules+"/starter";
String launcherCall = modules+"/launcher";
return String::DQuotes(starterCall)+" "+
String::DQuotes(launcherCall)+" "+
String(maxtime)+" "+
String::DQuotes("")+" "+
"make -j -f Makefile";
}
virtual void analyseResults(){
String binary = workspace+"/0";
state = Utils::Exists(binary)? Done:DoneWithErrors;
#include "Task.h"
#include "Text.h"
class CompilationTask : public Task {
String test_id;
String makefile_text;
public:
void setTestId(String* test_id_in) {
test_id = String(test_id_in->getCharArray());
}
void setMakefileText(String* makefile_text_in) {
makefile_text = String(makefile_text_in->getCharArray(), '|');
}
virtual void print() {
printf("id=%ld; maxtime=%d; test_id=%s\n", id, maxtime,
test_id.getCharArray());
printf("makefile_text=%s\n", makefile_text.getCharArray());
}
CompilationTask(Text* lines, int offset) :Task(lines, offset) {
setTestId(lines->get(offset + 2));
setMakefileText(lines->get(offset + 3));
setState(Waiting);
kernels = 1;
}
virtual void prepareWorkspace() {
String makeFilePath = String(id) + "/Makefile";
File makeFileFile = File(makeFilePath, this->makefile_text);
String tests = userWorkspace + "/projects";
String testPath = tests + "/" + test_id;
String copyCommand = "cp -r " + String::DQuotes(testPath + "/.") + " " + String::DQuotes(workspace);
system(copyCommand.getCharArray());
}
virtual String getLaunchScriptText() {
String modules = userWorkspace + "/modules";
String starterCall = modules + "/starter";
String launcherCall = modules + "/launcher";
return String::DQuotes(starterCall) + " " +
String::DQuotes(launcherCall) + " " +
String(maxtime) + " " +
String::DQuotes("") + " " +
"make -j -f Makefile";
}
virtual void analyseResults() {
String binary = workspace + "/0";
state = Utils::Exists(binary) ? Done : DoneWithErrors;
}
};