add support for runtime permissions on api23+
add support for devices with a notch on api28+
fix some potential memory leaks
do not check luajit-launcher shell scripts
Follow-up to https://github.com/koreader/koreader/pull/4524
The regex in the Python wasn't actually picking up on that style of writing it at all, because it's not only ugly, but also so counter-intuitive that I overlooked to test for and add support for it.
```
_(
[[
```
It'd be easy to fix up the Python regex a little, and perhaps I will,
but either way it makes more sense to automatically enforce this as a coding standard.
Apply junit testcase time fix so CircleCI can actually do something useful
with the results. This can be removed once there is a busted 2.0.rc13 or final
See 830f175c57
* junit test results; unfortunately this seems to conflict with the verbose out
* fix deps cache: two files can change independently
* verbose print obsoleted by gtest in upsream busted
The debug output from Coveralls was rubbish. `"Build processing error"`
Besides some basics like checking if we were actually sending
valid JSON that gives us absolutely nothing to work with.
I wrote this whole complicated wofkflow-based config file, but except
in the case of a base rebuild it wouldn't really be any faster than
this simple tweak.
```
defaults: &defaults
docker:
- image: houqp/kobase:0.0.5
environment:
EMULATE_READER: 1
# this is for shellcheck 0.4.5 and lower; can be removed for 0.4.6
LC_ALL: en_US.UTF8
version: 2
jobs:
install-and-build:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
# binary dependencies require {{ arch }} because there are different CPUs in use on the servers
- deps-{{ arch }}-{{ checksum ".ci/install.sh" }}
# need to init some stuff first or git will complain when sticking in base cache
- run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd
# we can't use command output directly for cache check so we write it to git-rev-base
- run: pushd base && git_rev_base=$(git describe HEAD) && popd && echo $git_rev_base && echo $git_rev_base >git-rev-base
- restore_cache:
keys:
- build-{{ arch }}-{{ checksum "git-rev-base" }}
- run: echo 'export PATH=${HOME}/bin:${PATH}' >> $BASH_ENV
- run:
name: setup
command: .ci/before_install.sh
- run:
name: install
command: .ci/install.sh
- save_cache:
key: deps-{{ arch }}-{{ checksum ".ci/install.sh" }}
paths:
- "/home/ko/bin"
- "/home/ko/.luarocks"
# compiled luarocks binaries
- "install"
- run:
name: fetch
command: .ci/fetch.sh
- run:
name: check
command: .ci/check.sh
- run:
name: build
command: .ci/build.sh
- save_cache:
key: build-{{ checksum "base/git-rev" }}
paths:
- "/home/ko/.ccache"
- "base"
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory
root: "./"
# Must be relative path from root
paths:
# front build
- "koreader-emulator-x86_64-linux-gnu/koreader"
test:
<<: *defaults
parallelism: 4
steps:
- checkout
- restore_cache:
keys:
# binary dependencies require {{ arch }} because there are different CPUs in use on the servers
- deps-{{ arch }}-{{ checksum ".ci/install.sh" }}
# need to init some stuff first or git will complain when sticking in base cache
- run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd
# we can't use command output directly for cache check so we write it to git-rev-base
- run: pushd base && git_rev_base=$(git describe HEAD) && popd && echo $git_rev_base && echo $git_rev_base >git-rev-base
- restore_cache:
keys:
- build-{{ arch }}-{{ checksum "git-rev-base" }}
- run: echo 'export PATH=${HOME}/bin:${PATH}' >> $BASH_ENV
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: "./"
- run:
name: test
command: .ci/test.sh
docs-and-coverage:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
# binary dependencies require {{ arch }} because there are different CPUs in use on the servers
- deps-{{ arch }}-{{ checksum ".ci/install.sh" }}
# need to init some stuff first or git will complain when sticking in base cache
- run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd
# we can't use command output directly for cache check so we write it to git-rev-base
- run: pushd base && git_rev_base=$(git describe HEAD) && popd && echo $git_rev_base && echo $git_rev_base >git-rev-base
- restore_cache:
keys:
- build-{{ arch }}-{{ checksum "git-rev-base" }}
- run: echo 'export PATH=${HOME}/bin:${PATH}' >> $BASH_ENV
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: "./"
- run:
name: cleanup
command: .ci/after_success.sh
workflows:
version: 2
build-and-test:
jobs:
- install-and-build
- test:
requires:
- install-and-build
- docs-and-coverage:
requires:
- install-and-build
```
* Enable parallelism in .circleci/config.yml
* Add BUSTED_SPEC_FILE to Makefile testfront
* Use it in .ci/test.sh with xargs for test parallelization
NB This is the dumb method of improving test time.
Ideally we want a workflow fan-in/fan-out approach.
* shellcheck 0.4.5 fix `LC_ALL: en_US.UTF8` (can be removed for shellcheck 0.4.6)
* hush updated luacheck on `reader.lua`; we're not assigning any variables but `= nil` is redundant
Parsing and rasterisation provided by nanosvg (some svg tags like text,
span and images are not supported).
Only svg image included as files in the .epub are supported
(embedded svg tags in html are not).
Holding on svg image shows it 4x zoomed in ImageViewer.
* translation text fix
* quickstart(fix): go back to home dir after document close
* quickstart(fix): purge old quick start files
* spec: fix quickstart tests
Travis only makes a shallow clone of --depth=50. KOReader is small enough that we can just grab it all. This is necessary to generate the version number, without which some tests will fail.
I'm not entirely sure why something like `git fetch origin master tags/v2015.11` doesn't do the trick, but it doesn't matter much.
* Travis: speed up by caching base and running luacheck earlier
* ignore bin and install for git status change detection
* skip coverage except on official master branch. It adds 3 whole minutes and does nothing to prevent regressions
* also cache ~/.luarocks. It evens out but would generally prevent remote timeout shenenigans
* remove base cache dir before caching with verbose remove to see what's going on
* more inclusive shell code quality analysis
* fixed more shellcheck issues
* better shellcheck/shfmt debugging info
and have more confidence with the unit testing framework.
Now `make testfront` won't retry on failure and testing files are
ordered in each run so that it's possible to reproduce testing failure.
And this patch also fix flush settings not working before suspend issue:
at some point the `FlushSettings` event is sent to `UIManager` instead
of `ReaderUI`, but `UIManager` only delegated events to active widgets
and `ReaderUI` is actually not an active widgets thus will miss the event.
This patch also add a verbose debug mode with "-v" as a switch to turn
on this mode. With verbose mode on, event handling will be logged.
1. It turns out that `device_id` is not defined in unit test environment
which makes the `assert(self.kosync_device_id)` fail and somehow makes `luajit` segmentation fault.
2. In the device spec, stubbing `io.open` will make subsquent `require`
all return boolean value and segmentation fault `luajit`.
This patch is a minimum viable change that makes CI work on both my
local box and Travis.