Skip to content

Conversation

penpenpng
Copy link
Contributor

恥ずかしながらテストの仕組みがよく分からなかったので、テストコードに手を付けられていません。
必要ならばテストケースの追加作業も行いますので、アドバイスいただけないでしょうか?

@kyuridenamida
Copy link
Owner

こんにちは @penpenpng さん! PRありがとうございます。
弄るテストはtest_codegen.pyです。まずテストの実行方法ですが、atcoder-toolsのプロジェクトルートディレクトリで

 nosetests tests/test_codegen.py

を実行すればテストが走るはずです。

やることは確か以下の通りです。あとでもっかいみなおします。すみません。
[1]
test_float_case, test_long_case, test_two_dimensional_case, ..., をテストが通るまで修正してください。
resources/test_codegen/*/d/generated.txtに色々な期待されるコードを書く必要があるはずです。

[2]
test_default_code_generators_and_templatesを修正してください。

テストの時にコンパイラとコンパイルを必要とするので、以下の作業を行ってください。

  1. _compile_command関数に実行ファイルを作るためのコンパイルコマンドを書く
  2. _exec_file_and_args関数に実行コマンド列のリストを書く。
  3. resources/test_codegen/test_default_code_generators_and_templatesにD言語のechoプログラムを追加してください。
  4. CircleCIがテストをする時に必要なので、travis.ymlのbefore_installのところにD言語のコンパイラをインストールするためのコマンドを書いてください。

@penpenpng
Copy link
Contributor Author

アドバイスありがとうございます!
なんとなくの雰囲気は理解できましたので、少し手元で作業してみようと思います。

@kyuridenamida kyuridenamida mentioned this pull request Aug 4, 2019
@codecov-io
Copy link

codecov-io commented Aug 15, 2019

Codecov Report

Merging #145 into master will increase coverage by 0.32%.
The diff coverage is 96.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #145      +/-   ##
==========================================
+ Coverage   89.24%   89.57%   +0.32%     
==========================================
  Files          51       52       +1     
  Lines        2353     2465     +112     
==========================================
+ Hits         2100     2208     +108     
- Misses        253      257       +4
Impacted Files Coverage Δ
atcodertools/tools/tester.py 87.41% <100%> (+0.34%) ⬆️
atcodertools/common/language.py 96.77% <100%> (+0.1%) ⬆️
atcodertools/codegen/code_generators/d.py 96.26% <96.26%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 163237c...6ea9b14. Read the comment docs.

@kyuridenamida
Copy link
Owner

Cool! かなりいい感じです! CRします!

Copy link
Owner

@kyuridenamida kyuridenamida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ほぼいい感じです。あとはテストを追加してくださればマージします。

@kyuridenamida
Copy link
Owner

すみません。最近のnim言語の追加でmerge conflictが起きてしまったので、修正をおねがいします。

@kyuridenamida kyuridenamida merged commit 7826e9b into kyuridenamida:master Aug 17, 2019
@penpenpng
Copy link
Contributor Author

丁寧に案内していただきありがとうございました!

@kyuridenamida kyuridenamida added this to the 1.1.5 milestone Aug 19, 2019
@kyuridenamida kyuridenamida changed the title D言語用のジェネレータとテンプレートを追加 Support DLang Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants