This repository has been archived by the owner on Dec 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for systems that lack gcc/g++/java
- Loading branch information
Showing
10 changed files
with
60 additions
and
35 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
__title__ = "assignment-autograder" | ||
__description__ = "Automatic assignment grading for instructor use in programming courses" | ||
__version__ = "2.11.1" | ||
__version__ = "2.12.0" | ||
__author__ = "Stanislav Zmiev" | ||
__author_email__ = "[email protected]" | ||
__license__ = "MIT" |
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,12 +1,25 @@ | ||
from typing import Dict, Type | ||
from .abstract_base_class import ArgList, TestCase | ||
from .c import CTestCase | ||
from .cpp import CPPTestCase | ||
from .java import JavaTestCase | ||
from .python import PythonTestCase | ||
|
||
ALLOWED_LANGUAGES = { | ||
|
||
def _is_installed(language_name: str, testcase: TestCase) -> bool: | ||
""" Useful for logging """ | ||
if testcase.is_installed(): | ||
return True | ||
else: | ||
print(f"Utilities for running {language_name} are not installed. Disabling it.") | ||
return False | ||
|
||
|
||
ALLOWED_LANGUAGES: Dict[str, Type[TestCase]] = { | ||
"c": CTestCase, | ||
"java": JavaTestCase, | ||
"python": PythonTestCase, | ||
"c++": CPPTestCase, | ||
} | ||
} | ||
|
||
ALLOWED_LANGUAGES = {k: v for k, v in ALLOWED_LANGUAGES.items() if _is_installed(k, v)} |
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,14 +1,10 @@ | ||
from autograder.testcases.abstract_base_class import Command | ||
import shutil | ||
import sh | ||
|
||
from .c import CTestCase | ||
|
||
if shutil.which("g++") is not None: | ||
COMPILER = sh.Command("g++") | ||
else: | ||
COMPILER = None | ||
|
||
|
||
class CPPTestCase(CTestCase): | ||
source_suffix = ".cpp" | ||
compiler = COMPILER | ||
compiler = Command("g++") |
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