[WIP] 結果比較用のシェルスクリプトなどを追加 #6
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
以下のPRによって
birdsコマンドの動作が変わったりしないことを確認をするために使ったシェルスクリプトです:benchmark.shオプショナルな引数を取れるようになっており,その引数のディレクトリにベンチマークプログラムの変換結果などを出力します(デフォルトは
resultsで,これは従来の挙動と同じ).例えば以下だと
results-foo/以下に結果が出力されます:$ ./benchmark.sh results-foocompare_results.sh2つの結果
<DIR1>と<DIR2>を比較するためのスクリプト.以下のいずれかの形式の引数をとる:list: 結果として出力されたSQLファイルの相対パス一覧を表示する.check <REL-PATH>: 相対パス<REL-PATH>に出力されたファイルを<DIR1>と<DIR2>とで比べる.<DIFF-CMD>にdiffをとるのに使うコマンドを与えることができ,省略した場合は単にdiffが使われる.check_all: 出力された全てのSQLファイルを<DIR1>と<DIR2>とで比べる.例えば,従来の実装による結果を
results-develop/に,新しい実装による結果をresults-ir/に出力した後,それぞれのgensql/case-study/ced.sqlのパスにあるファイルを比較するには以下のように実行します(icdiffはdiffをとるツールのひとつ):$ ./compare_results.sh results-develop results-ir check gensql/case-study/ced.sql icdiffsee_results.sh出力されたログファイルを比較するためのスクリプト.以下のいずれかの形式の引数をとる:
see_log: 結果<DIR>以下の正常ログファイルの中身を全て表示する.see_err: 結果<DIR>以下のエラーログファイルの中身を全て表示する.diff_log: 結果<DIR1>と<DIR2>とでそれぞれ対応する正常ログファイルのdiffをとって表示する.diff_err: 結果<DIR1>と<DIR2>とでそれぞれ対応するエラーログファイルのdiffをとって表示する.上記PRでどのように使ったか
./compare_results.shを使っていくつかの出力されたSQLファイルのdiffを表示し,問題なさそうな差分であることを目視で確かめた./see_results.shを使って正常ログ・エラーログともに全くdiffがないことを確かめた