| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
Instead of always comparing against GNOME/gjs/master, try to find the
place where the current branch was branched off of the upstream repository
using an adaptation of the script that GLib uses.
The main adaptation compared to GLib is that we are running on a
lightweight image with sh and busybox, so we don't have fancy things like
process redirection and diff formatting options.
|
|
|
|
|
|
|
|
| |
Clone everything at depth 1, omitting tags, and fetching a specific branch
only.
Thanks to:
https://tecnocode.co.uk/2020/07/09/easily-speed-up-ci-by-reducing-download-size/
|
|
|
|
|
|
|
| |
IWYU 0.15 improves the accuracy of detecting missing includes, and also
removes a few false positives but also adds new false positives. Since we
are now running 0.15 in CI, we must adapt the postprocessing script, and
make the necessary changes to the source files.
|
|
|
|
| |
Replace with nullptr which is a keyword.
|
|
|
|
|
| |
There were a few instances of this false positive already in the code base
so remove those includes and add the files to the false positive list.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on looking at the git logs, add copyright notices to files which
were missing them, assuming the copyright belongs to people who made major
contributions to each file.
Some assumptions were made as to who to assign the copyright to, such as,
what copyright assignment did the contributor make in other files added in
the same commit? What email address did they use to make the commit? What
copyright assignment did they make in other commits using the same email
address?
|
|
|
|
|
|
| |
Allows us to move back to the distro's latest version of Meson, which no
longer has the bug that considers skipped tests as failed. Also upgrades
IWYU to 0.15, the version that goes along with Clang 11.
|
|
|
|
|
|
|
| |
Now that we have switched to mozjs78 there's no longer a need to continue
building new mozjs68 images. We can just use the one we currently have,
until it's no longer needed. Switch the defaults in the Dockerfiles to
build mozjs78 instead.
|
|
|
|
| |
And use them for mozjs78 builds, as build-deps may change
|
|
|
|
|
| |
Hopefully these are just drop-in replacements. We cannot rely on DockerHub
anymore because they are rate-limiting pulls.
|
|
|
|
|
| |
Since we are already building a light image with linters, add cpplint to
it as well and remove the separate Dockerfile build.
|
|
|
|
|
|
|
| |
The GObject.ref_count field is private, who knew! It is still accessible
but apparently it messes up cppcheck, so we use GObject weak pointers
instead to track the reference count of these objects, as demonstrated in
https://stackoverflow.com/a/24459058/172999
|
|
|
|
| |
A newer version of cppcheck catches this.
|
|
|
|
|
|
|
|
|
|
|
| |
ESLint has deprecated jsdoc and instead recommends eslint-plugin-jsdoc.
lint-condo does not have eslint-plugin-jsdoc. We only use lint-condo for
eslint currently and it is simpler to instead use yarn to install and
manage eslint.
Some module files had JSDoc comments which violated the jsdoc
plugin's more stringent rules.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As per C++ standard is perfectly legal for the compiler to check
template definitions both during instantation (so looking at potential
issues) and after their actual usage, so while g++ is more liberal on this
and will not try to define functions which are disabled when allocating
the template, clang++ will do it.
So, in the case of using a void pointer to hold GjsAutoPointer it will
complain when using void[] type.
To avoid this, let's change the array constructor definition to use an
implicit template value, while we still check it properly as part of the
enable_if check, so that we'll eventually have the same result.
Also fix other compilation issues due to clang being a bit more
stricter.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We had FIXME's about this for some time now, but we had a quite nice way
to check whether we're handling nullptr functions at compile time, so
that we can produce safe code with less dynamic checks:
- Previously we were trying to use `if constexpr (ref_func != nullptr)`
- The error we were getting was because we were trying to compare
a template value (that will be evaluated at link time) with
a null pointer (that yes, is a constant value).
- However, C++ provides us since the long C++11 times a nice tool that
allows to generate a type out from any constant value and that we can
do use it to do constexpr checks.
- Thus for each template function parameter we can just compute its
integral constant type, and ensure that it's not matching null.
Under the hood this will generate such types for examples:
for g_object_ref:
std::integral_constant<GObject* (*)(GObject*), g_object_ref>;
for nullptr:
std::integral_constant<GObject* (*)(GObject*), 0>
And those types are indeed different.
Added few tests, although to test invalid types we should add some
no-compilation tests.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not being an unique_ptr anymore we've some more freedom (that will be
way more when C++ will allow us to do more static checks), one of the
good gain we've now, is that we can easily implement a copy and swap
idiom to allow to pass the wrappers by value ensuring an internal copy.
This will not work (unfortunately only with runtime checks! :-( ) if the
wrapper doesn't provide a copy function, but this is still nice.
Tests included.
|
| |
|
|
|
|
|
|
|
|
| |
As per moving away from std::unique_ptr we lost support for C++ native
objects, even this may be optional (as we can just use stl containers
for that), it's still nice to have.
So add it back and include tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We introduced GjsAutoPointer as part of commit dab3c7d06, to avoid duplication
of the same code everywhere, and that served us well to create multiple
smart pointer types, however since we were relying on std::unique_ptr,
all the times we created a pointer with a custom destructor, we were
allocating 8bits more, and this can be sensitive when used around in
wrappers.
However, since we are already constructing the auto-pointers passing all
these information as template (generating some custom code, for sure),
we can just rely on the template parameters also for the destructor, and
so ensuring that the struct size always matches the wrapped pointer,
removing all the overhead.
This will allow to use GjsAutoPointer's everywhere without increasing
the size of the wrapped objects.
As per this being all new (even though the API is mainly inspired to
unique_ptr), adding various unit tests to ensure we behave correctly.
|
| |
|
|
|
|
|
|
| |
GCC accepts this, but when compiling with Clang we get an error that the
random number generator cannot be instantiated in a constant expression.
That makes sense.
|
|
|
|
|
|
| |
This adds a SPDX-License-Identifier comment to all files that are part
of GJS, part of its unit tests, or auxiliary tools. (Except for some
files like the debugger scripts that don't support comments.)
|
|
|
|
|
|
|
|
| |
The SPDX format is machine-readable, which should make it much easier to
avoid mistakes with licensing and copyright using automated tools.
This commit does not add any implicit information. It converts exactly
what was already specified into SPDX format comments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure that gjs_arg_set, gjs_arg_get and gjs_arg_unset work as expected
using random numbers that are generated per type and using some template
functions to do smarter comparisions.
Expose the random sed we used to generate the random numbers and
generate the c++ one using a random number generated from g_test so that
it will be consistent with `--seed` or in general with the GLib seed.
Add support for a `--cpp-seed` option to be able to pass it one manually
|
|
|
|
|
|
|
|
|
| |
Current JS Number's MAX_SAFE_INTEGER value is set to 9007199254740991,
however we set this value to 9007199254740992.
Fix the number computation and add an unit test to ensure that the value
we use is always matching JS definition (so that we are protected in the
unlikely case that anything would change).
|
|
|
|
|
|
|
|
| |
Due to changes in SpiderMonkey 78, js::EnableCodeCoverage() must be
called before using the code coverage APIs. Add a public GJS API that
wraps this function, and gives a clear error message if it's not called.
See: GNOME/gjs#329
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The LCOV output has changed slightly again in SpiderMonkey 78, so we
must update our tests to match. There are trivial modifications such as
changing the order that function records appear in, but it also seems
that SpiderMonkey now reports more branches: for loop conditions and for
default cases in switch statements.
The gjs_parse_call_args() tests depend on the text of certain error
messages, which were changed in SpiderMonkey 78.
See: GNOME/gjs#329
|
|
|
|
|
|
|
| |
- Unhandled promises now have a mute flag.
- Garbage collection now specifies the reason/source.
See: GNOME/gjs#329
|
|
|
|
|
|
|
|
|
|
| |
- <js/Array.h> and <js/ValueArray.h> are new headers.
- Rename JS_NewArrayObject to JS::NewArrayObject.
- Rename JS_GetArrayLength to JS::GetArrayLength.
- Rename JS_IsArrayObject to JS::IsArrayObject.
- Rename JS::AutoValueArray to JS::RootedValueArray.
See: GNOME/gjs#329
|
|
|
|
|
|
|
| |
The posix-nspr-emulation and unaligned-private-values options are gone,
so we need to make those optional and blank them out for mozjs78.
See: GNOME/gjs#329
|
|
|
|
| |
See previous commit. Unreviewed, pushing to fix build.
|
|
|
|
|
|
|
| |
Meson 0.55.0's TAP support is broken. This is a workaround for
https://github.com/mesonbuild/meson/issues/7515
Unreviewed, pushing to fix build.
|
|
|
|
|
|
|
|
|
|
| |
SpiderMonkey 78 has removed this feature and recommends using linters.
(For some bizarre reason, some of the output in the LCov coverage data
is influenced by this flag, so we need to change some of the expected
output.)
See: GNOME/gjs#329
|
|
|
|
|
|
| |
We need sysprof-capture-4 which has not been released yet. So we need to
build it ourselves. Build it only in the debug image, at least until it
is packaged on Fedora.
|
|
|
|
|
| |
Apparently llvm-config has been moved into a package that is no longer
included in mozjs68's build dependencies.
|
|
|
|
|
|
|
|
| |
g_assertion_message() can return if nonfatal assertions are enabled, but
for the purposes of static analysis, we want to consider it non-
returning.
See: GNOME/glib!1553
|
|
|
|
|
|
| |
This splits out a separate Dockerfile for the debug-enabled CI image,
and builds include-what-you-use on it as well. We'll use this for some
more automated code review.
|
|
|
|
|
|
|
| |
This updates all the includes according to what IWYU suggests. In a few
cases we move a typedef down in order to avoid IWYU wanting a forward
declaration, or use a JS::Heap<T>{braced initializer} in order to avoid
an implicit std::move.
|
|\
| |
| |
| |
| | |
tests: Don't use g_assert and g_assert_not_reached in tests
See merge request GNOME/gjs!430
|
| |
| |
| |
| |
| |
| |
| | |
These macros are no-ops if GLib is built with G_DISABLE_ASSERT, so they
are not appropriate to use in tests.
See: #298
|
| |
| |
| |
| | |
The previous code would produce a blank on 0 errors, not 0.
|
| |
| |
| |
| |
| | |
This method used to be broken in SpiderMonkey, but it's been fixed for a
long time now.
|
|/
|
|
|
| |
Unfortunately, we can no longer use Docker because the runners are
unprivileged.
|
|
|
|
|
|
| |
Most of the time we don't need these logs. Having them become too long
seems to crash the CI job since a few days ago, unfortunately. So enable
them only on one job, and make sure it is not the most verbose job.
|
|
|
|
| |
These are some leftovers from Autotools' test harness.
|
|
|
|
|
|
|
|
| |
It seems that it's possible for the profiler start/stop test to have run
during the script test that verifies that the profiler doesn't write a
file, which causes it to fail because they both use the default profiler
file name. Give the start/stop test a different file name and delete it
afterwards.
|