Skip to content

プロセス起動同期の仕組みを本体に入れる - #2899

Merged
berryzplus merged 12 commits into
sakura-editor:masterfrom
berryzplus:feature/add_sync_wrappers
Nov 21, 2026
Merged

berryzplus merged 12 commits into
sakura-editor:masterfrom
berryzplus:feature/add_sync_wrappers

Conversation

@berryzplus

@berryzplus berryzplus commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

PR対象

  • アプリ(サクラエディタ本体)
  • テストコード

カテゴリ

  • 改善

PR の背景

仕様・動作説明

  • テストコードに実装していた同期クラス群をアプリ実装に統合します。
    • cxx::HandleHolder 同期ハンドルのラッパー
    • cxx::ProcessHolder 起動したプロセスのラッパー
    • cxx::EditorProcessHolder 起動したエディタプロセスのラッパー
  • MinGW-w64 の cppchek が提供終了したようなので、cppcheck/doxygen を UCRT版 に移行します。
  • CIでの実行が不安定なテストケース WinMainFuncTest.CreateEditorProcess120 を一時的に無効化します。
    (テストから複数プロセスを起動できることが前提のテストなのでそのうち対応します。)

サクラエディタ内で使うプロセス起動には
従来通り CControlTray::OpenNewEditor を使えます。
(たぶん、使わないほうがよい、なのだけど「変更しなくてよい」にしました。)

  • CControlTray::OpenNewEditor 既存関数。
  • ProcessHolder::CreateEditorProcess 新設(テストから移植)。エディタプロセス起動用関数。
    呼出側で細かい同期ができるようにした。(🌟この Pull Request の主題。)
  • ProcessHolder::CreateSakuraProcess 新設(テストから移植)。サクラエディタ起動用関数。
  • ProcessHolder::CreateProcessW 新設(テストから移植)。汎用の外部プログラム起動関数。
  • Kernel32::CreateProcessW 新設。Windows APIのラッパー関数。
  • CNormalProcess::InitializeProcess 既存。エディタプロセス起動時に呼ばれる関数。
    初期化処理中に Grep や マクロ実行 などの「ある程度時間のかかる処理」を呼び出す構造になっていて、「プロセス初期化完了」と「コマンドラインで指定した処理の完了」を区別しづらい問題がある。

本件、勝手にやります。

PR の影響範囲

  • コマンドライン長が「独自仕様の制限値」を超える場合に、コマンドラインオプションの一部を一時ファイルに退避する処理の発動条件を微妙に変えています。(CControlTray::OpenNewEditorにある処理。)

テスト内容

関連 issue, PR

参考資料

@github-actions

Copy link
Copy Markdown

Test Results

2 115 tests  +13   2 115 ✅ +13   12m 42s ⏱️ +32s
  180 suites + 1       0 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

Results for commit 6d44f21. ± Comparison against base commit 5bb1b25.

This pull request removes 3 and adds 16 tests. Note that renamed tests count towards both.
User32 ‑ TrackPopupMenu
WinMainFuncTest ‑ CreateEditorProcess120
WinMainFuncTest ‑ DISABLED_CreateEditorProcess103
Kernel32 ‑ CControlTrayOpenNewEditor101
Kernel32 ‑ CControlTrayOpenNewEditor102
Kernel32 ‑ HandleHolder101
Kernel32 ‑ HandleHolder102
Kernel32 ‑ HandleHolder103
Kernel32 ‑ ProcessHolderCreateProcessW101
Kernel32 ‑ WaitForMultipleObjects101
QuoteArg ‑ test001
QuoteArg ‑ test002
QuoteArg ‑ test003
…

@sonarqubecloud

sonarqubecloud Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

@berryzplus
berryzplus merged commit 283cc63 into sakura-editor:master Nov 21, 2026
18 of 20 checks passed
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.

#1-7. 起動のテストが、製品の待ちの処理を写して書いている

1 participant