Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
25bc84fb
Commit
25bc84fb
authored
Nov 16, 2021
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: move clar into separate directory
parent
3344fddc
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
16 additions
and
13 deletions
+16
-13
tests/README.md
+4
-2
tests/clar/clar.c
+0
-0
tests/clar/clar.h
+0
-0
tests/clar/clar/fixtures.h
+0
-0
tests/clar/clar/fs.h
+0
-0
tests/clar/clar/print.h
+0
-0
tests/clar/clar/sandbox.h
+0
-0
tests/clar/clar/summary.h
+0
-0
tests/clar/clar_libgit2.c
+0
-0
tests/clar/clar_libgit2.h
+0
-0
tests/clar/clar_libgit2_timer.c
+0
-0
tests/clar/clar_libgit2_timer.h
+0
-0
tests/clar/clar_libgit2_trace.c
+0
-0
tests/clar/clar_libgit2_trace.h
+0
-0
tests/clar/generate.py
+0
-0
tests/clar/main.c
+0
-0
tests/libgit2/CMakeLists.txt
+8
-7
tests/libgit2/remote/fetch.c
+4
-4
No files found.
tests/README.md
View file @
25bc84fb
...
...
@@ -2,9 +2,11 @@
These are the unit and integration tests for the libgit2 projects.
*
`libgit2`
*
`clar`
This is
[
clar
](
https://github.com/clar-test/clar
)
the common test framework.
*
`libgit2`
These tests exercise the core git functionality in libgit2 itself.
*
`resources`
*
`resources`
These are the resources for the tests, including files and git
repositories.
...
...
tests/
libgit2
/clar.c
→
tests/
clar
/clar.c
View file @
25bc84fb
File moved
tests/
libgit2
/clar.h
→
tests/
clar
/clar.h
View file @
25bc84fb
File moved
tests/
libgit2
/clar/fixtures.h
→
tests/
clar
/clar/fixtures.h
View file @
25bc84fb
File moved
tests/
libgit2
/clar/fs.h
→
tests/
clar
/clar/fs.h
View file @
25bc84fb
File moved
tests/
libgit2
/clar/print.h
→
tests/
clar
/clar/print.h
View file @
25bc84fb
File moved
tests/
libgit2
/clar/sandbox.h
→
tests/
clar
/clar/sandbox.h
View file @
25bc84fb
File moved
tests/
libgit2
/clar/summary.h
→
tests/
clar
/clar/summary.h
View file @
25bc84fb
File moved
tests/
libgit2
/clar_libgit2.c
→
tests/
clar
/clar_libgit2.c
View file @
25bc84fb
File moved
tests/
libgit2
/clar_libgit2.h
→
tests/
clar
/clar_libgit2.h
View file @
25bc84fb
File moved
tests/
libgit2
/clar_libgit2_timer.c
→
tests/
clar
/clar_libgit2_timer.c
View file @
25bc84fb
File moved
tests/
libgit2
/clar_libgit2_timer.h
→
tests/
clar
/clar_libgit2_timer.h
View file @
25bc84fb
File moved
tests/
libgit2
/clar_libgit2_trace.c
→
tests/
clar
/clar_libgit2_trace.c
View file @
25bc84fb
File moved
tests/
libgit2
/clar_libgit2_trace.h
→
tests/
clar
/clar_libgit2_trace.h
View file @
25bc84fb
File moved
tests/
libgit2
/generate.py
→
tests/
clar
/generate.py
View file @
25bc84fb
File moved
tests/
libgit2
/main.c
→
tests/
clar
/main.c
View file @
25bc84fb
File moved
tests/libgit2/CMakeLists.txt
View file @
25bc84fb
...
...
@@ -8,8 +8,9 @@ if(NOT PYTHONINTERP_FOUND)
"Make sure python is available, or pass -DBUILD_TESTS=OFF to skip building the tests"
)
ENDIF
()
set
(
CLAR_PATH
"
${
PROJECT_SOURCE_DIR
}
/tests/clar"
)
set
(
CLAR_FIXTURES
"
${
PROJECT_SOURCE_DIR
}
/tests/resources/"
)
set
(
CLAR
_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
set
(
TEST
_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
add_definitions
(
-DCLAR_FIXTURE_PATH=\
"
${
CLAR_FIXTURES
}
\"
)
add_definitions(-DCLAR_TMPDIR=
\"
libgit2_tests
\"
)
add_definitions(-DCLAR_WIN32_LONGPATHS)
...
...
@@ -18,19 +19,19 @@ add_definitions(-D_FILE_OFFSET_BITS=64)
# Ensure that we do not use deprecated functions internally
add_definitions(-DGIT_DEPRECATE_HARD)
set(TEST_INCLUDES "
${
CLAR_PATH
}
" "
${
CMAKE_CURRENT_BINARY_DIR
}
")
file(GLOB_RECURSE SRC_TEST
${
CLAR_PATH
}
/*/*.c
${
CLAR
_PATH
}
/*/*.h)
set(SRC_CLAR "
main.c
" "
clar_libgit2.c
" "
clar_libgit2_trace.c
" "
clar_libgit2_timer.c
" "
clar.c
"
)
set(TEST_INCLUDES "
${
CLAR_PATH
}
" "
${
TEST_PATH
}
" "
${
CMAKE_CURRENT_BINARY_DIR
}
")
file(GLOB_RECURSE SRC_TEST
${
TEST_PATH
}
/*/*.c
${
TEST
_PATH
}
/*/*.h)
file(GLOB_RECURSE SRC_CLAR
${
CLAR_PATH
}
/*.c
${
CLAR_PATH
}
/*.h
)
if(MSVC_IDE)
list(APPEND SRC_
CLAR
"
precompiled.c
")
list(APPEND SRC_
TEST
"
precompiled.c
")
endif()
add_custom_command(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/clar.suite
${
CMAKE_CURRENT_BINARY_DIR
}
/clar_suite.h
COMMAND
${
PYTHON_EXECUTABLE
}
generate.py -o "
${
CMAKE_CURRENT_BINARY_DIR
}
" -f -xonline -xstress -xperf .
COMMAND
${
PYTHON_EXECUTABLE
}
${
CLAR_PATH
}
/
generate.py -o "
${
CMAKE_CURRENT_BINARY_DIR
}
" -f -xonline -xstress -xperf .
DEPENDS
${
SRC_TEST
}
WORKING_DIRECTORY
${
CLAR
_PATH
}
WORKING_DIRECTORY
${
TEST
_PATH
}
)
set_source_files_properties(
...
...
tests/libgit2/remote/fetch.c
View file @
25bc84fb
#include "
../
clar_libgit2.h"
#include "clar_libgit2.h"
#include "remote.h"
#include "repository.h"
...
...
@@ -82,9 +82,9 @@ static void do_time_travelling_fetch(git_oid *commit1id, git_oid *commit2id,
cl_git_pass
(
git_treebuilder_write
(
&
empty_tree_id
,
tb
));
cl_git_pass
(
git_tree_lookup
(
&
empty_tree
,
repo1
,
&
empty_tree_id
));
cl_git_pass
(
git_signature_default
(
&
sig
,
repo1
));
cl_git_pass
(
git_commit_create
(
commit1id
,
repo1
,
REPO1_REFNAME
,
sig
,
cl_git_pass
(
git_commit_create
(
commit1id
,
repo1
,
REPO1_REFNAME
,
sig
,
sig
,
NULL
,
"one"
,
empty_tree
,
0
,
NULL
));
cl_git_pass
(
git_commit_create_v
(
commit2id
,
repo1
,
REPO1_REFNAME
,
sig
,
cl_git_pass
(
git_commit_create_v
(
commit2id
,
repo1
,
REPO1_REFNAME
,
sig
,
sig
,
NULL
,
"two"
,
empty_tree
,
1
,
commit1id
));
git_tree_free
(
empty_tree
);
...
...
@@ -118,7 +118,7 @@ static void do_time_travelling_fetch(git_oid *commit1id, git_oid *commit2id,
git_reference
*
ref
;
git_reference
*
ref2
;
cl_git_pass
(
git_reference_lookup
(
&
ref
,
repo1
,
REPO1_REFNAME
));
cl_git_pass
(
git_reference_set_target
(
&
ref2
,
ref
,
commit1id
,
cl_git_pass
(
git_reference_set_target
(
&
ref2
,
ref
,
commit1id
,
"rollback"
));
git_reference_free
(
ref
);
git_reference_free
(
ref2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment