-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 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
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,25 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
project(recodex-judge-passthrough) | ||
|
||
# Use all settings from original Makefile | ||
if(UNIX) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -fexceptions") | ||
set(CMAKE_CXX_LINKER_FLAGS "${CMAKE_CXX_LINKER_FLAGS} -s") | ||
endif() | ||
|
||
# The worker executable | ||
set(SOURCE_FILES | ||
main.cpp | ||
) | ||
|
||
add_executable(${PROJECT_NAME} ${SOURCE_FILES}) | ||
|
||
|
||
# installation | ||
if(UNIX) | ||
install(TARGETS recodex-judge-passthrough DESTINATION /usr/bin COMPONENT binaries) | ||
elseif(MSVC) | ||
install(TARGETS recodex-judge-passthrough DESTINATION worker/bin COMPONENT binaries) | ||
else() | ||
install(TARGETS recodex-judge-passthrough DESTINATION recodex/worker/bin COMPONENT binaries) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Passthrough judge which just outputs inputted file. | ||
* (C) 2018 ReCodEx Team <github.com/ReCodEx> | ||
* | ||
* Usage: recodex-judge-passthrough <file> <file> | ||
* | ||
* Exitcode: | ||
* - 0: if output was provided | ||
* - 2: errors were present during execution of comparision, error message should be visible on stderr | ||
* | ||
* Enjoy :o) | ||
*/ | ||
|
||
#include <iostream> | ||
#include <fstream> | ||
|
||
#define RES_OK 0 | ||
#define RES_ERROR 2 | ||
|
||
using namespace std; | ||
|
||
|
||
/* | ||
* Application entry point. | ||
*/ | ||
int main(int argc, char **argv) { | ||
|
||
// Check amount of program arguments. | ||
if (argc != 3) { | ||
cerr << "Wrong amount of arguments." << endl; | ||
return RES_ERROR; | ||
} | ||
|
||
ifstream inputfile(argv[1]); | ||
cout << inputfile.rdbuf(); | ||
inputfile.close(); | ||
|
||
return RES_OK; | ||
} |