Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option of skipping test case when first failure occured (#9) #6

Closed
wants to merge 2 commits into from

Conversation

reAsOn2010
Copy link
Contributor

@reAsOn2010 reAsOn2010 commented Jan 11, 2019

used for ACM scoring rule...

src/ljudge.cc Outdated
@@ -1413,6 +1417,11 @@ static Options parse_cli_options(int argc, const char *argv[]) {
REQUIRE_NARGV(1);
options.nthread = NEXT_NUMBER_ARG;
#endif
} else if (option == "skip-on-first-failure") {
if (options.nthread != 1) {
Copy link
Owner

@quark-zju quark-zju Jan 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps nthread can be automatically set to 1 in this case so --skip-on-first-failure works without specifying threads explicitly.

@reAsOn2010 reAsOn2010 force-pushed the skip-when-first-failure branch 2 times, most recently from 43ebd1c to dccd737 Compare January 11, 2019 04:04
@reAsOn2010
Copy link
Contributor Author

I saw the code already merged into master, so close.

@reAsOn2010 reAsOn2010 closed this Jan 11, 2019
Copy link
Owner

@quark-zju quark-zju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change was pushed as bece9a4. Thanks!

I've made some minor edits.

j::object testcase_result = run_testcase(opts.etc_dir, opts.cache_dir, opts.user_code_path, opts.checker_code_path, opts.envs, opts.cases[i], opts.skip_checker, opts.keep_stdout, opts.keep_stderr);
results[i] = j::value(testcase_result);
if (testcase_result["result"].to_str() != TestcaseResult::ACCEPTED) {
should_skip = true;
Copy link
Owner

@quark-zju quark-zju Jan 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit tricky for OpenMP. Although it compiles, I think it's better to make the openmp loop explicitly not mutate a variable outside the loop body.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, seems better.

@@ -108,6 +108,7 @@ namespace TestcaseResult {
const string FLOAT_POINT_EXCEPTION = "FLOAT_POINT_EXCEPTION";
const string SEGMENTATION_FAULT = "SEGMENTATION_FAULT";
const string WRONG_ANSWER = "WRONG_ANSWER";
const string SKIPPED = "SKIPPED";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines here are generated via cog. I have updated the cog comment.

@reAsOn2010 reAsOn2010 deleted the skip-when-first-failure branch January 11, 2019 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants