plugins.competitest.settings

Options provided to the require('competitest').setup function.

Type: attribute set of anything

Default: { }

Example:

{
  compile_command = {
    cpp = {
      args = [
        "-DLOCAL"
        "$(FNAME)"
        "-o"
        "$(FNOEXT)"
        "-Wall"
        "-Wextra"
      ];
      exec = "g++";
    };
  };
  evaluate_template_modifiers = true;
  received_problems_path = "$(HOME)/cp/$(JUDGE)/$(CONTEST)/$(PROBLEM)/main.$(FEXT)";
  template_file = "$(HOME)/cp/templates/template.$(FEXT)";
}

Declared by:

plugins.competitest.settings.companion_port

Competitive companion port number.

Type: null or signed integer or floating point number or raw lua code

Default: null

Plugin default: 27121

Declared by:

plugins.competitest.settings.compile_directory

Execution directory of compiler, relatively to current file’s path.

Type: null or string or raw lua code

Default: null

Plugin default: "."

Declared by:

plugins.competitest.settings.date_format

String used to format $(DATE) modifier (see receive modifiers). The string should follow the formatting rules as per Lua’s [os.date](https://www.lua.org/pil/22.1.html) function.

Type: null or string or raw lua code

Default: null

Plugin default: "%c"

Declared by:

plugins.competitest.settings.evaluate_template_modifiers

Whether to evaluate receive modifiers inside a template file or not.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.competitest.settings.local_config_file_name

You can use a different configuration for every different folder. See local configuration.

Type: null or string or raw lua code

Default: null

Plugin default: ".competitest.lua"

Declared by:

plugins.competitest.settings.maximum_time

Maximum time, in milliseconds, given to processes. If it’s exceeded process will be killed.

Type: null or signed integer or floating point number or raw lua code

Default: null

Plugin default: 5000

Declared by:

plugins.competitest.settings.multiple_testing

How many testcases to run at the same time

  • Set it to -1 to make the most of the amount of available parallelism. Often the number of testcases run at the same time coincides with the number of CPUs.
  • Set it to 0 if you want to run all the testcases together.
  • Set it to any positive integer to run that number of testcases contemporarily.

Type: null or signed integer or floating point number or raw lua code

Default: null

Plugin default: -1

Declared by:

plugins.competitest.settings.open_received_contests

Automatically open source files when receiving a contest.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.competitest.settings.open_received_problems

Automatically open source files when receiving a single problem.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.competitest.settings.output_compare_method

How given output (stdout) and expected output should be compared. It can be a string, representing the method to use, or a custom function. Available options follows:

  • “exact”: character by character comparison.
  • “squish”: compare stripping extra white spaces and newlines.
  • custom function: you can use a function accepting two arguments, two strings representing output and expected output. It should return true if the given output is acceptable, false otherwise.

Type: null or one of “exact”, “squish” or raw lua code

Default: null

Plugin default: squish

Declared by:

plugins.competitest.settings.receive_print_message

If true notify user that plugin is ready to receive testcases, problems and contests or that they have just been received.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.competitest.settings.received_contests_directory

Directory where received contests are stored. It can be string or function, exactly as received_problems_path.

Type: null or string or raw lua code

Default: null

Plugin default: "$(CWD)"

Declared by:

plugins.competitest.settings.received_contests_problems_path

Relative path from contest root directory, each problem of a received contest is stored following this option. It can be string or function, exactly as received_problems_path.

Type: null or string or raw lua code

Default: null

Plugin default: "$(PROBLEM).$(FEXT)"

Declared by:

plugins.competitest.settings.received_contests_prompt_directory

Whether to ask user confirmation about the directory where received contests are stored or not.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.competitest.settings.received_contests_prompt_extension

Whether to ask user confirmation about what file extension to use when receiving a contest or not.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.competitest.settings.received_files_extension

Default file extension for received problems.

Type: null or string or raw lua code

Default: null

Plugin default: "cpp"

Declared by:

plugins.competitest.settings.received_problems_path

Path where received problems (not contests) are stored. Can be one of the following:

  • string with receive modifiers.
  • function: function accepting two arguments, a table with task details and a string with preferred file extension. It should return the absolute path to store received problem.

Type: null or string or raw lua code

Default: null

Plugin default: "$(CWD)/$(PROBLEM).$(FEXT)"

Declared by:

plugins.competitest.settings.received_problems_prompt_path

Whether to ask user confirmation about path where the received problem is stored or not.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.competitest.settings.replace_received_testcases

This option applies when receiving only testcases. If true replace existing testcases with received ones, otherwise ask user what to do.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.competitest.settings.running_directory

Execution directory of your solutions, relatively to current file’s path.

Type: null or string or raw lua code

Default: null

Plugin default: "."

Declared by:

plugins.competitest.settings.save_all_files

If true save all the opened files before running testcases.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.competitest.settings.save_current_file

If true save current file before running testcases.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.competitest.settings.template_file

Templates to use when creating source files for received problems or contests. Can be one of the following:

  • false: do not use templates.
  • string with file-format modifiers: useful when templates for different file types have a regular file naming.
  • table with paths: table associating file extension to template file.

Type: null or value false (singular enum) or string or attribute set of string

Default: null

Declared by:

plugins.competitest.settings.testcases_auto_detect_storage

If true testcases storage method will be detected automatically. When both text files and single file are available, testcases will be loaded according to the preference specified in testcases_use_single_file.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.competitest.settings.testcases_directory

Where testcases files are located, relatively to current file’s path.

Type: null or string or raw lua code

Default: null

Plugin default: "."

Declared by:

plugins.competitest.settings.testcases_input_file_format

String representing how testcases input files should be named (see file-format modifiers).

Type: null or string or raw lua code

Default: null

Plugin default: "$(FNOEXT)_input$(TCNUM).txt"

Declared by:

plugins.competitest.settings.testcases_output_file_format

String representing how testcases output files should be named (see file-format modifiers).

Type: null or string or raw lua code

Default: null

Plugin default: "$(FNOEXT)_output$(TCNUM).txt"

Declared by:

plugins.competitest.settings.testcases_single_file_format

String representing how single testcases files should be named (see file-format modifiers).

Type: null or string or raw lua code

Default: null

Plugin default: "$(FNOEXT).testcases"

Declared by:

plugins.competitest.settings.testcases_use_single_file

If true testcases will be stored in a single file instead of using multiple text files. If you want to change the way already existing testcases are stored see conversion.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.competitest.settings.view_output_diff

View diff between actual output and expected output in their respective windows.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by: