Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
java-submission-tester
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Dozentron
java-submission-tester
Commits
1031c8a9
Commit
1031c8a9
authored
Jun 24, 2019
by
Gian Saß
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When validating submission, compile with both tests
parent
6f6a2c45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
lib/java_submission_tester/java_submission_test_runner.rb
lib/java_submission_tester/java_submission_test_runner.rb
+9
-5
No files found.
lib/java_submission_tester/java_submission_test_runner.rb
View file @
1031c8a9
...
...
@@ -46,7 +46,9 @@ module JavaSubmissionTester
return
{
error:
validation_message
}
end
def
validate_submission_structure
(
submission_file
,
test_file
)
def
validate_submission_structure
(
submission_file
,
task
)
testJars
=
task
.
test_jar_list
validation_message
=
validate_is_jar?
submission_file
return
{
error:
validation_message
}
unless
validation_message
.
nil?
...
...
@@ -101,13 +103,15 @@ module JavaSubmissionTester
break
unless
validation_message
.
nil?
unzip
test_file
.
current_path
,
path
# Unzip now because it will break the above checks
testJars
.
each
do
|
t
|
unzip
t
.
current_path
,
path
# Unzip now because it will break the above checks
end
compiled
,
error
=
compiles?
(
path
)
validation_message
=
[
'Abgabe kann nicht compiliert werden.'
,
error
]
unless
compiled
end
warnings
=
check_for_garbage
(
submission_file
,
t
est_file
)
warnings
=
check_for_garbage
(
submission_file
,
t
ask
)
return
{
error:
validation_message
,
warning:
warnings
}
end
...
...
@@ -172,9 +176,9 @@ module JavaSubmissionTester
end
private
def
check_for_garbage
(
submission_file
,
test_file
)
test_filenames
=
zip_entries
(
test_file
)
def
check_for_garbage
(
submission_file
,
task
)
submission_filenames
=
zip_entries
(
submission_file
)
test_filenames
=
task
.
test_jar_list
.
map
{
|
t
|
zip_entries
(
t
)
}.
sum
garbage_files
=
submission_filenames
.
select
do
|
filename
|
file_downcased
=
filename
.
downcase
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment