KiCad PCB EDA Suite
Loading...
Searching...
No Matches
GIT_COMPARE_FIXTURE Struct Reference

Build a temp working repo with two commits. More...

Inheritance diagram for GIT_COMPARE_FIXTURE:
KI_TEST::GIT_TEST_FIXTURE

Public Member Functions

 GIT_COMPARE_FIXTURE ()
 
void writeFile (const wxString &aFile, const wxString &aContent)
 Write a file in the working tree.
 
void removeFile (const wxString &aFile)
 
void commitAll (const wxString &aMessage)
 Stage every change, including deletions, and create a commit on HEAD.
 
git_repository * repo () const
 
const wxString & TempPath () const
 
LIBGIT_BACKEND * Backend () const
 

Private Member Functions

void initRepo ()
 

Static Private Member Functions

static wxString toWxString (const std::filesystem::path &aPath)
 

Private Attributes

KIGIT::GitRepositoryPtr m_repo
 
wxString m_repoPath
 
SCOPED_GIT_BACKEND m_backend
 
SCOPED_TEMP_DIR m_tempDir
 
SCOPED_TEMP_DIR m_configDir
 
SCOPED_GIT_CONFIG_SEARCH_PATH m_configSearchPath
 
wxString m_tempPath
 

Detailed Description

Build a temp working repo with two commits.

The first commit adds a.txt and b.txt. The second modifies a.txt, deletes b.txt and adds c.txt. This lets a compare of HEAD~1..HEAD exercise modified / removed / added deltas.

Definition at line 51 of file test_git_compare_handler.cpp.

Constructor & Destructor Documentation

◆ GIT_COMPARE_FIXTURE()

GIT_COMPARE_FIXTURE::GIT_COMPARE_FIXTURE ( )
inline

Member Function Documentation

◆ Backend()

LIBGIT_BACKEND * KI_TEST::GIT_TEST_FIXTURE::Backend ( ) const
inlineinherited

Definition at line 97 of file git_test_fixture.h.

References m_backend.

◆ commitAll()

void GIT_COMPARE_FIXTURE::commitAll ( const wxString & aMessage)
inline

Stage every change, including deletions, and create a commit on HEAD.

Definition at line 74 of file test_git_compare_handler.cpp.

References KI_TEST::CommitAllGitFiles(), and m_repo.

Referenced by initRepo().

◆ initRepo()

void GIT_COMPARE_FIXTURE::initRepo ( )
inlineprivate

◆ removeFile()

void GIT_COMPARE_FIXTURE::removeFile ( const wxString & aFile)
inline

Definition at line 67 of file test_git_compare_handler.cpp.

References m_repoPath.

Referenced by initRepo().

◆ repo()

git_repository * GIT_COMPARE_FIXTURE::repo ( ) const
inline

Definition at line 77 of file test_git_compare_handler.cpp.

References git_repository, and m_repo.

◆ TempPath()

const wxString & KI_TEST::GIT_TEST_FIXTURE::TempPath ( ) const
inlineinherited

◆ toWxString()

static wxString KI_TEST::GIT_TEST_FIXTURE::toWxString ( const std::filesystem::path & aPath)
inlinestaticprivateinherited

Definition at line 100 of file git_test_fixture.h.

Referenced by GIT_TEST_FIXTURE().

◆ writeFile()

void GIT_COMPARE_FIXTURE::writeFile ( const wxString & aFile,
const wxString & aContent )
inline

Write a file in the working tree.

Definition at line 61 of file test_git_compare_handler.cpp.

References m_repoPath, and KI_TEST::WriteGitFile().

Referenced by initRepo().

Member Data Documentation

◆ m_backend

SCOPED_GIT_BACKEND KI_TEST::GIT_TEST_FIXTURE::m_backend
privateinherited

Definition at line 110 of file git_test_fixture.h.

Referenced by Backend().

◆ m_configDir

SCOPED_TEMP_DIR KI_TEST::GIT_TEST_FIXTURE::m_configDir
privateinherited

Definition at line 112 of file git_test_fixture.h.

Referenced by GIT_TEST_FIXTURE().

◆ m_configSearchPath

SCOPED_GIT_CONFIG_SEARCH_PATH KI_TEST::GIT_TEST_FIXTURE::m_configSearchPath
privateinherited

Definition at line 113 of file git_test_fixture.h.

Referenced by GIT_TEST_FIXTURE().

◆ m_repo

KIGIT::GitRepositoryPtr GIT_COMPARE_FIXTURE::m_repo
private

Definition at line 96 of file test_git_compare_handler.cpp.

Referenced by commitAll(), initRepo(), and repo().

◆ m_repoPath

wxString GIT_COMPARE_FIXTURE::m_repoPath
private

Definition at line 97 of file test_git_compare_handler.cpp.

Referenced by GIT_COMPARE_FIXTURE(), initRepo(), removeFile(), and writeFile().

◆ m_tempDir

SCOPED_TEMP_DIR KI_TEST::GIT_TEST_FIXTURE::m_tempDir
privateinherited

Definition at line 111 of file git_test_fixture.h.

Referenced by GIT_TEST_FIXTURE().

◆ m_tempPath

wxString KI_TEST::GIT_TEST_FIXTURE::m_tempPath
privateinherited

Definition at line 114 of file git_test_fixture.h.

Referenced by GIT_TEST_FIXTURE(), and TempPath().


The documentation for this struct was generated from the following file: