[Libreoffice-commits] online.git: Branch 'feature/parallel_cypress' - 18 commits - android/app android/lib common/StringVector.cpp cypress_test/Makefile.am loleaflet/images loleaflet/loleaflet-src.js.m4 loleaflet/Makefile.am loleaflet/src Makefile.am
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Mon Mar 2 19:36:03 UTC 2020
Rebased ref, commits from common ancestor:
commit d4d7d6681f5bc3db26300828e57c1f43d42fb67f
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 2 20:03:15 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
remove this
Change-Id: If697f1399ab97d709025181380b279b27c5daea8
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index a0e9476df..13a769f08 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -92,13 +92,6 @@ $(DESKTOP_TEST_FILES_DONE): $(PID_FILE)
@$(foreach done_file,$(DESKTOP_TEST_FILES_DONE),mkdir -p $(dir $(done_file)) && touch $(done_file) &&) true\
)
-check-seq: @JAILS_PATH@ $(NODE_BINS)
- $(call run_JS_error_check)
- $(call start_loolwsd)
- $(call run_desktop_tests)
- $(call run_mobile_tests)
- @$(KILL_COMMAND) || true
-
check-desktop: @JAILS_PATH@ $(NODE_BINS)
$(call run_JS_error_check)
$(call start_loolwsd)
commit 57438353115c2138aae3de993b1b065274051174
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 2 17:15:38 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
parallel-cypress: improve console output of parallel test run.
Change-Id: I29440bafdba101c3f4e86de7d587330b972289de
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 29285e3f3..a0e9476df 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -8,6 +8,7 @@ GET_PORT_BINARY = $(abs_builddir)/node_modules/get-port-cli/cli.js
NPM_INSTALLED = $(abs_builddir)/workdir/npm_installed
PID_FILE=$(abs_builddir)/workdir/loolwsd.pid
+ERROR_LOG=$(abs_builddir)/workdir/error.log
DESKTOP_USER_AGENT = "cypress"
DESKTOP_TEST_FOLDER = $(abs_srcdir)/integration_tests/desktop
@@ -57,18 +58,23 @@ MOBILE_TEST_FILES_DONE= \
DESKTOP_TEST_FILES_DONE= \
$(foreach test_file,$(DEKSTOP_TEST_FILES),$(DESKTOP_TRACK_FOLDER)/$(test_file).done)
-check-local: $(DESKTOP_TEST_FILES_DONE) $(MOBILE_TEST_FILES_DONE)
+check-local: do-check
+ $(if $(wildcard $(ERROR_LOG)),$(error Cypress test failure!))
+
+do-check: $(DESKTOP_TEST_FILES_DONE) $(MOBILE_TEST_FILES_DONE)
@$(KILL_COMMAND) || true
$(if $(HEADLESS_BUILD), at pkill Xvfb,)
+ $(if $(wildcard $(ERROR_LOG)), at cat $(ERROR_LOG))
$(PID_FILE): @JAILS_PATH@ $(NODE_BINS)
+ @rm -f $(ERROR_LOG)
$(call run_JS_error_check)
$(if $(HEADLESS_BUILD),$(call start_Xvfb),)
$(call start_loolwsd)
$(MOBILE_TEST_FILES_DONE): $(PID_FILE)
$(if $(PARALLEL_BUILD),\
- $(call run_mobile_tests,$(subst $(MOBILE_TRACK_FOLDER)/,,$(basename $@))),\
+ $(call run_mobile_tests,$(subst $(MOBILE_TRACK_FOLDER)/,,$(basename $@)),$(basename $@).log),\
$(call run_mobile_tests))
$(if $(PARALLEL_BUILD),\
@mkdir -p $(dir $@) && touch $@\
@@ -78,7 +84,7 @@ $(MOBILE_TEST_FILES_DONE): $(PID_FILE)
$(DESKTOP_TEST_FILES_DONE): $(PID_FILE)
$(if $(PARALLEL_BUILD),\
- $(call run_desktop_tests,$(subst $(DESKTOP_TRACK_FOLDER)/,,$(basename $@))),\
+ $(call run_desktop_tests,$(subst $(DESKTOP_TRACK_FOLDER)/,,$(basename $@)),$(basename $@).log),\
$(call run_desktop_tests))
$(if $(PARALLEL_BUILD),\
@mkdir -p $(dir $@) && touch $@\
@@ -169,8 +175,12 @@ define run_desktop_tests
--headless \
--env DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT) \
$(if $(1), --spec=$(abs_dir)/integration_tests/desktop/$(1)) \
- || ($(KILL_COMMAND) && false))
- $(if $(PARALLEL_BUILD), at echo "`echo $(RUN_COMMAND) && $(RUN_COMMAND)`",$(RUN_COMMAND))
+ $(if $(PARALLEL_BUILD),,|| ($(KILL_COMMAND) && false)))
+ $(if $(PARALLEL_BUILD),\
+ $(call execute_run_parallel,$(RUN_COMMAND),$(2))\
+ ,\
+ $(RUN_COMMAND)\
+ )
endef
define run_mobile_tests
@@ -182,8 +192,21 @@ define run_mobile_tests
--headless \
--env DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT) \
$(if $(1), --spec=$(abs_dir)/integration_tests/mobile/$(1)) \
- || ($(KILL_COMMAND) && false))
- $(if $(PARALLEL_BUILD), at echo "`echo $(RUN_COMMAND) && $(RUN_COMMAND)`",$(RUN_COMMAND))
+ $(if $(PARALLEL_BUILD),,|| ($(KILL_COMMAND) && false)))
+ $(if $(PARALLEL_BUILD),\
+ $(call execute_run_parallel,$(RUN_COMMAND),$(2))\
+ ,\
+ $(RUN_COMMAND)\
+ )
+endef
+
+define execute_run_parallel
+ @mkdir -p $(dir $(2)) && touch $(2) && \
+ echo "`echo $(1) && $(1)`" > $(2) 2>&1 && \
+ if [ `grep -o "CypressError" $(2)` ];\
+ then cat $(2) >> $(ERROR_LOG);\
+ else cat $(2);\
+ fi;
endef
NODE_BINS = \
commit df5e376e5ed91a1643d838ccc487367b431dff5c
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sat Feb 29 14:19:25 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
simplify this
Change-Id: I49d68b486e83bb0d0afaedb16860474c4d7eebe8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89757
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index db4d87731..29285e3f3 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -71,11 +71,9 @@ $(MOBILE_TEST_FILES_DONE): $(PID_FILE)
$(call run_mobile_tests,$(subst $(MOBILE_TRACK_FOLDER)/,,$(basename $@))),\
$(call run_mobile_tests))
$(if $(PARALLEL_BUILD),\
- @mkdir -p $(dir $@) &&\
- touch $@\
+ @mkdir -p $(dir $@) && touch $@\
,\
- @$(foreach done_file,$(MOBILE_TEST_FILES_DONE),mkdir -p $(dir $(done_file)) &&)\
- $(foreach done_file,$(MOBILE_TEST_FILES_DONE),touch $(done_file) &&) true\
+ @$(foreach done_file,$(MOBILE_TEST_FILES_DONE),mkdir -p $(dir $(done_file)) && touch $(done_file) &&) true\
)
$(DESKTOP_TEST_FILES_DONE): $(PID_FILE)
@@ -83,11 +81,9 @@ $(DESKTOP_TEST_FILES_DONE): $(PID_FILE)
$(call run_desktop_tests,$(subst $(DESKTOP_TRACK_FOLDER)/,,$(basename $@))),\
$(call run_desktop_tests))
$(if $(PARALLEL_BUILD),\
- @mkdir -p $(dir $@) &&\
- touch $@\
+ @mkdir -p $(dir $@) && touch $@\
,\
- @$(foreach done_file,$(DESKTOP_TEST_FILES_DONE),mkdir -p $(dir $(done_file)) &&)\
- $(foreach done_file,$(DESKTOP_TEST_FILES_DONE),touch $(done_file) &&) true\
+ @$(foreach done_file,$(DESKTOP_TEST_FILES_DONE),mkdir -p $(dir $(done_file)) && touch $(done_file) &&) true\
)
check-seq: @JAILS_PATH@ $(NODE_BINS)
commit 5716d7a4a0c004ffeffeb2dd36a632d2eb5aac41
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sat Feb 29 11:16:18 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
fix up test name
Change-Id: I45b65bd96812dddb3d7c48949f82fc5588d88bdb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89752
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index ae3df12ad..db4d87731 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -68,7 +68,7 @@ $(PID_FILE): @JAILS_PATH@ $(NODE_BINS)
$(MOBILE_TEST_FILES_DONE): $(PID_FILE)
$(if $(PARALLEL_BUILD),\
- $(call run_mobile_tests,$(subst $(MOBILE_TRACK_FOLDER),,$(basename $@))),\
+ $(call run_mobile_tests,$(subst $(MOBILE_TRACK_FOLDER)/,,$(basename $@))),\
$(call run_mobile_tests))
$(if $(PARALLEL_BUILD),\
@mkdir -p $(dir $@) &&\
@@ -80,7 +80,7 @@ $(MOBILE_TEST_FILES_DONE): $(PID_FILE)
$(DESKTOP_TEST_FILES_DONE): $(PID_FILE)
$(if $(PARALLEL_BUILD),\
- $(call run_desktop_tests,$(subst $(DESKTOP_TRACK_FOLDER),,$(basename $@))),\
+ $(call run_desktop_tests,$(subst $(DESKTOP_TRACK_FOLDER)/,,$(basename $@))),\
$(call run_desktop_tests))
$(if $(PARALLEL_BUILD),\
@mkdir -p $(dir $@) &&\
commit 23d007f6ebaa57de61bf81a3112b1dae68fdc119
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Feb 28 21:02:09 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
fix sequential build
Change-Id: I09d92458109c279380b1425b323b52c55b8f348b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89749
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 6be7830eb..ae3df12ad 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -70,19 +70,25 @@ $(MOBILE_TEST_FILES_DONE): $(PID_FILE)
$(if $(PARALLEL_BUILD),\
$(call run_mobile_tests,$(subst $(MOBILE_TRACK_FOLDER),,$(basename $@))),\
$(call run_mobile_tests))
- @mkdir -p $(dir $@)
$(if $(PARALLEL_BUILD),\
- @touch $@,\
- $(foreach done_file,$(MOBILE_TEST_FILES_DONE),touch $(done_file) &&) true)
+ @mkdir -p $(dir $@) &&\
+ touch $@\
+ ,\
+ @$(foreach done_file,$(MOBILE_TEST_FILES_DONE),mkdir -p $(dir $(done_file)) &&)\
+ $(foreach done_file,$(MOBILE_TEST_FILES_DONE),touch $(done_file) &&) true\
+ )
$(DESKTOP_TEST_FILES_DONE): $(PID_FILE)
$(if $(PARALLEL_BUILD),\
$(call run_desktop_tests,$(subst $(DESKTOP_TRACK_FOLDER),,$(basename $@))),\
$(call run_desktop_tests))
- @mkdir -p $(dir $@)
$(if $(PARALLEL_BUILD),\
- @touch $@,\
- $(foreach done_file,$(DESKTOP_TEST_FILES_DONE),touch $(done_file) &&) true)
+ @mkdir -p $(dir $@) &&\
+ touch $@\
+ ,\
+ @$(foreach done_file,$(DESKTOP_TEST_FILES_DONE),mkdir -p $(dir $(done_file)) &&)\
+ $(foreach done_file,$(DESKTOP_TEST_FILES_DONE),touch $(done_file) &&) true\
+ )
check-seq: @JAILS_PATH@ $(NODE_BINS)
$(call run_JS_error_check)
commit 9b72ad8186d8bf4330ec28a7d68f5cc2ba48e901
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Feb 28 14:37:56 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
parallel-cypress: restore original sequential build.
Running all tests in one command will display a better output
and also might be faster.
Change-Id: Ib061fad28eeb1246c774bfb7fd958c3f5b9c317b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89731
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 8caf63453..6be7830eb 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -57,7 +57,7 @@ MOBILE_TEST_FILES_DONE= \
DESKTOP_TEST_FILES_DONE= \
$(foreach test_file,$(DEKSTOP_TEST_FILES),$(DESKTOP_TRACK_FOLDER)/$(test_file).done)
-check-local: $(MOBILE_TEST_FILES_DONE) $(DESKTOP_TEST_FILES_DONE)
+check-local: $(DESKTOP_TEST_FILES_DONE) $(MOBILE_TEST_FILES_DONE)
@$(KILL_COMMAND) || true
$(if $(HEADLESS_BUILD), at pkill Xvfb,)
@@ -67,14 +67,22 @@ $(PID_FILE): @JAILS_PATH@ $(NODE_BINS)
$(call start_loolwsd)
$(MOBILE_TEST_FILES_DONE): $(PID_FILE)
- $(call run_mobile_tests,$(subst $(MOBILE_TRACK_FOLDER),,$(basename $@)))
+ $(if $(PARALLEL_BUILD),\
+ $(call run_mobile_tests,$(subst $(MOBILE_TRACK_FOLDER),,$(basename $@))),\
+ $(call run_mobile_tests))
@mkdir -p $(dir $@)
- @touch $@
+ $(if $(PARALLEL_BUILD),\
+ @touch $@,\
+ $(foreach done_file,$(MOBILE_TEST_FILES_DONE),touch $(done_file) &&) true)
$(DESKTOP_TEST_FILES_DONE): $(PID_FILE)
- $(call run_desktop_tests,$(subst $(DESKTOP_TRACK_FOLDER),,$(basename $@)))
+ $(if $(PARALLEL_BUILD),\
+ $(call run_desktop_tests,$(subst $(DESKTOP_TRACK_FOLDER),,$(basename $@))),\
+ $(call run_desktop_tests))
@mkdir -p $(dir $@)
- @touch $@
+ $(if $(PARALLEL_BUILD),\
+ @touch $@,\
+ $(foreach done_file,$(DESKTOP_TEST_FILES_DONE),touch $(done_file) &&) true)
check-seq: @JAILS_PATH@ $(NODE_BINS)
$(call run_JS_error_check)
commit 201c4079651557c494bff2037763af83e52b801f
Author: Yunusemre Şentürk <yunusemre at collabora.com>
AuthorDate: Fri Feb 28 19:17:08 2020 +0300
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
Wait until Xvfb says it is ready
Change-Id: I3af4428802d6e0ee380536e8dbad1de8aa6d9337
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89727
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 92d40a364..8caf63453 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -146,7 +146,7 @@ endef
define start_Xvfb
@echo "Launching Xvfb..."
Xvfb :$(DISPLAY_NUMBER) &
- sleep 10
+ while [ ! -f /tmp/.X$(DISPLAY_NUMBER)-lock ] ; do sleep 1; done
@echo
endef
commit c075498f3e5deb9fe20d7e51c9010f5d124d2160
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Feb 28 14:37:56 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
parallel-cypress: restore original check rule as check-seq.
It can be used to run tests sequentially with a better
output on the console.
Change-Id: Ib061fad28eeb1246c774bfb7fd958c3f5b9c317b
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 701fcf093..92d40a364 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -76,6 +76,13 @@ $(DESKTOP_TEST_FILES_DONE): $(PID_FILE)
@mkdir -p $(dir $@)
@touch $@
+check-seq: @JAILS_PATH@ $(NODE_BINS)
+ $(call run_JS_error_check)
+ $(call start_loolwsd)
+ $(call run_desktop_tests)
+ $(call run_mobile_tests)
+ @$(KILL_COMMAND) || true
+
check-desktop: @JAILS_PATH@ $(NODE_BINS)
$(call run_JS_error_check)
$(call start_loolwsd)
commit 3b29a76330c61da7805a4f423288997e3a957adb
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Feb 25 13:09:31 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
parallel-cypress: Start own Xvfb in CI environment.
It's not necessary when we build with one job, but when
there are more jobs they try to start their own Xvfb
and they might use the same DISPLAY number for that
which leads to a failure or a freeze.
See also:
https://docs.cypress.io/guides/guides/continuous-integration.html#Xvfb
Change-Id: I2fb301b1d8e889b2898d6792fb38cece303129a6
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 22c1e0271..701fcf093 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -24,6 +24,9 @@ MOBILE_TRACK_FOLDER=$(abs_builddir)/workdir/track/mobile
ALLOWED_PORTS = $(shell seq 9900 1 9980)
KILL_COMMAND=pkill -F $(PID_FILE) || pkill --signal SIGKILL -F $(PID_FILE)
PARALLEL_BUILD = $(findstring jobserver,$(MAKEFLAGS))
+DISPLAY_NUMBER = 100
+HEADLESS_BUILD := $(findstring Command failed,$(shell xhost > /dev/null 2>&1 || echo "Command failed, so we are in a headless environment."))
+export DISPLAY=$(if $(HEADLESS_BUILD),:$(DISPLAY_NUMBER),$(shell echo $$DISPLAY))
if HAVE_LO_PATH
MOBILE_TEST_FILES= \
@@ -56,9 +59,11 @@ DESKTOP_TEST_FILES_DONE= \
check-local: $(MOBILE_TEST_FILES_DONE) $(DESKTOP_TEST_FILES_DONE)
@$(KILL_COMMAND) || true
+ $(if $(HEADLESS_BUILD), at pkill Xvfb,)
$(PID_FILE): @JAILS_PATH@ $(NODE_BINS)
$(call run_JS_error_check)
+ $(if $(HEADLESS_BUILD),$(call start_Xvfb),)
$(call start_loolwsd)
$(MOBILE_TEST_FILES_DONE): $(PID_FILE)
@@ -130,6 +135,14 @@ define start_loolwsd
@echo
endef
+#https://docs.cypress.io/guides/guides/continuous-integration.html#Xvfb
+define start_Xvfb
+ @echo "Launching Xvfb..."
+ Xvfb :$(DISPLAY_NUMBER) &
+ sleep 10
+ @echo
+endef
+
define run_desktop_tests
@echo $(if $(1),"Running cypress desktop test: $(1)","Running cypress desktop tests...")
@echo
commit d753f404c6318d738996fd24751cdbb518c0970a
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Feb 25 12:56:42 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
[DONT PUSH TO MASTER]: Don't run C++ unit tests.
Change-Id: I7a8a10187e63668f04c9af18fa6352fbbe958251
diff --git a/Makefile.am b/Makefile.am
index bf5725b92..60654c841 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,7 +14,7 @@ endif
else
-SUBDIRS = . test loleaflet cypress_test
+SUBDIRS = . loleaflet cypress_test
export ENABLE_DEBUG
commit d429d3ea9d89b05df3c18ac82919413a4a4997ea
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sat Feb 22 11:48:33 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
parallel-cypress: during parallel build don't write out execution line-by-line
Because in this case, the output of the different threads will be
mixed in the command line.
For sequential build keep the original behavior.
Change-Id: Ibf9bf7c6111f8b5b0cf188fab66b97dedd613c65
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 0984e5248..22c1e0271 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -23,6 +23,7 @@ MOBILE_TRACK_FOLDER=$(abs_builddir)/workdir/track/mobile
ALLOWED_PORTS = $(shell seq 9900 1 9980)
KILL_COMMAND=pkill -F $(PID_FILE) || pkill --signal SIGKILL -F $(PID_FILE)
+PARALLEL_BUILD = $(findstring jobserver,$(MAKEFLAGS))
if HAVE_LO_PATH
MOBILE_TEST_FILES= \
@@ -130,27 +131,29 @@ define start_loolwsd
endef
define run_desktop_tests
+ @echo $(if $(1),"Running cypress desktop test: $(1)","Running cypress desktop tests...")
@echo
- @echo "Running cypress desktop tests..."
- @echo
- $(CYPRESS_BINARY) run --browser $(CHROME) \
+ $(eval RUN_COMMAND = \
+ $(CYPRESS_BINARY) run --browser $(CHROME) \
--config integrationFolder=$(DESKTOP_TEST_FOLDER),userAgent=$(DESKTOP_USER_AGENT) \
--headless \
--env DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT) \
$(if $(1), --spec=$(abs_dir)/integration_tests/desktop/$(1)) \
- || ($(KILL_COMMAND) && false)
+ || ($(KILL_COMMAND) && false))
+ $(if $(PARALLEL_BUILD), at echo "`echo $(RUN_COMMAND) && $(RUN_COMMAND)`",$(RUN_COMMAND))
endef
define run_mobile_tests
+ @echo $(if $(1),"Running cypress mobile test: $(1)","Running cypress mobile tests...")
@echo
- @echo "Running cypress mobile tests..."
- @echo
- $(CYPRESS_BINARY) run --browser $(CHROME) \
+ $(eval RUN_COMMAND = \
+ $(CYPRESS_BINARY) run --browser $(CHROME) \
--config integrationFolder=$(MOBILE_TEST_FOLDER),userAgent=$(MOBILE_USER_AGENT) \
--headless \
--env DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT) \
$(if $(1), --spec=$(abs_dir)/integration_tests/mobile/$(1)) \
- || ($(KILL_COMMAND) && false)
+ || ($(KILL_COMMAND) && false))
+ $(if $(PARALLEL_BUILD), at echo "`echo $(RUN_COMMAND) && $(RUN_COMMAND)`",$(RUN_COMMAND))
endef
NODE_BINS = \
commit 09e8f4c7126022f1a514104598d914a50d043c23
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sat Feb 22 10:42:49 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
parallel-cypress: some cleanup around loolwsd server starting
Change-Id: Ia762d9ae73a40ea9debf0b847bc93e8e9171284d
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 0e71f1fe2..0984e5248 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -58,7 +58,6 @@ check-local: $(MOBILE_TEST_FILES_DONE) $(DESKTOP_TEST_FILES_DONE)
$(PID_FILE): @JAILS_PATH@ $(NODE_BINS)
$(call run_JS_error_check)
- $(eval FREE_PORT:=$(shell $(GET_PORT_BINARY) --host=127.0.0.1 $(ALLOWED_PORTS)))
$(call start_loolwsd)
$(MOBILE_TEST_FILES_DONE): $(PID_FILE)
@@ -112,6 +111,7 @@ define run_JS_error_check
endef
define start_loolwsd
+ $(eval FREE_PORT:=$(shell $(GET_PORT_BINARY) --host=127.0.0.1 $(ALLOWED_PORTS)))
@echo "Found available port for testing: $(FREE_PORT)"
@echo
@echo "Launching loolwsd..."
@@ -121,9 +121,10 @@ define start_loolwsd
--o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
--disable-ssl \
--o:admin_console.username=admin --o:admin_console.password=admin \
- --o:logging.file[@enable]=true --o:logging.level=trace > /dev/null 2>&1 \
+ --o:logging.file[@enable]=true --o:logging.level=trace \
--port=$(FREE_PORT) \
- --pidfile=$(PID_FILE) &
+ --pidfile=$(PID_FILE) \
+ > /dev/null 2>&1 &
@$(WAIT_ON_BINARY) http://localhost:$(FREE_PORT) --timeout 60000
@echo
endef
commit 8bd3bc178eed8ddb000f0551fc87fbc18abebd73
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Thu Feb 20 22:01:27 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 2 20:32:45 2020 +0100
parallel-cypress: initial parallelization
- Run all spec files separately so we can run them
parallel.
- Use separate test files for all spec files.
- Disable two tests which are failing while running in parallel.
Change-Id: I521feeac6e1ac4c3d2c87e989c11d4231945e569
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index e05ddbb82..0e71f1fe2 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -13,24 +13,63 @@ DESKTOP_USER_AGENT = "cypress"
DESKTOP_TEST_FOLDER = $(abs_srcdir)/integration_tests/desktop
DESKTOP_DATA_FOLDER = $(abs_srcdir)/data/desktop/
DESKTOP_WORKDIR = $(abs_builddir)/workdir/desktop/
+DESKTOP_TRACK_FOLDER=$(abs_builddir)/workdir/track/desktop
MOBILE_USER_AGENT = "cypress mobile"
MOBILE_TEST_FOLDER = $(abs_srcdir)/integration_tests/mobile
MOBILE_DATA_FOLDER = $(abs_srcdir)/data/mobile/
MOBILE_WORKDIR = $(abs_builddir)/workdir/mobile/
+MOBILE_TRACK_FOLDER=$(abs_builddir)/workdir/track/mobile
ALLOWED_PORTS = $(shell seq 9900 1 9980)
-FREE_PORT=$(shell $(GET_PORT_BINARY) --host=127.0.0.1 $(ALLOWED_PORTS))
-
KILL_COMMAND=pkill -F $(PID_FILE) || pkill --signal SIGKILL -F $(PID_FILE)
if HAVE_LO_PATH
-check-local: @JAILS_PATH@ $(NODE_BINS)
+MOBILE_TEST_FILES= \
+ calc/calc_focus_spec.js \
+ impress/impress_focus_spec.js \
+ writer/apply_font_spec.js \
+ writer/apply_paragraph_properties_spec.js \
+ writer/bottom_toolbar_spec.js \
+ writer/focus_spec.js \
+ writer/insert_field_spec.js \
+ writer/insert_formatting_mark_spec.js \
+ writer/insert_object_spec.js \
+ writer/mobile_wizard_state_spec.js \
+ writer/shape_properties_spec.js \
+ writer/spellchecking_spec.js \
+ writer/styles_spec.js \
+ writer/table_properties_spec.js \
+ writer/toolbar_spec.js
+
+DEKSTOP_TEST_FILES= \
+ copy_paste_spec.js \
+ example_desktop_test_spec.js \
+ shape_operations_spec.js
+
+MOBILE_TEST_FILES_DONE= \
+ $(foreach test_file,$(MOBILE_TEST_FILES),$(MOBILE_TRACK_FOLDER)/$(test_file).done)
+
+DESKTOP_TEST_FILES_DONE= \
+ $(foreach test_file,$(DEKSTOP_TEST_FILES),$(DESKTOP_TRACK_FOLDER)/$(test_file).done)
+
+check-local: $(MOBILE_TEST_FILES_DONE) $(DESKTOP_TEST_FILES_DONE)
+ @$(KILL_COMMAND) || true
+
+$(PID_FILE): @JAILS_PATH@ $(NODE_BINS)
$(call run_JS_error_check)
+ $(eval FREE_PORT:=$(shell $(GET_PORT_BINARY) --host=127.0.0.1 $(ALLOWED_PORTS)))
$(call start_loolwsd)
- $(call run_desktop_tests)
- $(call run_mobile_tests)
- @$(KILL_COMMAND) || true
+
+$(MOBILE_TEST_FILES_DONE): $(PID_FILE)
+ $(call run_mobile_tests,$(subst $(MOBILE_TRACK_FOLDER),,$(basename $@)))
+ @mkdir -p $(dir $@)
+ @touch $@
+
+$(DESKTOP_TEST_FILES_DONE): $(PID_FILE)
+ $(call run_desktop_tests,$(subst $(DESKTOP_TRACK_FOLDER),,$(basename $@)))
+ @mkdir -p $(dir $@)
+ @touch $@
check-desktop: @JAILS_PATH@ $(NODE_BINS)
$(call run_JS_error_check)
commit a47db54ea53ecae13232072b7c57dbe68dd3b040
Author: Pedro Pinto Silva <pedro.silva at collabora.com>
AuthorDate: Thu Feb 27 15:08:34 2020 +0100
Commit: Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Mon Mar 2 20:02:39 2020 +0100
Mobile: mobileWizard: Impress: add iconpath according to its id from unocomands coming from core for this case specific
Change-Id: I5f91790528a71e8bff5de58b0d3988aa305c02c5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89635
Reviewed-by: Pedro Pinto da Silva <pedro.silva at collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
diff --git a/loleaflet/images/lc_masterslide.svg b/loleaflet/images/lc_masterslide.svg
new file mode 100644
index 000000000..3ed432c99
--- /dev/null
+++ b/loleaflet/images/lc_masterslide.svg
@@ -0,0 +1,24 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
+ <path
+ style="fill:#ffffff"
+ d="M 3 5 L 3 18 L 11.673828 18 C 14.17979 15.495595 16.680211 12.990736 19.189453 10.509766 C 19.524376 10.175251 19.978129 10 20.419922 10 C 20.615312 10 20.811255 10.038717 21 10.105469 L 21 5 L 3 5 z M 21 17.216797 C 20.730874 17.47813 20.459641 17.737778 20.191406 18 L 21 18 L 21 17.216797 z "
+ />
+ <path
+ style="fill:#4d82b8"
+ d="M 2 4 L 2 19 L 10.955078 19 L 11.046875 18.625 C 11.256041 18.416048 11.464753 18.208945 11.673828 18 L 3 18 L 3 5 L 21 5 L 21 10.105469 C 21.238067 10.189663 21.463775 10.321444 21.652344 10.509766 L 22 10.857422 L 22 4 L 2 4 z M 5 10 L 5 11 L 6 11 L 6 10 L 5 10 z M 7 10 L 7 11 L 18.697266 11 C 18.798138 10.900106 18.8991 10.799045 19 10.699219 L 19 10 L 7 10 z M 5 12 L 5 13 L 6 13 L 6 12 L 5 12 z M 7 12 L 7 13 L 16.691406 13 C 17.025573 12.66736 17.359008 12.332051 17.693359 12 L 7 12 z M 5 14 L 5 15 L 6 15 L 6 14 L 5 14 z M 7 14 L 7 15 L 14.683594 15 C 15.017933 14.666149 15.35312 14.333457 15.6875 14 L 7 14 z M 22 16.248047 C 21.665915 16.570229 21.332857 16.893578 21 17.216797 L 21 18 L 20.191406 18 C 19.850549 18.333217 19.507243 18.664999 19.167969 19 L 22 19 L 22 16.248047 z "
+ />
+ <path
+ style="fill:#eac282"
+ d="M 5,7 V 9 H 19 V 7 Z"
+ />
+ <g
+ fill="#eac282"
+ >
+ <path
+ d="m17.480469 13.611328-5.529297 5.523438-.951172 3.865234 3.806641-1.011719 5.509765-5.544922z"
+ />
+ <path
+ d="m20.419922 11c-.189562 0-.378184.07172-.523438.216797l-1.673828 1.669922 2.847656 2.849609 1.710938-1.638672c.290506-.290127.290506-.756747 0-1.046875l-1.835938-1.833984c-.145254-.145064-.335828-.216797-.52539-.216797z"
+ />
+ </g>
+</svg>
diff --git a/loleaflet/images/lc_paperformat.svg b/loleaflet/images/lc_paperformat.svg
new file mode 100644
index 000000000..4af2b1a3c
--- /dev/null
+++ b/loleaflet/images/lc_paperformat.svg
@@ -0,0 +1,10 @@
+<svg version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path d="m21 5h-18v14h18z" fill="#fff"/>
+ <g transform="rotate(90,12,12)" fill="#4d82b8">
+ <path d="m7 3h1v18h-1z"/>
+ <path d="m16 3h1v18h-1z"/>
+ <path d="m5 5h14v1h-14z"/>
+ <path d="m4.6022 18h14.398v1h-14.398z"/>
+ </g>
+ <path d="m22 5c0-0.554-0.446-1-1-1h-18c-0.554 0-1 0.446-1 1v14c0 0.554 0.446 1 1 1h18c0.554 0 1-0.446 1-1zm-1 0v14h-18v-14z" fill="#808080"/>
+</svg>
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 27781a8f8..ebb006607 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -242,6 +242,8 @@ L.Control.JSDialogBuilder = L.Control.extend({
var leftDiv = L.DomUtil.create('div', 'ui-header-left', sectionTitle);
var titleClass = '';
+ if (sectionTitle.id === 'paperformat' || sectionTitle.id === 'orientation' || sectionTitle.id === 'masterslide')
+ iconPath = 'images/lc_'+ sectionTitle.id +'.svg';
if (iconPath) {
var icon = L.DomUtil.create('img', 'menu-entry-icon', leftDiv);
icon.src = iconPath;
commit 65a19d4e216b279d27c7c6bd58c03ee3586fc93a
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Mar 2 09:32:15 2020 +0100
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Mar 2 19:04:55 2020 +0100
android: reuse an already open activity when starting a new one
This sets the "launchMode" of the LOActivity to "singleTask" and
implements "onNewIntent". This is necessary so that we don't
duplicate LOActivity instances, as that isn't handled correctly
and can cause a freeze or in some cases that text input from one
instance is sent to the other. The back button stack isn't ideal
as it still can return us to LibreOfficeUIActivity even when the
activity is started from some other app, but this at least is
consistent with how some other apps work.
Change-Id: Idd11214578ec124661e2612bb49ba7e4bc4f3cea
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89811
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 5d1f2b091..79cea3f49 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -35,7 +35,6 @@
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
-
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
@@ -50,7 +49,8 @@
<!-- The main document editing Activity -->
<activity
android:name="org.libreoffice.androidlib.LOActivity"
- android:configChanges="orientation|screenSize|screenLayout|keyboardHidden">
+ android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
+ android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index ef8aa9bf3..c7796d05c 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -397,6 +397,36 @@ public class LOActivity extends AppCompatActivity {
}
}
+ @Override
+ protected void onNewIntent(Intent intent) {
+
+ Log.i(TAG, "onNewIntent");
+
+ if (documentLoaded) {
+ postMobileMessageNative("save dontTerminateEdit=true dontSaveIfUnmodified=true");
+ }
+
+ final Intent finalIntent = intent;
+ mProgressDialog.indeterminate(R.string.saving);
+ mainHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ documentLoaded = false;
+ postMobileMessageNative("BYE");
+ copyTempBackToIntent();
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ mProgressDialog.dismiss();
+ setIntent(finalIntent);
+ init();
+ }
+ });
+ }
+ });
+ super.onNewIntent(intent);
+ }
+
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
@@ -417,7 +447,7 @@ public class LOActivity extends AppCompatActivity {
loadDocument();
} else {
Toast.makeText(this, getString(R.string.storage_permission_required), Toast.LENGTH_SHORT).show();
- finish();
+ finishAndRemoveTask();
break;
}
break;
@@ -626,7 +656,7 @@ public class LOActivity extends AppCompatActivity {
}
});*/
- finish();
+ finishAndRemoveTask();
}
});
}
commit e30b03513646fa5587f677f6b84a59d153d1c234
Author: Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Sun Mar 1 10:58:49 2020 +0530
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Mon Mar 2 16:53:19 2020 +0100
leaflet: removed legacy inertia scrolling implementation
Change-Id: I6be07f1d16ea6bcebfa9c8c2712b713c3f0b1950
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89772
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/src/main.js b/loleaflet/src/main.js
index ba500fd09..7fdbee43d 100644
--- a/loleaflet/src/main.js
+++ b/loleaflet/src/main.js
@@ -66,7 +66,6 @@ var map = L.map('map', {
alwaysActive: alwaysActive,
idleTimeoutSecs: idleTimeoutSecs, // Dim when user is idle.
outOfFocusTimeoutSecs: outOfFocusTimeoutSecs, // Dim after switching tabs.
- inertia: false
});
////// Controls /////
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index a4804775d..97a8eb6b6 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -132,7 +132,6 @@ L.Map = L.Evented.extend({
this.addHandler('dragging', L.Map.Drag);
if ((L.Browser.touch && !L.Browser.pointer) || (L.Browser.cypressTest && L.Browser.mobile)) {
this.dragging.disable();
- this.options.inertia = false;
this.dragging._draggable._manualDrag = true;
this._mainEvents('off');
this.addHandler('touchGesture', L.Map.TouchGesture);
diff --git a/loleaflet/src/map/handler/Map.Drag.js b/loleaflet/src/map/handler/Map.Drag.js
index e90082286..41170f24f 100644
--- a/loleaflet/src/map/handler/Map.Drag.js
+++ b/loleaflet/src/map/handler/Map.Drag.js
@@ -4,12 +4,7 @@
*/
L.Map.mergeOptions({
- dragging: true,
-
- inertia: !L.Browser.android23,
- inertiaDeceleration: 3400, // px/s^2
- inertiaMaxSpeed: Infinity, // px/s
- easeLinearity: 0.2,
+ dragging: true
});
L.Map.Drag = L.Handler.extend({
@@ -49,27 +44,9 @@ L.Map.Drag = L.Handler.extend({
map
.fire('movestart')
.fire('dragstart');
-
- if (map.options.inertia) {
- this._positions = [];
- this._times = [];
- }
},
_onDrag: function (e) {
- if (this._map.options.inertia) {
- var time = this._lastTime = +new Date(),
- pos = this._lastPos = this._draggable._absPos || this._draggable._newPos;
-
- this._positions.push(pos);
- this._times.push(time);
-
- if (time - this._times[0] > 50) {
- this._positions.shift();
- this._times.shift();
- }
- }
-
this._map
.fire('move', e)
.fire('drag', e);
@@ -97,43 +74,9 @@ L.Map.Drag = L.Handler.extend({
},
_onDragEnd: function (e) {
- var map = this._map,
- options = map.options,
-
- noInertia = !options.inertia || this._times.length < 2;
+ var map = this._map;
map.fire('dragend', e);
-
- if (noInertia) {
- map.fire('moveend');
- } else {
- var direction = this._lastPos.subtract(this._positions[0]),
- duration = (this._lastTime - this._times[0]) / 1000,
- ease = options.easeLinearity,
-
- speedVector = direction.multiplyBy(ease / duration),
- speed = speedVector.distanceTo([0, 0]),
-
- limitedSpeed = Math.min(options.inertiaMaxSpeed, speed),
- limitedSpeedVector = speedVector.multiplyBy(limitedSpeed / speed),
-
- decelerationDuration = limitedSpeed / (options.inertiaDeceleration * ease),
- offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round();
-
- if (!offset.x || !offset.y) {
- map.fire('moveend');
- } else {
- offset = map._limitOffset(offset, map.options.maxBounds);
-
- L.Util.requestAnimFrame(function () {
- map.panBy(offset, {
- duration: decelerationDuration,
- easeLinearity: ease,
- noMoveStart: true,
- animate: true
- });
- });
- }
- }
+ map.fire('moveend');
}
});
commit 3697315349720ddadada8ef8e88f9d471c1c5baf
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Feb 21 13:57:58 2020 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Mon Mar 2 16:51:32 2020 +0100
loleaflet: makefile: use m4 to bundle src js files
It is a flexible bundling of the loleafet source files
and each platform (ANDROID, IOS, DESKTOP) can prevent to
bundle some files that is not necessary.
(i.e Mouse handling in native mobile devices)
Change-Id: If018bcc8682df5ae4bf5dd9943aa977e18c0de36
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89734
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Tested-by: Henry Castro <hcastro at collabora.com>
Reviewed-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 618bbd093..2710f180e 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -357,11 +357,14 @@ $(LOLEAFLET_PREFIX)/dist/loleaflet-src.js: $(LOLEAFLET_JS_SRC)
@echo "Checking for loleaflet JS errors..."
@NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/src \
$(srcdir)/js --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
- @(cat $(srcdir)/src/copyright.js | sed 's/{VERSION}/$(LOLEAFLET_VERSION)/' - \
- && echo "(function (window, document, undefined) {" \
- && awk 'FNR == 1 {print ""} 1' \
- $(patsubst %.js,$(srcdir)/%.js,$(LOLEAFLET_JS)) \
- && echo "}(window, document));") > $@
+ @m4 -PE -DIOSAPP=$(ENABLE_IOSAPP) \
+ -DGTKAPP=$(ENABLE_GTKAPP) \
+ -DANDROIDAPP=$(ENABLE_ANDROIDAPP) \
+ -DMOBILEAPPNAME="$(APP_NAME)" \
+ -DVERSION=$(LOLEAFLET_VERSION) \
+ -DCOPYRIGHT=$(srcdir)/src/copyright.js \
+ -DLOLEAFLET_JS=$(subst $(SPACE),$(COMMA),$(patsubst %.js,$(srcdir)/%.js,$(LOLEAFLET_JS))) \
+ $(srcdir)/loleaflet-src.js.m4 > $@
$(builddir)/dist/bundle.css: $(LOLEAFLET_CSS)
@echo "Uglify loleaflet css files..."
diff --git a/loleaflet/loleaflet-src.js.m4 b/loleaflet/loleaflet-src.js.m4
new file mode 100644
index 000000000..02c674545
--- /dev/null
+++ b/loleaflet/loleaflet-src.js.m4
@@ -0,0 +1,13 @@
+m4_changequote([,])m4_dnl
+m4_dnl# m4_foreachq(x, `item_1, item_2, ..., item_n', stmt)
+m4_dnl# quoted list, alternate improved version
+m4_define([m4_foreachq],[m4_ifelse([$2],[],[],[m4_pushdef([$1])_$0([$1],[$3],[],$2)m4_popdef([$1])])])m4_dnl
+m4_define([_m4_foreachq],[m4_ifelse([$#],[3],[],[m4_define([$1],[$4])$2[]$0([$1],[$2],m4_shift(m4_shift(m4_shift($@))))])])m4_dnl
+m4_dnl
+m4_include(COPYRIGHT)m4_dnl
+
+(function (window) {
+
+m4_foreachq([fileJS],[LOLEAFLET_JS],[m4_syscmd([cat ]fileJS)])
+
+}(window));
commit c99664b19c52f7357367b1d8b626145312f44a24
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Mar 2 08:01:07 2020 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Mar 2 16:25:05 2020 +0100
StringVector: fix build with gcc-4.9
Debian 8 has gcc-4.9, which emits -Werror in case a parameter and a
member function has the same name. Given that we also use -Werror
unconditionally, this breaks the build. Newer gcc/clang versions relaxed
this warning, so this was not a problem in those cases.
Change-Id: I7ad09370d96aa7384b2c117dd8de421644898b50
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89785
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/common/StringVector.cpp b/common/StringVector.cpp
index 89777166b..4527e593e 100644
--- a/common/StringVector.cpp
+++ b/common/StringVector.cpp
@@ -59,17 +59,17 @@ std::string StringVector::getParam(const StringToken& token) const
return _string.substr(token._index, token._length);
}
-std::string StringVector::cat(const std::string& separator, size_t begin) const
+std::string StringVector::cat(const std::string& separator, size_t offset) const
{
std::string ret;
bool first = true;
- if (begin >= _tokens.size())
+ if (offset >= _tokens.size())
{
return ret;
}
- for (auto it = _tokens.begin() + begin; it != _tokens.end(); ++it)
+ for (auto it = _tokens.begin() + offset; it != _tokens.end(); ++it)
{
if (first)
{
More information about the Libreoffice-commits
mailing list