Skip to content

Commit 7c9a153

Browse files
committed
Integrate Appveyor CI
1 parent 092bd58 commit 7c9a153

4 files changed

Lines changed: 51 additions & 3 deletions

File tree

.appveyor-script.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# For some reason, the return code of emacs isn't correctly communicated back to the script.
2+
# Instead, we store the stdout/stderr and grep for "FAILED".
3+
function Run-Test {
4+
param( $TestName )
5+
$command = "emacs --batch -L build -L test -l test-helper -l $($TestName)-test -f ert-run-tests-batch-and-exit"
6+
$output = Invoke-Expression "$command 2>&1"
7+
Write-Host $output
8+
if ($output | select-string -Pattern "FAILED") {
9+
exit 1
10+
}
11+
}
12+
13+
Run-Test -TestName "refcount"
14+
Run-Test -TestName "reference"
15+
Run-Test -TestName "repository"

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ add_subdirectory(src)
1313

1414
enable_testing()
1515

16+
# NOTE: These test names must be replicated in .appveyor-script.ps1
17+
# for the Windows CI. Fixing this is still TODO.
1618
set(EGIT_TESTS refcount reference repository)
1719

1820
foreach(test ${EGIT_TESTS})

appveyor.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
environment:
2+
matrix:
3+
- GENERATOR: "MinGW Makefiles"
4+
5+
install:
6+
- git submodule update --init --recursive
7+
# Use the chocolatey emacs64 package for testing
8+
# TODO: Any better solutions? Build Emacs ourselves? What about 64-bit?
9+
- cinst emacs64
10+
11+
before_build:
12+
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
13+
- set PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
14+
15+
build_script:
16+
- mkdir build
17+
- cd build
18+
- cmake .. -G"%GENERATOR%"
19+
- cmake --build .
20+
- cd ..
21+
22+
test_script:
23+
- ps: .\.appveyor-script.ps1

src/CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@ set_target_properties(egit2 PROPERTIES C_STANDARD 99)
55

66
# Emacs looks for .so on linux and OSX.
77
# By default CMake builds .dylib on OSX, so override that.
8-
# Windows is TODO
9-
set_target_properties(egit2 PROPERTIES SUFFIX .so)
8+
if(APPLE)
9+
set_target_properties(egit2 PROPERTIES SUFFIX .so)
10+
endif(APPLE)
11+
12+
if(WIN32)
13+
set_target_properties(egit2 PROPERTIES PREFIX lib)
14+
endif(WIN32)
1015

1116
target_link_libraries(egit2 git2)
1217
target_include_directories(egit2 SYSTEM PRIVATE "${libgit2_SOURCE_DIR}/include")
1318
target_include_directories(egit2 SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../uthash")
14-
target_compile_options(egit2 PRIVATE -Wall -Wextra)
19+
20+
if(CMAKE_COMPILER_IS_GNUCC)
21+
target_compile_options(egit2 PRIVATE -Wall -Wextra)
22+
endif(CMAKE_COMPILER_IS_GNUCC)
1523

1624
add_custom_command(TARGET egit2 POST_BUILD COMMAND
1725
${CMAKE_COMMAND} -E copy $<TARGET_FILE:egit2> "${CMAKE_CURRENT_BINARY_DIR}/..")

0 commit comments

Comments
 (0)