#competitive-programming #testing #solution #cpp #exercise #tester #io

app toster

一个简单的烤面包机测试器,用于竞赛编程练习的 C++ 解决方案

12 个版本 (稳定版)

1.2.1 2023年11月11日
1.1.3 2023年9月20日
1.1.1 2023年7月24日
1.0.0 2023年1月13日
0.3.0 2022年9月13日

#2 in #exercise

每月下载量 45 次

MIT 许可证

4.5MB
944 代码行

包含 (ELF 可执行文件/库, 12MB) sio2jail

烤面包机

Crates.io Crates.io Crates.io

一个简单的烤面包机测试器,用于竞赛编程练习的 C++ 解决方案

用法

Usage: toster [OPTIONS] <FILENAME>

Arguments:
  <FILENAME>  The name of the file containing the source code or the executable you want to test

Options:
  -i, --in <IN>
          Input directory [default: in]
      --in-ext <IN_EXT>
          Input file extension [default: .in]
  -o, --out <OUT>
          Output directory [default: out]
      --out-ext <OUT_EXT>
          Output file extension [default: .out]
      --io <IO>
          The input and output directory (sets both -i and -o at once)
  -c, --checker <CHECKER>
          The C++ source code or executable of a checker program that verifies if the tested program's output is correct instead of comparing it with given output files
          The checker must use the following protocol:
          - The checker receives the contents of the input file and the output of the tested program on stdin, separated by a single "\n" character
          - The checker outputs "C" if the output is correct, or "I <OPTIONAL_DATA>" if the output is incorrect. The optional data can include any information useful for understanding why the output is wrong and will be shown when errors are displayed
  -t, --timeout <TIMEOUT>
          The number of seconds after which a test or generation (or checker if you're using the --checker flag) times out if the program does not return. WARNING: if you're using the sio2jail flag, this timeout will still work based on time measured directly by toster, not time measured by sio2jail [default: 5]
      --compile-timeout <COMPILE_TIMEOUT>
          The number of seconds after which compilation times out if it doesn't finish [default: 10]
      --compile-command <COMPILE_COMMAND>
          The command used to compile the file. <IN> gets replaced with the path to the source code file, <OUT> is the executable output location [default: "g++ -std=c++20 -O3 -static <IN> -o <OUT>"]
  -s, --sio2jail
          Makes toster use sio2jail for measuring program runtime and memory use more accurately. By default limits memory use to 1 GiB. WARNING: enabling this flag can significantly slow down testing
  -m, --memory-limit <MEMORY_LIMIT>
          Sets a memory limit (in KiB) for the executed program and enables the sio2jail flag. WARNING: enabling this flag can significantly slow down testing
  -g, --generate
          Makes toster generate output files in the output directory instead of comparing the program's output with the files in the output directory
  -h, --help
          Print help
  -V, --version
          Print version

编译器

如果您正在使用 sio2jail 功能,并希望确保您的 toster 测量值与比赛中的 sio2 完全相同,您需要确保您使用与 sio 中相同的编译器版本。截至 XXXI OI,波兰信息学奥林匹克竞赛中使用的编译器是 G++ 12.2(详细信息见此处)。如果您想安装 G++ 12.2,可以通过从头构建它来完成(例如使用此脚本,只需更改版本)。您还可以从此处下载我预先构建的 G++ 版本

许可证

烤面包机采用MIT 许可证

依赖项

此项目使用 sio2jail,一个采用 MIT 许可证的可用项目

依赖项

~11–26MB
~360K SLoC