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

Collect examples #141

Open
kmyk opened this issue Aug 4, 2021 · 1 comment
Open

Collect examples #141

kmyk opened this issue Aug 4, 2021 · 1 comment
Labels
good first issue Good for newcomers

Comments

@kmyk
Copy link
Collaborator

kmyk commented Aug 4, 2021

Description / 説明

We want to add more Python scripts to examples/ directory. They are used for testing ($ python3 scripts/integration_tests.py).

examples/ の中に置いてある Python スクリプトは自動で実行されてテストに使われますが、これをもっと増やしたい。
日々のコンテストのついでにコツコツに追加したり、ABC の B, C あたりをまとめて Python で解いて examples/ に追加するのをしないとだめそう。

How to add a script and test cases / スクリプトとテストケース追加の手順

  1. optional: Run $ python3 scripts/add_test_cases.py URL
    • example: $ python3 scripts/add_test_cases.py https://atcoder.jp/contests/abc123_a
    • This makes template files like examples/abc123_a.py examples/data/abc123_a.sample-1.in examples/data/abc123_a.sample-1.out examples/data/abc123_a.large.generator.py examples/data/abc123_a.solver.cpp.
  2. Write a Python script (e.g. examples/abc123_a.py) which Jikka processes
  3. Write a generator of input cases (e.g. examples/data/abc123_a.large.generator.py) and an expected solution (e.g. examples/data/abc123_a.solver.cpp)
    • When you add another script for a problem which already has test cases, please edit examples/data/METADATA.json instead.
    • When you use a problem of Library Checker or Jikka Judge, please edit examples/data/METADATA.json instead.
    • optional: When you write a Python script for a non-existing problem, please consider adding it to Jikka Judge.
    • You can use Python instead for expected solutions. Delete examples/data/abc123_a.solver.cpp and create examples/data/abc123_a.solver.py
    • When the generated C++ code gets WA, move the Python script and test cases to examples/wip/. You can skip making test cases.
    • When the generated C++ code gets TLE, move the Python script to examples/wip/tle/. Scripts under examples/wip/tle/ still used to check non-WA.
  4. optional: add more test cases like examples/data/abc123_a.hand-1.in examples/data/abc123_a.hand-1.out
  5. optional: Update examples/README.md

Motivation / 動機

Testing is important.

@kmyk kmyk added help wanted Extra attention is needed good first issue Good for newcomers labels Aug 4, 2021
@kmyk kmyk pinned this issue Aug 5, 2021
@kmyk kmyk changed the title テストをもっと増やす examples/ をもっと増やす Aug 5, 2021
@kmyk kmyk changed the title examples/ をもっと増やす examples/ の中にスクリプトをたくさん追加する Aug 5, 2021
@kmyk
Copy link
Collaborator Author

kmyk commented Aug 5, 2021

https://github.com/uta8a/jikka-example こういうやつめちゃくちゃ助かる

@kmyk kmyk changed the title examples/ の中にスクリプトをたくさん追加する examples/ の中に使用例をたくさん追加する Aug 5, 2021
@kmyk kmyk changed the title examples/ の中に使用例をたくさん追加する Collect examples Sep 25, 2021
@kmyk kmyk removed the help wanted Extra attention is needed label Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant