KiCad PCB EDA Suite
Loading...
Searching...
No Matches
git_test_fixture.h File Reference
#include <boost/test/unit_test.hpp>
#include <git/kicad_git_memory.h>
#include <qa_utils/file_utils.h>
#include <qa_utils/scoped_git_backend.h>
#include <wx/file.h>
#include <wx/filename.h>
#include <filesystem>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  KI_TEST::SCOPED_GIT_CONFIG_SEARCH_PATH
 Point every config level above the repository at one directory, restoring the previous paths afterwards. More...
 
class  KI_TEST::GIT_TEST_FIXTURE
 Give each test a backend and a temporary directory. More...
 

Namespaces

namespace  KI_TEST
 Test utilities for timestamps.
 

Functions

KIGIT::GitRepositoryPtr KI_TEST::InitGitRepository (const wxString &aPath, const char *aBranch="main", const char *aAuthorName="QA Test", const char *aAuthorEmail="[email protected]")
 Pin the branch and author so repository setup does not depend on the user's Git config.
 
void KI_TEST::WriteGitFile (const wxString &aRepoPath, const wxString &aRelativePath, const std::string &aContents)
 Write test data without staging it. Create parent directories when needed.
 
git_oid KI_TEST::CommitGitIndex (git_repository *aRepo, const wxString &aMessage)
 Commit the current index, using HEAD as the parent when it exists.
 
git_oid KI_TEST::CommitGitFile (git_repository *aRepo, const wxString &aPath, const wxString &aMessage)
 Stage one file and commit the index. Other staged changes are kept.
 
git_oid KI_TEST::CommitAllGitFiles (git_repository *aRepo, const wxString &aMessage)
 Stage all changes, including deletions, and commit them.