mirror of
				https://git.proxmox.com/git/libgit2
				synced 2025-11-04 03:05:04 +00:00 
			
		
		
		
	Added test program.
This commit is contained in:
		
							parent
							
								
									a62d294cd9
								
							
						
					
					
						commit
						1e2f615217
					
				
							
								
								
									
										30
									
								
								debian/tests/CMakeLists.txt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								debian/tests/CMakeLists.txt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,30 @@
 | 
			
		||||
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
 | 
			
		||||
PROJECT (libgit2_test)
 | 
			
		||||
 
 | 
			
		||||
ADD_EXECUTABLE (libgit2_test libgit2_test.c)
 | 
			
		||||
 | 
			
		||||
FIND_PACKAGE(PkgConfig)
 | 
			
		||||
 | 
			
		||||
PKG_CHECK_MODULES(PC_LIBGIT2 libgit2)
 | 
			
		||||
 | 
			
		||||
SET(LIBGIT2_DEFINITIONS ${PC_LIBGIT_CFLAGS_OTHER})
 | 
			
		||||
 | 
			
		||||
FIND_PATH(LIBGIT2_INCLUDE_DIR git2.h
 | 
			
		||||
          HINTS ${PC_LIBGIT_INCLUDEDIR} ${PC_LIBGIT_INCLUDE_DIRS}
 | 
			
		||||
          PATH_SUFFIXES libgit2 )
 | 
			
		||||
 | 
			
		||||
FIND_LIBRARY(LIBGIT2_LIBRARY NAMES git2 libgit2
 | 
			
		||||
             HINTS ${PC_LIBGIT_LIBDIR} ${PC_LIBGIT_LIBRARY_DIRS} )
 | 
			
		||||
 | 
			
		||||
SET(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARY} )
 | 
			
		||||
SET(LIBGIT2_INCLUDE_DIRS ${LIBGIT2_INCLUDE_DIR} )
 | 
			
		||||
 | 
			
		||||
INCLUDE(FindPackageHandleStandardArgs)
 | 
			
		||||
 | 
			
		||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibGit2  DEFAULT_MSG
 | 
			
		||||
                                  LIBGIT2_LIBRARY LIBGIT2_INCLUDE_DIR)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
mark_as_advanced(LIBGIT2_INCLUDE_DIR LIBGIT2_LIBRARY )
 | 
			
		||||
include_directories(${LIBGIT2_INCLUDE_DIR})
 | 
			
		||||
target_link_libraries (libgit2_test ${LIBGIT2_LIBRARY})
 | 
			
		||||
							
								
								
									
										12
									
								
								debian/tests/libgit2_test.c
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								debian/tests/libgit2_test.c
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <git2.h>
 | 
			
		||||
 | 
			
		||||
int main (int argc, char** argv)
 | 
			
		||||
{
 | 
			
		||||
  int major = 0;
 | 
			
		||||
  int minor = 0;
 | 
			
		||||
  int rev = 0;
 | 
			
		||||
  git_libgit2_version(&major, &minor, &rev);
 | 
			
		||||
  printf("Version %d.%d.%d\n", major, minor, rev);
 | 
			
		||||
  return 0;
 | 
			
		||||
};
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user