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

Commit b041013

Browse files
authored
Merge pull request #4552 from livecodeali/test-fix_gui_tests
[[ Tests ]] Enable running of GUI only tests on Travis CI
2 parents bc40d9f + ee76803 commit b041013

File tree

9 files changed

+67
-18
lines changed

9 files changed

+67
-18
lines changed

.travis.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
sudo: required
77
dist: trusty
88

9+
# Build on both Linux and OSX
10+
os:
11+
- linux
12+
- osx
13+
914
language: c++
1015

1116
# Skip vulcan CI branches
@@ -22,16 +27,34 @@ env:
2227
# via the "travis encrypt" command using the project repo's public key
2328
- secure: "R/JfoBMrkhCGWhfWM1m3gPHuLtMBlp2SIK1R9BaPbRsbGBUJmAg9V0g0YXSaw8SVxoyuiL/jsLtHPfDeub9oTxrYydew+6/4KaoQdG7EGXQJfBhH2f0ag/hTKJfXnmZX9jMMnTxPf5Axjq+w4E6sKkU2+d1oAJRhrqzYNwDhVlc="
2429
- CXX_STD: "c++11"
25-
- LCS_ENGINE_FLAGS: "-ui"
30+
31+
# Install any required tools
32+
before_install:
33+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then sudo gem install xcpretty ; fi
2634

2735
# Set up the source tree by fetching Linux-specific prebuilt objects
28-
install: (cd prebuilt && ./fetch-libraries.sh linux)
36+
install:
37+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then (cd prebuilt && ./fetch-libraries.sh linux) ; fi
38+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then (cd prebuilt && ./fetch-libraries.sh mac) ; fi
2939

3040
# Bootstrap the LCB compiler, build the default target set and run a
3141
# the default test suite.
3242
script: >
3343
if [ "${COVERITY_SCAN_BRANCH}" != "1" ]; then
34-
make all-linux && make check-linux
44+
if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then
45+
LICENSE_FILE=livecode-firstrun.lcf
46+
LICENSE_DIR="$HOME/.runrev/licenses"
47+
[ -d "$LICENSE_DIR" ] || mkdir -p "$LICENSE_DIR"
48+
touch "$LICENSE_DIR/$LICENSE_FILE"
49+
make all-linux && xvfb-run make check-linux
50+
fi
51+
if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then
52+
LICENSE_FILE=livecode-firstrun.lcf
53+
LICENSE_DIR="$HOME/Library/Application Support/RunRev/Licenses"
54+
[ -d "$LICENSE_DIR" ] || mkdir -p "$LICENSE_DIR"
55+
touch "$LICENSE_DIR/$LICENSE_FILE"
56+
make all-mac && make check-mac
57+
fi
3558
fi
3659
3760
addons:
@@ -62,3 +85,4 @@ addons:
6285
- libpopt-dev
6386
- libesd0-dev
6487
- liblcms-dev
88+
- xvfb

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ else
4444
BUILD_PROJECT := livecode
4545
endif
4646

47+
# Prettifying output for CI builds
48+
ifeq ($(TRAVIS),true)
49+
XCODEBUILD := set -o pipefail && $(XCODEBUILD)
50+
XCODEBUILD_FILTER := | xcpretty
51+
else
52+
XCODEBUILD_FILTER :=
53+
endif
54+
4755
include Makefile.common
4856

4957
################################################################
@@ -109,10 +117,12 @@ config-mac:
109117
./config.sh --platform mac
110118

111119
compile-mac:
112-
$(XCODEBUILD) -project "build-mac$(BUILD_SUBDIR)/$(BUILD_PROJECT).xcodeproj" -configuration $(BUILDTYPE) -target default
120+
$(XCODEBUILD) -project "build-mac$(BUILD_SUBDIR)/$(BUILD_PROJECT).xcodeproj" -configuration $(BUILDTYPE) -target default \
121+
$(XCODEBUILD_FILTER)
113122

114123
check-mac:
115-
$(XCODEBUILD) -project "build-mac$(BUILD_SUBDIR)/$(BUILD_PROJECT).xcodeproj" -configuration $(BUILDTYPE) -target check
124+
$(XCODEBUILD) -project "build-mac$(BUILD_SUBDIR)/$(BUILD_PROJECT).xcodeproj" -configuration $(BUILDTYPE) -target check \
125+
$(XCODEBUILD_FILTER)
116126
$(MAKE) check-common-mac
117127

118128

config.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fi
228228
# Default Xcode target SDK
229229
if test -z "$XCODE_TARGET_SDK"; then
230230
case ${OS} in
231-
mac) XCODE_TARGET_SDK="macosx10.8" ;;
231+
mac) XCODE_TARGET_SDK="macosx10.9" ;;
232232
ios) XCODE_TARGET_SDK="iphoneos" ;;
233233
esac
234234
fi
@@ -354,6 +354,12 @@ if test "${OS}" = "emscripten" ; then
354354
fi
355355

356356

357+
# Building on Travis
358+
if [ "${TRAVIS}" = "true" ] ; then
359+
DISABLE_REVVIDEOGRABBER=-Denable_revvideograbber=0
360+
fi
361+
362+
357363
################################################################
358364
# Invoke gyp
359365
################################################################
@@ -406,7 +412,8 @@ case ${OS} in
406412
invoke_gyp $basic_args "-DOS=${OS}" \
407413
"-Dtarget_sdk=${XCODE_TARGET_SDK}" \
408414
"-Dhost_sdk=${XCODE_HOST_SDK}" \
409-
"-Dtarget_arch=${TARGET_ARCH}" "$@"
415+
"-Dtarget_arch=${TARGET_ARCH}" "$@" \
416+
${DISABLE_REVVIDEOGRABBER}
410417
;;
411418
*)
412419
echo "ERROR: Bad configuration for generating project files"

revbrowser/src/osxbrowser.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ - (void)com_runrev_livecode_setNativeViewId:(int)new_id
10211021
[info setVerticalPagination:NSAutoPagination];
10221022
[info setHorizontallyCentered:NO];
10231023
[info setVerticallyCentered:NO];
1024-
[info setOrientation:NSPortraitOrientation];
1024+
[info setOrientation:NSPaperOrientationPortrait];
10251025

10261026

10271027
pView = [[[nativeView mainFrame] frameView] documentView];

revvideograbber/revvideograbber.gyp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
'mac_bundle': 1,
1313
'product_prefix': '',
1414
'product_name': 'revvideograbber',
15+
16+
'variables':
17+
{
18+
'enable_revvideograbber%': '1',
19+
},
1520

1621
'dependencies':
1722
[
@@ -49,9 +54,10 @@
4954
'conditions':
5055
[
5156
[
52-
'OS != "mac" and OS != "win"',
57+
'(OS != "mac" and OS != "win") or enable_revvideograbber == 0',
5358
{
5459
'type': 'none',
60+
'mac_bundle': '0',
5561
},
5662
{
5763
'all_dependent_settings':
@@ -73,7 +79,7 @@
7379
},
7480
],
7581
[
76-
'OS == "mac"',
82+
'OS == "mac" and enable_revvideograbber != 0',
7783
{
7884
'libraries':
7985
[
@@ -87,7 +93,7 @@
8793
},
8894
],
8995
[
90-
'OS == "win"',
96+
'OS == "win" and enable_revvideograbber != 0',
9197
{
9298
'include_dirs':
9399
[

tests/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ $(LCM_DIR)/deps.mk: $(LCM_SOURCES) Makefile $(LC_COMPILE) | $(LCM_DIR)
9494
--output $(LCM_DIR)/$$lcm -- $$lcb >> $@; \
9595
done; \
9696
$(LC_COMPILE) $(LC_COMPILE_FLAGS) --deps make -- $(LCM_SOURCES) >> $@ ; \
97-
sed -i 's,\(.* \([^ ]*\)\.lcb\)$$,$(LCM_DIR)/\2.lcm \1,g' $@
97+
sed -i -e 's,\(.* \([^ ]*\)\.lcb\)$$,$(LCM_DIR)/\2.lcm \1,g' $@
9898

9999
########## Build rules
100100

tests/lcs/core/engine/engine.livecodescript

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ else if the platform is "android" then
148148
put "arm,i386" into tProcessors
149149
else if the platform is "iphone" then
150150
put "arm,arm64,i386,x86_64" into tProcessors
151-
else if the platform is among the items of "Mac OS,Linux" then
151+
else if the platform is among the items of "MacOS,Linux" then
152152
// Mac and Linux
153-
put line 1 of shell("uname -m") into tProcessors
153+
put "x86,x86_64" into tProcessors
154154
else
155155
-- Unknown platform for "the processor"
156156
end if

tests/lcs/core/files/files.livecodescript

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,12 @@ on TestReadFromProcess
405405
else if the platform is "macos" or the platform contains "linux" then
406406
put "/bin/sh" into tProcess
407407

408-
open process tProcess for update
408+
open process tProcess for binary update
409409

410410
write "echo " & quote & "foo" & quote & LF to process tProcess
411411

412-
read from process tProcess for 1 line
413-
put char 1 to 3 of it into tOutput
412+
read from process tProcess for 3 bytes
413+
put it into tOutput
414414

415415
TestAssert "Reading from process", tOutput is "foo"
416416

tests/lcs/core/interface/interfaceui.livecodescript

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ if the platform is "win32" then
182182
else if the platform is "MacOS" then
183183
TestAssert "test", the screenname is "local Mac"
184184
else if the platform is "Linux" then
185-
TestAssert "test", the screenname is ":0.0" or the screenname is ":0"
185+
local tScreenMajor, tScreenMinor
186+
TestAssert "screenname is well-formed X11 display ID", \
187+
matchText(the screenname, ":[0-9]+(?:\.[0-9]+)?")
186188
end if
187189

188190
end TestInterface44

0 commit comments

Comments
 (0)