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

tests1.exeにプリコンパイル済みヘッダーを導入する #2006

Merged

Conversation

berryzplus
Copy link
Contributor

PR対象

  • テストコード

カテゴリ

  • 改善

PR の背景

テストプロジェクトでプリコンパイル済みヘッダーの作成と使用が有効になっていません。
このため、テストプロジェクトのビルドに時間がかかっています。

仕様・動作説明

テストプロジェクトの設定を変更し、プリコンパイル済みヘッダーを作成して使用するようにします。

  • 本体のプリコンパイル済みヘッダー StdAfx.h を参照する pch.h を追加します。
  • テストプロジェクトの固有設定として gmock/gmock.h を追加インクルードします。
  • プリコンパイル済みヘッダー作成用に pch.cpp を追加します。
  • テストプロジェクトの全cppファイルで pch.h をインクルードします。
    gmock/gmock.h または gtest/gtest.h のインクルードは pch.h で置換します。
    pch.h の導入によって不要となるインクルードがありますが、ややこしくなるので一旦放置します。

PR の影響範囲

テストプロジェクトのビルド時間に影響します。

テスト内容

テストプロジェクトがビルドできることを確認します。

レビュー確認としてはCIビルドの成功をもって確認でよいと思います。

関連 issue, PR

参考資料

@AppVeyorBot
Copy link

@suconbu suconbu self-assigned this Mar 2, 2025
@suconbu suconbu self-requested a review March 2, 2025 07:43
@suconbu suconbu removed their assignment Mar 2, 2025
Copy link
Member

@suconbu suconbu left a comment

Choose a reason for hiding this comment

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

問題ないと思います。

@suconbu
Copy link
Member

suconbu commented Mar 2, 2025

手元の環境※でクリーンビルドの所要時間を測ってみました。
※ CPU:Intel Core i7-1260P (16スレッド) ストレージ:NVMe SSD

対象 ソリューション全体※1 うちtests1プロジェクト※2
対応前 (6abc134) 86s 52s
本PR対応後 38s 12s

※1 ビルドログ末尾の経過時間で確認
※2 tests1 のビルド前/後イベントで %time% 値を出力し算出

@berryzplus
Copy link
Contributor Author

レビューありがとうございます。マージしてしまいます。

@berryzplus berryzplus merged commit 1f6e269 into sakura-editor:master Mar 2, 2025
25 checks passed
@berryzplus berryzplus deleted the feature/add_pch_for_tests1 branch March 2, 2025 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants