diff --git a/doc/generators.yaml b/doc/generators.yaml index 4813dfde..5cf1ac16 100644 --- a/doc/generators.yaml +++ b/doc/generators.yaml @@ -176,10 +176,7 @@ data: hard_cases_group: # Directories may contain a testdata.yaml that will be written as specified. testdata.yaml: - on_reject: break - accept_score: "25" - range: 0 25 - grader_flags: min + input_validator_flags: --max_n 1000 # To enable automatic numbering of testcases, data: may also contain a list of # single-element dictionaries instead of a single dictionary. In this case, diff --git a/support/schemas/generators.cue b/support/schemas/generators.cue index aad46fee..f1489429 100644 --- a/support/schemas/generators.cue +++ b/support/schemas/generators.cue @@ -1,6 +1,4 @@ -package problemformat - -// cue version 0.6 +// Use cue version 0.6 or later // To validate generators.yaml using cue: // > cue vet generators.yaml *.cue -d "#Generators" @@ -49,7 +47,7 @@ casepath: =~"^\(filename)(/\(basename))*$" #data_list: {[name | ""]: #testgroup | #testcase} & struct.MinFields(1) & struct.MaxFields(1) #testgroup: { - data?: #data_dict | [...#data_list] + data?: null | #data_dict | [...#data_list] include?: [...name] #config } diff --git a/support/schemas/testdata.cue b/support/schemas/testdata.cue deleted file mode 100644 index 162dd06f..00000000 --- a/support/schemas/testdata.cue +++ /dev/null @@ -1,48 +0,0 @@ -package problemformat - -import "strings" -import "strconv" - -#filename: =~ "^[a-zA-Z0-9][a-zA-Z0-9_.-]*[a-zA-Z0-9]$" -#path: =~ "[a-zA-Z0-9_.-/]*" - -#testdata_settings: { - on_reject: *"break" | "continue" - grading: *"default" | "custom" - grader_flags: *"" | string - if grading == "default" { grader_flags? : #default_grader_flags } - input_alidator_flags: *"" | string - output_validator_flags: *"" |string - accept_score: *"1" | #score - reject_score: *"0" | #score - range: *"-inf +inf" | string - // Verify that the scores and ranges make sense: - _range_syntax: strings.Split(range, " ") & [#score, #score] // space-separated scores - _lo: strconv.ParseFloat(strings.Split(range, " ")[0], 64) // parses to float (including '-inf') - _hi: strconv.ParseFloat(strings.Split(range, " ")[1], 64) - _wa: strconv.ParseFloat(reject_score, 64) - _ac: strconv.ParseFloat(accept_score, 64) - _order: true & _lo <= _wa & _wa <= _ac & _ac <= _hi -} -// matches "1", "06", "21", ".4", "-1.2", but not 'inf' -#score: =~ "^-?([0-9]+|[0-9]*.[0-9]+)$" - -// Default grader -// -------------- - -#default_grader_flags: this={ - string - _as_struct: { for w in strings.Split(this, " ") { (w): _ } } // convert to struct and ... - _as_struct: #valid_default_grader_fields // ... validate its fields - } - -// Default grader flags (converted to fields of a CUE struct for validation) -#valid_default_grader_fields: { - #verdict_aggregation_mode? // at most one verdict aggregation mode - #score_aggregation_mode? // at most one score aggregation mode - ignore_sample?: _ // two more optional flags - accept_if_any_accepted?: _ -} - -#verdict_aggregation_mode: {first_error: _ } | *{worst_error: _ } | {always_accept: _ } -#score_aggregation_mode: {min: _ } | {max: _ } | *{sum: _ } | {avg: _ } diff --git a/test/problems/generatorincludes/generators/generators.yaml b/test/problems/generatorincludes/generators/generators.yaml index 292c89df..67d1519a 100644 --- a/test/problems/generatorincludes/generators/generators.yaml +++ b/test/problems/generatorincludes/generators/generators.yaml @@ -11,8 +11,8 @@ data: data: - small: testdata.yaml: - input_validator_flags: --small - input_validators: + output_validator_flags: space_change_sensitive + input_validator_flags: connected: --small strongly-connected: --small data: