forked from shashankkumar/CodeRunner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeRunner now supports command line options
- Loading branch information
1 parent
a5973eb
commit d3049c5
Showing
15 changed files
with
79 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ Logs/* | |
main | ||
config.h | ||
TestCases2/* | ||
Execution | ||
*_execution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef LOGS_H | ||
#define LOGS_H | ||
#include "includes.h" | ||
#include "includeh.h" | ||
|
||
class Logs{ | ||
private: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
main : main.o FileHandle.o CurlWrapper.o Logs.o ContentParser.o includes.h config.h -lcurl | ||
VAR=includeh.h includes.h config.h Logs.h | ||
main : main.o FileHandle.o CurlWrapper.o Logs.o ContentParser.o *_execution -lcurl | ||
g++ -o main main.o FileHandle.o CurlWrapper.o ContentParser.o Logs.o -lcurl | ||
|
||
main.o : main.cpp includes.h ContentParser.h FileHandle.h Logs.h config.h | ||
main.o : main.cpp ContentParser.h FileHandle.h $(VAR) | ||
g++ -c main.cpp | ||
|
||
FileHandle.o : FileHandle.cpp FileHandle.h CurlWrapper.h Logs.h includes.h config.h | ||
FileHandle.o : FileHandle.cpp FileHandle.h CurlWrapper.h $(VAR) | ||
g++ -c FileHandle.cpp | ||
|
||
CurlWrapper.o : CurlWrapper.cpp CurlWrapper.h Logs.h includes.h config.h | ||
CurlWrapper.o : CurlWrapper.cpp CurlWrapper.h $(VAR) | ||
g++ -c CurlWrapper.cpp | ||
|
||
ContentParser.o : ContentParser.cpp ContentParser.h CurlWrapper.h includes.h config.h Logs.h | ||
ContentParser.o : ContentParser.cpp ContentParser.h CurlWrapper.h $(VAR) | ||
g++ -c ContentParser.cpp | ||
|
||
Logs.o : Logs.cpp Logs.h includes.h config.h | ||
Logs.o : Logs.cpp $(VAR) | ||
g++ -c Logs.cpp | ||
|
||
.PHONY: clean | ||
clean: | ||
rm *.o main | ||
rm *.o main *_execution | ||
|
||
*_execution : cpp_execution.cpp java_execution.cpp | ||
g++ cpp_execution.cpp -o cpp_execution | ||
g++ java_execution.cpp -o java_execution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef INCLUDEH_H | ||
#define INCLUDEH_H | ||
#include "includes.h" | ||
#include "config.h" | ||
#include "Logs.h" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,11 +18,10 @@ You may contact the author of CodeRunner by e-mail at: | |
[email protected] | ||
****************************************************************************/ | ||
#include "includes.h" | ||
#include "includeh.h" | ||
#include "FileInfo.h" | ||
#include "ContentParser.h" | ||
#include "FileHandle.h" | ||
#include "Logs.h" | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
|
@@ -37,22 +36,25 @@ int main(int argc, char* argv[]) | |
int opt; | ||
FileInfoFetchOptionsStruct* FileInfoFetchOptions = new FileInfoFetchOptionsStruct(); | ||
FileInfoFetchOptions->Init(); | ||
while((opt = getopt(argc, argv, "bf:p:l:")) != -1){ | ||
while((opt = getopt(argc, argv, "cbf:p:l:")) != -1){ | ||
switch(opt){ | ||
case 'f': | ||
FileInfoFetchOptions->f=true; | ||
FileInfoFetchOptions->FileInfo.FileId = atoi(optarg); | ||
break; | ||
case 'p': | ||
FileInfoFetchOptions->p=true | ||
FileInfoFetchOptions->p=true; | ||
strcpy(FileInfoFetchOptions->FileInfo.ProblemId, optarg); | ||
break; | ||
case 'l': | ||
FileInfoFetchOptions->l=true | ||
FileInfoFetchOptions->l=true; | ||
strcpy(FileInfoFetchOptions->FileInfo.lang, optarg); | ||
break; | ||
case 'b': | ||
FileInfoFetchOptions->b=true | ||
CurlWrapper::ForcePushResult=true; | ||
break; | ||
case 'c': | ||
FileHandle::Clean=true; | ||
break; | ||
default: /* '?' */ | ||
fprintf(stderr, "Usage: %s [-f fileid | [-p problemcode] [-l language]] [-b]", argv[0]); | ||
|
@@ -71,8 +73,8 @@ int main(int argc, char* argv[]) | |
do{ | ||
Logs::OpenLogFile(); | ||
bool CurrentIteration = true; | ||
ContentParser *ContentVar = new ContentParser(FileInfoFetchOptions); | ||
if(ContentVar->FetchFileInfoList()==-1){ | ||
ContentParser *ContentVar = new ContentParser(); | ||
if(ContentVar->FetchFileInfoList(FileInfoFetchOptions)==-1){ | ||
CurrentIteration = false; | ||
} | ||
|
||
|