pub struct NoTestsPlugin {}Implementations§
Source§impl NoTestsPlugin
impl NoTestsPlugin
Trait Implementations§
Source§impl Default for NoTestsPlugin
impl Default for NoTestsPlugin
Source§fn default() -> NoTestsPlugin
fn default() -> NoTestsPlugin
Returns the “default value” for a type. Read more
Source§impl LanguagePlugin for NoTestsPlugin
Project directory:
Contains a .tmcproject.yml file that has no-tests set to true.
impl LanguagePlugin for NoTestsPlugin
Project directory:
Contains a .tmcproject.yml file that has no-tests set to true.
const PLUGIN_NAME: &'static str = "No-Tests"
const DEFAULT_SANDBOX_IMAGE: &'static str = "eu.gcr.io/moocfi-public/tmc-sandbox-python:latest"
const LINE_COMMENT: &'static str = "//"
const BLOCK_COMMENT: Option<(&'static str, &'static str)> = None
type StudentFilePolicy = NoTestsStudentFilePolicy
Source§fn scan_exercise(
&self,
path: &Path,
exercise_name: String,
) -> Result<ExerciseDesc, TmcError>
fn scan_exercise( &self, path: &Path, exercise_name: String, ) -> Result<ExerciseDesc, TmcError>
Produces an exercise description of an exercise directory. Read more
Source§fn run_tests_with_timeout(
&self,
path: &Path,
_timeout: Option<Duration>,
) -> Result<RunResult, TmcError>
fn run_tests_with_timeout( &self, path: &Path, _timeout: Option<Duration>, ) -> Result<RunResult, TmcError>
Runs the tests for the exercise with the given timeout.
Used by run_tests with the timeout from the project config.
Source§fn is_exercise_type_correct(path: &Path) -> bool
fn is_exercise_type_correct(path: &Path) -> bool
Tells if there’s a valid exercise in this path. Delegates to
find_project_dir_in_archive by default.
Unlike is_archive_type_correct, only checks the root directory.Source§fn find_project_dir_in_archive<R: Read + Seek>(
archive: &mut Archive<R>,
) -> Result<PathBuf, TmcError>
fn find_project_dir_in_archive<R: Read + Seek>( archive: &mut Archive<R>, ) -> Result<PathBuf, TmcError>
Searches the zip for a valid project directory.
This function is used to detect the language plugin for the archive, so
simply finding “src” is not sufficient, e.g. the Python plugin should check
that there is an actual “src/*.py” file inside src.
Note that the returned path may not actually have an entry in the zip.
Source§fn clean(&self, _path: &Path) -> Result<(), TmcError>
fn clean(&self, _path: &Path) -> Result<(), TmcError>
Runs clean command e.g
make clean for make or mvn clean for maven.fn get_default_student_file_paths() -> Vec<PathBuf>
fn get_default_exercise_file_paths() -> Vec<PathBuf>
Source§fn points_parser(_: &str) -> IResult<&str, Vec<&str>, VerboseError<&str>>
fn points_parser(_: &str) -> IResult<&str, Vec<&str>, VerboseError<&str>>
A nom parser that recognizes a points annotation and returns the inner points value(s). Read more
Source§fn run_tests(&self, path: &Path) -> Result<RunResult, TmcError>
fn run_tests(&self, path: &Path) -> Result<RunResult, TmcError>
Runs the tests for the exercise.
Source§fn check_code_style(
&self,
_path: &Path,
_locale: Language,
) -> Result<Option<StyleValidationResult>, TmcError>
fn check_code_style( &self, _path: &Path, _locale: Language, ) -> Result<Option<StyleValidationResult>, TmcError>
Run checkstyle or similar plugin to project if applicable, no-op by default
Source§fn extract_project<R>(
archive: &mut Archive<R>,
target_location: &Path,
clean: bool,
) -> Result<(), TmcError>
fn extract_project<R>( archive: &mut Archive<R>, target_location: &Path, clean: bool, ) -> Result<(), TmcError>
Extract a given archive file containing a compressed project to a target location. Read more
Source§fn extract_student_files(
compressed_project: impl Read + Seek,
compression: Compression,
target_location: &Path,
) -> Result<(), TmcError>
fn extract_student_files( compressed_project: impl Read + Seek, compression: Compression, target_location: &Path, ) -> Result<(), TmcError>
Extracts student files from the compressed project.
It finds the project dir from the zip and extracts the student files from there.
Overwrites all files.
Important: does not extract .tmcproject.yml from the students’ submission as they control that file and they could use it to modify the test files.
Source§fn safe_find_project_dir_in_archive<R>(archive: &mut Archive<R>) -> PathBuf
fn safe_find_project_dir_in_archive<R>(archive: &mut Archive<R>) -> PathBuf
A safer variant of
find_project_dir_in_archive used by default extraction helpers. Read moreSource§fn is_archive_type_correct<R>(archive: &mut Archive<R>) -> bool
fn is_archive_type_correct<R>(archive: &mut Archive<R>) -> bool
Tells if there’s a valid exercise in this archive.
Unlike
is_exercise_type_correct, searches the entire archive.Source§fn get_exercise_packaging_configuration(
path: &Path,
) -> Result<ExercisePackagingConfiguration, TmcError>
fn get_exercise_packaging_configuration( path: &Path, ) -> Result<ExercisePackagingConfiguration, TmcError>
Returns configuration which is used to package submission on tmc-server.
Auto Trait Implementations§
impl Freeze for NoTestsPlugin
impl RefUnwindSafe for NoTestsPlugin
impl Send for NoTestsPlugin
impl Sync for NoTestsPlugin
impl Unpin for NoTestsPlugin
impl UnwindSafe for NoTestsPlugin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more