Skip to content

tsutsun17/test_tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test_tool

これはc++用のatcoderの自動テストツールです。

目次

できること

  1. g++(c++14)でコンパイルし実行。
  2. テストケースを全て試す。
  3. 自分の書いたコードの提出。

~/test_tool/code/ABC/abc129
$ ttest A

[1]
(入力)
1 3 4

(実際の出力)
4

(理想の出力)
4

---------- OK ----------

[2]
(入力)
3 2 3

(実際の出力)
5

(理想の出力)
5

---------- OK ----------

提出しますか?(y/n)
y


提出が完了しました!!!!!!!

ご使用前に

gcc動作環境の構築

こちらを参考にさせていただきました。
stdc++.hを作成しておいてください。

config.pyの作成

  1. $ touch config.py
  2. $ open config.py
  3. config.py
    USERNAME = your_username
    PASSWORD = your_password
    

エイリアスを指定する

  1. $ open ~/.bash_profile
  2. bash_profile
    alias ttest="python ../../../test.py"
    
  3. $ source ~/.bash_profile

使い方

  1. ~/test_tool$ python scraping.py を実行し、コンテストのトップページのURLを入力する。

    $ python scraping.py
                                                                                         
                   .___________. _______     _______.___________.                        
                   |           ||   ____|   /       |           |                        
                   `---|  |----`|  |__     |   (----`---|  |----`                        
                       |  |     |   __|     \   \       |  |                             
                       |  |     |  |____.----)   |      |  |                             
                       |__|     |_______|_______/       |__|                            
    
     コンテストのURLを入力してください。
     url: https://atcoder.jp/contests/abc129
    
    
     少々お待ちください。
    
     100%|████████████████████████████████████████████████████| 11/11 [00:00<00:00, 14.15it/s]
     cd code/ABC/abc129
     問題にとりかかってください。
    
    
  2. $ cd code/{CONTEST_CATEGORY}/{CONTEST_NAME}

    $ cd code/ABC/abc132

  3. 必死こいてコードを書く。

  4. $ ttest {LEVEL} [-wt] [-s] [-h]

    $ atcoder A -wt

コマンドライン引数

$ ttest {LEVEL} [-wt] [-s] [-h]

LEVEL (必須)

問題の難易度(A, B, C, Dなど)を指定。

-wt (--without_test)

テストケースを通さずに実行。コンパイル、実行して入力待ちの状態になる。

-s (--submit)

テストケースを全てACした時、-wt オプション時に強制的に提出する。

$ ttest -h
usage: ttest [-h] [-wt] [-s] level

atcoder用のc++のコンパイルと実行の簡略化と自動テストと提出

positional arguments:
  level                A, B, C, D, E, Fなどの問題のレベル(大文字で)

optional arguments:
  -h, --help           show this help message and exit
  -wt, --without_test  テストケースを通さず、自分で入力をする
  -s, --submit         提出の許可をいちいち取らない

About

atcoderの自動テストツール *リファクタリングします

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages