re-import sources as agreed with the maintainer

This commit is contained in:
Adam Samalik 2023-06-29 18:25:45 +02:00
parent d93251d02e
commit cccc1061bc
3 changed files with 49 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/libgit2-glib-0.26.4.tar.xz
/libgit2-glib-0.26.0.tar.xz
/libgit2-glib-0.26.4.tar.xz

33
tests/scripts/run_tests Executable file
View File

@ -0,0 +1,33 @@
#!/usr/bin/python3
""" Make sure that libgit2-glib works correctly
"""
import gi
gi.require_version("Ggit", "1.0")
from gi.repository import Ggit as Git
from gi.repository import Gio
import os
import tempfile
def test_libgit2(git_path):
"""Test libgit2"""
Git.init()
repo = Git.Repository.init_repository(Gio.file_new_for_path(git_path), True)
# Make an initial empty commit
sig = Git.Signature.new_now("bdcs-api-server", "user-email")
tree_id = repo.get_index().write_tree()
tree = repo.lookup(tree_id, Git.Tree)
repo.create_commit("HEAD", sig, sig, "UTF-8", "Initial commit", tree, [])
commit_id = repo.revparse("master").get_id()
commit = repo.lookup(commit_id, Git.Commit)
message = commit.get_message()
if message != "Initial commit":
print("ERROR: Problem with Initial commit: %s" % message)
os.exit(1)
if __name__=='__main__':
with tempfile.TemporaryDirectory(prefix="test.libgit2.") as git_repo:
test_libgit2(git_repo)

15
tests/tests.yml Normal file
View File

@ -0,0 +1,15 @@
---
# Run a simple test
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
required_packages:
- python36
tests:
- simple:
dir: scripts
run: ./run_tests