Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

[[ WindowsCI ]] Add travis configuration for windows #7344

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ dist: trusty
os:
- linux
- osx
- windows

# Use a Travis image containing an Xcode we support
# This prevents surprise upgrades!
osx_image: xcode7.3

language: c++
language: cpp

compiler:
compiler:
- clang
- gcc

Expand Down Expand Up @@ -46,11 +47,13 @@ matrix:
compiler: gcc
- os: linux
compiler: clang
- os: windows
compiler: clang

# Install any required tools
before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then
if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then
rvm --default use 2.2.1
gem install xcpretty
fi
Expand All @@ -59,13 +62,22 @@ before_install:
if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get -qq update
sudo apt-get -qq install g++-4.9
sudo apt-get -qq install g++-4.9
fi

- |
if [[ "$TRAVIS_OS_NAME" == "windows" ]] ; then
choco install --yes cygwin -params '/InstallDir:C:\Cygwin'
choco install --yes --source cygwin bash curl zip unzip
choco install make
choco install winflexbison
fi

# Set up the source tree by fetching Linux-specific prebuilt objects
install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then (cd prebuilt && ./fetch-libraries.sh linux x86_64) ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then (cd prebuilt && ./fetch-libraries.sh mac) ; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]] ; then (cd prebuilt && ./fetch-libraries.sh win32 x86_64) ; fi

# Bootstrap the LCB compiler, build the default target set and run a
# the default test suite.
Expand All @@ -89,8 +101,9 @@ script: |
export JAVA_HOME=$(/usr/libexec/java_home)
;;
esac

if [[ "${COVERITY_SCAN_BRANCH}" != "1" ]]; then
if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
cmd.exe /C configure.bat
elif [[ "${COVERITY_SCAN_BRANCH}" != "1" ]]; then
mkdir -p "${LICENSE_DIR}" &&
touch "${LICENSE_DIR}/livecode-firstrun.lcf" &&
make all-${BUILD_PLATFORM} &&
Expand Down
34 changes: 29 additions & 5 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,22 @@ guess_linux_arch_script := \
esac
guess_linux_arch := $(shell $(guess_linux_arch_script))

guess_platform_script := \
guess_platform_no_arch_script := \
case `uname -s` in \
Linux) echo linux-$(guess_linux_arch) ;; \
Linux) echo linux ;; \
Darwin) echo mac ;; \
MSYS*) echo win ;; \
esac
guess_platform_no_arch := $(shell $(guess_platform_no_arch_script))

guess_platform_script := \
case `uname -s` in \
Linux) echo linux-$(guess_linux_arch) ;; \
Darwin) echo mac ;; \
MSYS*) echo win-$(guess_linux_arch) ;; \
esac
guess_platform := $(shell $(guess_platform_script))

guess_engine_flags_script := \
if echo $(guess_platform) | grep "^linux" >/dev/null 2>&1 && \
! xset -q >/dev/null 2>&1 ; then \
Expand All @@ -70,5 +79,20 @@ else
bin_dir ?= $(top_srcdir)/$(guess_platform)-bin
endif

guess_engine := $(if $(filter mac,$(guess_platform)),$(bin_dir)/Standalone-Community.app/Contents/MacOS/Standalone-Community,$(bin_dir)/standalone-community)
guess_dev_engine := $(if $(filter mac,$(guess_platform)),$(bin_dir)/LiveCode-Community.app/Contents/MacOS/LiveCode-Community,$(bin_dir)/LiveCode-Community)
guess_engine_script := \
case `uname -s` in \
Linux) echo $(bin_dir)/standalone-community ;; \
Darwin) echo $(bin_dir)/Standalone-Community.app/Contents/MacOS/Standalone-Community ;; \
MSYS*) echo $(bin_dir)/standalone-community.exe ;; \
esac
guess_engine := $(shell $(guess_engine_script))


guess_dev_engine_script := \
case `uname -s` in \
Linux) echo $(bin_dir)/LiveCode-Community ;; \
Darwin) echo $(bin_dir)/LiveCode-Community.app/Contents/MacOS/LiveCode-Community ;; \
MSYS*) echo $(bin_dir)/LiveCode-Community.exe ;; \
esac
guess_dev_engine := $(shell $(guess_dev_engine_script))

12 changes: 5 additions & 7 deletions buildbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,25 +195,23 @@ def __exit__(self, type, value, traceback):
def exec_msbuild(platform):
# Run the make.cmd batch script; it's run using Wine if this is
# not actually a Windows system.
cwd = 'build-' + platform

if _platform.system() == 'Windows':
with UniqueMspdbsrv() as mspdbsrv:
args = ['cmd', '/C', '..\\make.cmd']
args = ['cmd', '/C', 'make.cmd']
print(' '.join(args))
result = subprocess.call(args, cwd=cwd)
result = subprocess.call(args)

sys.exit(result)

else:
args = ['wine', 'cmd', '/K', '..\\make.cmd']
args = ['wine', 'cmd', '/K', 'make.cmd']
print(' '.join(args))
exit_status = sys.exit(subprocess.call(args, cwd=cwd))
exit_status = sys.exit(subprocess.call(args))

# Clean up any Wine processes that are still hanging around.
# This is important in case the build fails.
args = ['wineserver', '-k', '-w']
subprocess.call(args, cwd=cwd)
subprocess.call(args)

sys.exit(exit_status)

Expand Down
33 changes: 26 additions & 7 deletions config/yacc.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,32 @@
[
'OS == "win"',
{
'variables':
{
'invoke_unix_path': '$(ProjectDir)../../../../../util/invoke-unix.bat',
},

'flex': ['<(invoke_unix_path)', '/usr/bin/flex'],
'bison': ['<(invoke_unix_path)', '/usr/bin/bison'],
'variables':
{
# Whether to use flex and bison installed via chocolatey winflexbison
# package or installed through Cygwin
'use_winflexbison': '<!(echo ${USE_WINFLEXBISON:-0})',
},

'conditions':
[
[
'use_winflexbison != "0"',
{
'flex': ['win_flex.exe'],
'bison': ['win_bison.exe'],
},
{
'variables':
{
'invoke_unix_path': '$(ProjectDir)../../../../../util/invoke-unix.bat',
},

'flex': ['<(invoke_unix_path)', '/usr/bin/flex'],
'bison': ['<(invoke_unix_path)', '/usr/bin/bison'],
},
],
],
},
{
'flex': 'flex',
Expand Down
9 changes: 6 additions & 3 deletions configure.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@echo off
REM Configures the Windows build

SETLOCAL EnableExtensions
Expand Down Expand Up @@ -59,11 +58,15 @@ IF EXIST "%programfiles(x86)%\Microsoft Speech SDK 5.1\*" (
)

REM Pause so any warnings can be seen
IF %warnings% NEQ 0 PAUSE
IF %TRAVIS_OS_NAME%=="" (
IF %warnings% NEQ 0 PAUSE
)

REM Run the configure step
%python% config.py --platform win-%TARGET_ARCH% %extra_options% %gypfile%
PAUSE
IF %TRAVIS_OS_NAME%=="" (
PAUSE
)

REM Pause if there was an error so that the user gets a chance to see it
IF %ERRORLEVEL% NEQ 0 PAUSE
Expand Down
1 change: 0 additions & 1 deletion docs/development/build-win.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ and build LiveCode from there.
If you installed the Visual Studio build tools, you can run:

````
cd build-win-x86
set BUILD_PLATFORM=win-x86
cmd /C ..\make.cmd
````
Expand Down
12 changes: 12 additions & 0 deletions extensions/script-libraries/diff/test/diff.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on TestSetup
end TestSetup

on TestContextLines
// These tests seem to fail on windows
if the platform is "win32" then
TestAssertBroken "Diff library context lines", false, "Bug 22152"
exit TestContextLines
end if

local tTestFolder
put get_test_folder() & "/test_context" into tTestFolder

Expand All @@ -23,6 +29,12 @@ on TestLineEndings
end TestLineEndings

on TestTerminatingNewline
// These tests seem to fail on windows
if the platform is "win32" then
TestAssertBroken "Diff library terminating new line", false, "Bug 22152"
exit TestTerminatingNewline
end if

local tTestFolder
put get_test_folder() & "/test_terminating_newline" into tTestFOlder

Expand Down
20 changes: 20 additions & 0 deletions lcidlc/lcidlc.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,26 @@
'type': 'none',
},
],
[
'OS == "win"',
{
'variables':
{
# Skip LCIDLC on Windows if the appropriate environment variable is set
'skip_lcidlc': '<!(echo ${SKIP_LCIDLC:-0})',
},

'conditions':
[
[
'skip_lcidlc != "0"',
{
'type': 'none',
},
],
],
},
],
],

'msvs_settings':
Expand Down
3 changes: 1 addition & 2 deletions livecode.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
],

'conditions':
[

[
[
'OS != "emscripten"',
{
Expand Down
4 changes: 2 additions & 2 deletions make.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ if not defined BUILDTYPE set BUILDTYPE=Debug
@rem Guess build project
if not defined BUILD_EDITION set BUILD_EDITION=community
if /I "%BUILD_EDITION%"=="commercial" (
set BUILD_PROJECT=livecode-commercial.sln
set BUILD_PROJECT=build-%BUILD_PLATFORM%\livecode-commercial.sln
set DEFAULT_TARGET=____\default
) else (
set BUILD_PROJECT=livecode\livecode.sln
set BUILD_PROJECT=build-%BUILD_PLATFORM%\livecode\livecode.sln
set DEFAULT_TARGET=default
)

Expand Down
18 changes: 15 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,30 @@ else
LCS_CMD = $(INTERPRETER) $(LCS_ENGINE) $(LCS_ENGINE_FLAGS) $(LCS_TESTRUNNER) run $(LCS_TESTS_DIR)
endif

LCS_SERVER_ENGINE ?= $(bin_dir)/server-community
ifeq ($(guess_platform_no_arch),win)
LCS_SERVER_ENGINE ?= $(bin_dir)/server-community.exe
else
LCS_SERVER_ENGINE ?= $(bin_dir)/server-community
endif
LCS_SERVER_TESTRUNNER ?= $(TESTS_DIR)/_testrunner.lc
LCS_SERVER_CMD = $(LCS_SERVER_ENGINE) $(LCS_SERVER_TESTRUNNER) run $(LCS_TESTS_DIR)

########## LiveCode Builder test parameters

MODULE_DIR ?= $(bin_dir)/modules/lci

LC_COMPILE ?= $(bin_dir)/lc-compile
ifeq ($(guess_platform_no_arch),win)
LC_COMPILE ?= $(bin_dir)/lc-compile.exe
else
LC_COMPILE ?= $(bin_dir)/lc-compile
endif
LC_COMPILE_FLAGS += --modulepath $(LCM_DIR) --modulepath $(MODULE_DIR)

LC_RUN ?= $(bin_dir)/lc-run
ifeq ($(guess_platform_no_arch),win)
LC_RUN ?= $(bin_dir)/lc-run.exe
else
LC_RUN ?= $(bin_dir)/lc-run
endif

LCB_LOG = _lcb_test_suite.log

Expand Down
Loading