Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

test: add unit tests for ctrace::RunDirectory

オープン 初心者向け
#164 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@tecnolgd がすでに取り組んでいます。

2026年10月13日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cmake, cpp
領域
testing

調査の方向性

TestReportのパターンを確認するためにtests/tool_output_tests.cppを読み、動作を理解するためにinclude/Process/Tools/RunDirectory.hppを調べてください。列挙された構築、パス、一意性、クリーンアップのケースを対象にtests/run_directory_tests.cppを追加し、実行ファイルとテストをCMakeLists.txtに登録してください。ファイル末尾にある両方のリストにも登録します。ctest -L unitを実行してください。ディレクトリにファイルやサブディレクトリが含まれる場合のクリーンアップも含め、新しいテストがすべて成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

good first issue test

ctrace::RunDirectory (include/Process/Tools/RunDirectory.hpp) gives each tool run its own temporary directory (created with mkdtemp, removed in the destructor). It has no direct unit tests.

To do: add tests/run_directory_tests.cpp covering:

  • the directory exists right after construction;
  • it is located under std::filesystem::temp_directory_path(), and its name starts with the given prefix followed by -;
  • two instances created with the same prefix get two different paths;
  • the directory is removed when the object is destroyed, including when it still contains files and subdirectories.

How: follow the pattern of tests/tool_output_tests.cpp (a small TestReport with expect, main returns non-zero on failure). The header is header-only, so the test needs no source file. Register it in CMakeLists.txt like the other tests:

add_executable(ctrace_run_directory_tests tests/run_directory_tests.cpp)
add_test(NAME ctrace_run_directory_tests COMMAND ctrace_run_directory_tests)

and add ctrace_run_directory_tests to the two lists at the end of CMakeLists.txt: coretrace_unit_tests (so ctest -L unit runs it) and the foreach(coretrace_target ...) list of executables.

主要言語
C++
スター
5
フォーク
4
平均マージ
1時間 4分
マージ済み PR(30日)
71

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CoreTrace/coretrace のほかの issue

CoreTrace/coretrace の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。