Commit 1031c8a9 authored by Gian Saß's avatar Gian Saß

When validating submission, compile with both tests

parent 6f6a2c45
......@@ -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, test_file)
warnings = check_for_garbage(submission_file, task)
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment