The regexp engine does not have any recursion depth check, thus it can cause problems with various regexps. Added a new build option `--regexp-recursion-limit N` whose
default value is 0, which is for unlimited recursion depth. Also added a build-option-test.
Fixes#2448Fixes#2190
JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
Because these feature guards don't have their counterpart options in cmake, they
seem to be less tested. This commit makes them build-tested at least.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The `-m32/64` compiler flags are x86/64-specific (mostly; at least in the
context of JerryScript-supported architectures) and macOS has deprecated 32-bit
support, so it's better to keep the build-testing of `-m32` to x86[-64]/Linux
only.
JerryScript-DCO-1.0-Signed-off-by: Renata Hodovan reni@inf.u-szeged.hu
The America/Los_Angeles time zone is already enforced for test262
Travis CI jobs but that doesn't guarantee the correctness of
locally executed tests. So, this patch moves the setting of the
`TZ` environment variable from `.travis.yml` to `run-tests.py`.
The date-related tests in the jerry test suite also rely on a time
zone (UTC). Thus, `TZ` is forced for those tests, too.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Rationale:
- There is no port under targets/ that would use it. All of them
turn it off when building.
- That's no surprise, as jerry-libc supports no barebone MCUs but
posix targets with syscalls only. Actually, that's Linux only,
because macOS builds have turned off the use of jerry-libc a
while ago.
- And there is no point in maintaining a highly restricted set of
libc functions: as soon as someone wants to use JerryScript in a
scenario that needs more functions than jerry-main, they have to
choose a different libc (most problably the compiler's default
one).
I think that we should not keep supporting an otherwise unused
library for the purposes of jerry-main on arm/x86/x64-linux only.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
In `tools/build.py`:
- For the sake of readability, group CLI arguments as general build
options, options to control the building of components, and
component-specific options.
- To prevent duplications, remove the defaults from those CLI
arguments that correspond to CMake options and have defaults in
any of the CMakeLists. Should any of the defaults change, they
will have to be changed at a single place only. (Those options
that are not set on the command line of `tools/build.py` are not
passed as options to `cmake` either.)
- Convert `--unittests` and `--doctests` to ON/OFF options like the
rest of the component switches.
- Touch on some of the help messages of the CLI arguments.
Other changes:
- The change in `--unittests` and `--doctests` is a slightly CLI-
breaking change of `tools/build.py`. Thus, follow up on this in
`tools/run-tests.py`.
- Move `ENABLE_ALL_IN_ONE` into `jerry-core` as it is not a general
option but specific to that component.
- Remove the forcing of `ENABLE_ALL_IN_ONE` for some compilers/
platforms as it is still an option, not a hard requirement.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
- Add `--install` option to `tools/build.py`.
- Make use of `--install` in `tools/run-tests.py` by testing the
installed the executables instead of those in the build tree.
Related changes:
- Collect unit test binaries in the `tests` subdir of the build
tree instead of `bin`.
- The `ls`-based collection of the unit test binaries had some
shortcomings hitherto unrevealed (it didn't filter for files so
it could potentially "collect" dictionaries, too), which has now
been replaced with a more stable `find`-based solution.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
- Code contains syntactic duplications (e.g., build options copy-
pasted repeatedly).
- Build options for test suites contain semantic duplications
(ES5.1 profile builds happen multiple times, once by not
specifying a profile and once by specifying es5.1 profile
explicitly).
- External build options are not taken into account when detecting
duplicated builds.
This patch provides improvement for these issues.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
None of the code paths have been tested for long and especially the
Freya code paths have been long abandoned. This patch:
- Merges Valgrind-Freya into Valgrind code path (there should be no
need to choose between them, Valgrind should work just fine).
- Removes leftover code (`VALGRIND_FREYA_CHECK_MEMPOOL_REQUEST` and
`valgrind_freya_mempool_request`).
- Adds `JMEM_` prefix to Valgrind-related macros (to correctly
leave the `VALGRIND_` prefix to Valgrind).
- Moves the definition of the Valgrind-related macros to a common
header to avoid duplication.
Note: Adding a CI job to perform Valgrind Memchecks is left for
follow-up as it turns out to be excessively slow (>50 mins for a
`--jerry-tests --jerry-test-suite` run, and even a simple
`--jerry-tests` may get terminated prematurely because of timeout
issues).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Add line info data to byte, which allows getting a backtrace info directly
from the engine. Snapshots are not supported.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
In one of the previous PR we have encountered a problem,
where the Travis cuts off the test execution
as the generated log file is too big.
By adding a quiet mode for the test runners, we will
only report the failing tests.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
On argument handling:
- Merged all signoff check options into one, option value chooses
between strict/tolerant check variants.
- Added sensible metavars to options with arguments (consistent
with metavars of build.py).
- Reordered options to match the order the checks are executed in.
- Added `--all` alias to `--precommit` check option.
- Beautified code (always placed `help` on separate line, removed
unnecessary arguments of `add_argument` that just repeated their
defaults).
On test runner logic:
There was too many code duplication on how checks were executed, it
got refactored. No change in semantics.
The only change was in Travis CI-related invocations,
`--check-signed-off-travis` had to be rewritten to
`--check-signed-off=travis`.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Some benchmark suites contain test cases that have nonreproducible
behaviour. This is mostly caused by relying on "now" when dealing
with dates or timestamps, instead of using a fixed moment. (A
notorious example is the crypto-aes.js test case of the sunspider
bechmark suite, where the heap memory consumption can vary between
34K-41K heap because of using `(new Date()).getTime()`.)
This commit renames the jerry-minimal command line tool to
jerry-test (to better reflect its purpose) and adds extra code,
which intercepts some calls to libc (`gettimeofday`, `rand`) and
pins their results to some fixed values. This makes the tool
useless in a general case but ensures stable results when
benchmarking -- for which it is mostly used.
As a side effect, the commit also changes jerry-libc by making all
libc functions weak symbols to allow their override from
application code.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Now there is a snapshot tool which can merge snapshots
but was unable to generate snapshots by itself.
This change moves the snapshot generation utilities
to the snapshot tool.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This patch adds an extension to snapshots which allows storing
multiple position independent primary functions in a single
snapshot data. A new application called jerry-snapshot is
added to the project to manage snapshots. Currently the only
option is merging snapshots.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Whit this enhancement the debugger can able handle more than one source file across the new source wait mode.
This feature can be used by the python client with the --client-source [paths] switch.
The client will store every source path, when the debugger send a signal about the waiting status, then the client will send one file from the list.
JerryScript-DCO-1.0-Signed-off-by: Imre Kiss kissi.szeged@partner.samsung.com
Markdown files in the docs/ directory can now be annotated to turn
fenced C code blocks into unit tests. The recognized syntax is:
[doctest]: # (name="test.c", test="run")
```c
// unit test code
```
The commit also fixes the issues revealed during the initial
annotation.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
JerryScript should support external context, heap and lcache,
so that it can have multiple instances and runtime configurable heap
size.
Related issue: 1746
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
Currently, `lit-magic-strings.inc.h` is manually maintained. This
has several drawbacks:
- keeping the list of magic strings sorted first by length then
alphabetically is error prone,
- it is easy to leave unused magic strings in the list by accident
(e.g., `LIT_MAGIC_STRING_JERRY_UL` is defined as a magic string
but not used anywhere in the code) and,
- it is very hard to add `CONFIG_DISABLE_*_BUILTIN` guards to the
list, even though there are several magic strings, which are used
in some of the configurations only (e.g, "setPrototypeOf" is used
in ES2015 only).
To ease the maintenance of magic strings, this commit moves the
definition of magic strings to a config file
(`lit-magic-strings.ini`), and adds `tools/gen-magic-strings.py` to
generate the `.inc.h` file from this config file and from the use
cases of the strings in the code.
- The magic strings in the config file can appear in any order, the
generator will ensure that they are correctly sorted.
- The generator skips those definitions that are not used anywhere
(and emits a warning to signal that such definitions can be
removed).
- The generator applies the same guards to the definitions in the
`.inc.h` file as found in the code around the use of the strings
to optimize for size.
The commit also changes some builtin-related `.inc.h` files by
adding guards that don't affect functionality but improve the
results of the generator.
To ensure that the invocation of the generator does not get
forgotten, the commit also adds `tools/check-magic-strings.sh` and
binds it into the testing infrastructure.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The `run-tests.py` test execution harness validates the correctness
of JerryScript by building various configurations of jerry and
running various test suites and subsets against it. However, until
now, it always built jerry for each (build configuration, test suite)
pair. This commit improves `run-tests.py` by skipping duplicate
builds, sharing the same-built binaries across multiple test suite
runs.
The patch also improves on the style of how `Option`s are specified
and fixes the name of the `jerry_tests-debug-cpointer_32bit`
option.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Fixed all of the remaining warnings in 'build.py', 'run-tests.py' and 'check-license.py'.
Related issue: #1600
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Add `--skip-list` option to tools/run-tests.py.
Additional modifications:
- The test `parser-oom.js` doesn't work when system-allocator is enabled,
hence we skip it in these jobs.
- The sanitizer-tasks become mandatory.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
* Added 'pylint' to dependencies
* Added pylint config file
* Added to travis CI as an allow failure job
(until all of the warnings are fixed)
* Added to 'run-test.py'
Related issue: #1600
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
The debugger supports setting breakpoints, execution control (step, next, continue)
and getting backtrace. The communication is WebSocket-based, so a browser can
communicate with JerryScript without any intermediate application.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
* Fixed Doxygen issues
* Updated Doxygen config
* Added new script to test whether doxygen generation was successful or not
* Added to Travis CI
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Added a new 'buildoptions' option to tools/run-tests.py to add
a comma separated list of extra build options to each test.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Add a set of tests to ensure basic coverage of the ArrayBuffer built-in. Support for ArrayBuffer was added in #1467.
Closes#1475.
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
Since the project is now hosted at the JS Foundation we can move to unified copyright notices for the project.
Starting with this commit all future contributions to the project should only carry the following copyright notice (except for third-party code which requires copyright information to be preserved):
"Copyright JS Foundation and other contributors, http://js.foundation" (without the quotes)
This avoids cluttering the codebase with contributor-specific copyright notices which have a higher maintenance overhead and tend to get outdated quickly. Also dropping the year from the copyright notices helps to avoid yearly code changes just to update the copyright notices.
Note that each contributor still retains full copyright ownership of his/her contributions and the respective authorship is tracked very accurately via Git.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
run-tests.py used to echo the build commands it executed, but did
not behave the same way when it executed test commands. To make its
behavior more traceable, this patch adds echo for test commands as
well.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
It's stated in the Guidelines that all contributions must be under
the Apache License 2.0. To avoid potential mistakes from manual
reviews, this patch adds the check-license.py script to
automatically check all source files for license headers.
Travis CI is also configured to run the check.
Fallout: it turned out that some files already in the code base
either miss a license header or have some minor typo differences.
The patch fixes up some of these deficiences.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
* Cmake had LTO OFF, build.py had LTO ON by default. ON became the
common setting.
* Cmake had snapshot save/exec OFF, build.py had them ON by
default. OFF became the common setting.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Although both jerry-libc and jerry-libm have configuration options
that enable/disable their build, in practice, only jerry-libc can be
replaced with the system (compiler-default) libc. If jerry-libm is
disabled, the build of jerry-main fails, as there is no way to
instruct the linker to link the system libm to the binary. (The
build system does have a way to pass flags to the linker, but those
flags are listed before the linked objects. For the references to
get resolved correctly, the libraries to be linked have to be
specified _after_ the objects.)
This patch adds the EXTERNAL_LINK_LIBS configuration option to
CMakeLists, which ensures that the specified libraries get
correctly passed to the linker. (E.g, replacing jerry-libm with
system libm becomes possible with
`JERRY_LIBM=OFF EXTERNAL_LINK_LIBS='-lm'`.)
Additionally, the patch also makes the following related changes:
* Removes the COMPILER_DEFAULT_LIBC configuration option, as it is
(almost) always the opposite of JERRY_LIBC. Moreover, its name is
misleading: its only role is to add `-nostdlib` to the linker
flags.
* Makes use of transitive library dependencies: if a library has
another library as dependency, and it is linked to a binary, its
dependency is linked as well. Thus, jerry-libc, jerry-libm, and
any external libraries are added to jerry-core as dependency, and
then only jerry-core is linked to executables (cmake will take
care of the rest).
* build.py and run-tests.py follow up the changes, along with some
minor syntax changes.
* Moves static linking option to global CMakeLists, as unit test
binaries should be linked the same way as jerry-main.
* Adds EXTERNAL_COMPILER_FLAGS and EXTERNAL_LINKER_FLAGS as last to
the flag list, to allow user override of (nearly) anything.
The patch speculatively follows up the build system changes in the
mbed, riot-stm32f4, and zephyr targets.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu