summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* CI: Fix case where upstream base branch already existsPhilip Chimento2023-04-041-1/+1
|
* cleanup: Replace static_cast<GjsContext*> with runtime castPhilip Chimento2023-03-041-4/+2
| | | | | The runtime cast is defined anyway by the GObject macros, and allows turning runtime checking on or off at build time as desired.
* maint: Update includes to match new version of IWYUPhilip Chimento2022-11-152-0/+2
|
* Merge branch '514-random-char' into 'master'Philip Chimento2022-11-141-0/+18
|\ | | | | | | | | | | | | Avoid using char type in uniform_int_distribution<T> template Closes #514 See merge request GNOME/gjs!807
| * tests: Avoid using char type in uniform_int_distribution<T> templatePhilip Chimento2022-11-061-0/+18
| | | | | | | | | | | | | | This is undefined behaviour. GCC and pre-15.x Clang accept it, so we didn't notice it before. Closes: #514
* | CI: Bump images to Fedora 37Philip Chimento2022-11-092-6/+6
| | | | | | | | | | | | These will contain g-i 1.73.0 which contains a memory leak fix that we will need to run the new tests on this branch successfully with sanitizers enabled.
* | CI: Stop building mozjs91 imagesPhilip Chimento2022-11-082-4/+4
|/ | | | Changes the Dockerfiles to build mozjs102 by default, as well.
* Revert "CI: Temporarily disable --werror"Philip Chimento2022-10-291-1/+1
| | | | | This reverts commit 825d85a1057d2330c2811116315669606b8e4ac3. It's no longer needed after fixing the setjmp warnings.
* CI: Fix comments in shell scriptPhilip Chimento2022-08-071-3/+2
| | | | | This comment didn't make sense where it was placed, put it next to the code that it refers to.
* js: Update IWYU comments for jsapi.hPhilip Chimento2022-08-071-1/+1
| | | | | Since more functions will move out of jsapi.h in the future, it'll be useful to know why exactly we are including it.
* js: Remove Gjs::maybe_get_private()Philip Chimento2022-08-071-2/+1
| | | | | | This function was necessary in SpiderMonkey 91, but now the same functionality is part of the SpiderMonkey API. There is no longer any need to define our own.
* js: Replace JSFreeOp with JS::GCContextEvan Welsh2022-08-071-1/+1
| | | | In particular, in finalize operations.
* js: Add JSTracer* argument to JS_UpdateWeakPointerAfterGC()Evan Welsh2022-08-071-2/+4
| | | | | This has some cascade effects on the signatures of other methods, since we now need to pass the JSTracer in.
* js: Various functions moved out of jsapi.hPhilip Chimento2022-08-072-1/+2
| | | | | | | | | | | - js/CallAndConstruct.h: Now contains JS::Call, JS::Construct, and related - js/Debug.h: Already existed, but now contains JS_DefineDebuggerObject - js/GlobalObject.h: Now contains JS::CurrentGlobalOrNull - js/PropertyAndElement.h: Now contains APIs for getting, setting, and defining properties, as well as array elements - js/ScriptPrivate.h: Now contains JS::GetScriptPrivate/SetScriptPrivate - js/Stack.h: Now contains APIs that have to do with the call stack
* js: Replace class private pointers with reserved slotsPhilip Chimento2022-08-061-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | JS::GetPrivate() and JS::SetPrivate() are going away in SpiderMonkey 102. The replacement is to stuff the pointer into a JS::PrivateValue and store it in an object's reserved slot. This is a change we can make prior to the switch. With SpiderMonkey 102, we are intended to use JS::GetMaybePtrFromReservedSlot() to retrieve the pointer. This function doesn't exist in SpiderMonkey 91, but it is a small inline function that we can open-code in jsapi-util.h. In most of the cases, we can encapsulate this access into three methods of CWrapperPointerOps: has_private(), init_private(), and unset_private(). (Retrieving the pointer was already encapsulated by the various for_js() methods.) This provides better safety anyway, because in init_private() we can enforce that there was no pointer already set. We define that reserved slot 0 is always the private pointer. BoxedInstance already used slot 0 for something else, so that moves to slot 1. Based on Evan's commit from the mozjs102 branch. Co-authored-by: Evan Welsh <contact@evanwelsh.com>
* maint: Bring headers in line with IWYU 0.18Philip Chimento2022-07-252-3/+1
| | | | | | As with every release, IWYU's algorithms have slightly changed, and some bugs have been fixed meaning we can remove some workarounds from the postprocessing script; unfortunately other bugs have appeared as well.
* CI: Temporarily disable --werrorPhilip Chimento2022-07-241-1/+1
| | | | | | | | | There are some warnings showing up with the new version of the compiler in the newly-built image that don't have obvious fixes. Normally we stop the build if there are warnings, but we will temporarily disable that and allow it to proceed until these new warnings can be fixed. (One of them seems to come from SpiderMonkey and would be fixed in the SpiderMonkey upgrade, it seems.)
* CI: Fix bug in common ancestor scriptPhilip Chimento2022-07-241-1/+1
| | | | | We need to bail out if the upstream base _commit_ is already found, not the upstream base _branch_.
* CI: Add glibc-gconv-extra to CI imagePhilip Chimento2022-07-242-0/+2
| | | | | | This package is needed in order to support all the encodings that the WHATWG Encoding standard requires. It looks like it was split out from another package in Fedora 36, so it needs to be added explicitly.
* maint: Avoid bogus cppcheck warning with if constexprPhilip Chimento2022-07-241-0/+3
| | | | | | This is tracked upstream in: https://trac.cppcheck.net/ticket/10731 For the time being, work around it.
* CI: Rebuild CI image on Fedora 36Philip Chimento2022-07-242-12/+35
| | | | | | | | | | mozjs91 cannot be built with Python 3.10 due to a bug, so we have to install Python 3.9 separately and use it. glibc-debuginfo-common no longer exists in Fedora 36. Requires a bump of the freedesktop CI template as well, due to broken seccomp on the older buildah image.
* test-ci: Avoid creating a ci-upstream-base-branch if it's there alreadyMarco Trevisan (Treviño)2022-06-081-0/+5
| | | | | It could have been built by another pipeline apparently as we may get an error that the branch already exists.
* test-ci: Ignore safe directory errors on CIMarco Trevisan (Treviño)2022-06-081-0/+3
|
* Dockerfile: Install Turkish locale in CI for UTF-8 locale tooMarco Trevisan (Treviño)2022-04-292-2/+10
| | | | | This is the actual recipe that has been used to generate the current image, but I forgot to update the branch that got merged earlier.
* Dockerfile: Install Turkish locale in CIMarco Trevisan (Treviño)2022-04-282-0/+8
|
* Dockerfile: Keep deps multi-line, to make it easier to maintainMarco Trevisan (Treviño)2022-04-282-18/+85
|
* Merge branch 'verbose-object-print-output' into 'master'Philip Chimento2022-03-061-46/+0
|\ | | | | | | | | | | | | Verbose object print output Closes #107 See merge request GNOME/gjs!587
| * print: Connect up prettyPrint() to Console.interact() and log()Philip Chimento2022-02-251-46/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It makes sense for the prettyPrint() function to be written in JS, but it does need to be called internally in Console.interact() which is written in C++. Therefore, create a slot on the global object in which to store the prettyPrint() function, which can be retrieved when needing to call the function from internal code. Console.interact() no longer needs to use gjs_value_debug_string(), so that code and its dependencies can be removed. Also pass the arguments of log() and logError() through prettyPrint(). This enables the work from #107.
* | CI: Don't run cpplint on C filesPhilip Chimento2022-03-031-2/+2
|/ | | | | Per https://github.com/cpplint/cpplint/issues/190 cpplint is not intended for that.
* jsapi-util: Append cause when calling gjs_throw with exception pendingPhilip Chimento2022-02-121-0/+31
| | | | | | | | | | | | | | | Previously, when calling gjs_throw() with an exception already pending, the new exception would be dropped, after logging it in the debug output in case it contained extra information. Now that we have Error.cause, we can append the new exception to the cause chain of the currently pending exception. This potentially gives more relevant information immediately to the programmer without having to dig in the debug log. In the case where the end of the cause chain is not an object, or there is a reference cycle in the cause chain, we fall back to the same debug logging that we did before.
* value: Support converting BigInt to (u)int64 valuesMarco Trevisan (Treviño)2022-02-031-2/+5
| | | | | | | | | | | | | | | | | | | | | BigInt values are now accepted as parameters to C functions that take 64-bit integers. For now BigInts are only accepted for 64-bit parameters. We may allow BigInt for any parameter in the future (once we've checked that we don't go out-of-range), for now we assume that BigInt values are used only for functions taking a type that can mostly handle them. For bounds checks, given that we don't have a bigger value holder than (u)int64_t, we have to create a new wrapper to avoid taking the fast path in gjs_arg_set_from_js_value(), and without having to hack type_has_js_getter(). As per this, now for 64bit integers we use TypeWrapper as the type holder that has conversion operators to the base type, and for which we can then add a js_value_to_c_checked() specialization. See: #271
* jsapi-util: Improve BigInt debug functionsPhilip Chimento2022-02-031-9/+18
| | | | | | | | | | | | Using JS::ToBigInt64 to debug BigInt means that we can only access the first 64-bit digit of the BigInt. (We can convert the whole thing to a string, but that might allocate and fail, which we don't want in a debug function.) Note this in debug messages, because I got myself confused a few times while working on this branch. Also use the new JS::BigIntIsNegative() API in mozjs91 to improve the output, casting the first digit into a signed int if the BigInt was negative, and an unsigned int if it was positive.
* maint: Suppress cppcheck warning about accessing a variable after movingPhilip Chimento2022-01-311-2/+7
| | | | | | This is done intentionally in this test to ensure that we don't crash, but the warning itself makes sense because you are generally not supposed to do this.
* context: check for null out-paramNasah Kuma2022-01-253-0/+153
| | | | | Fixes a few cases where a null out parameter is written to, which would cause a crash. Adds tests for these cases.
* test: Remove workaround for SpiderMonkey GC code coveragePhilip Chimento2022-01-161-78/+0
| | | | | | | There used to be a bug in SpiderMonkey where a GC would sometimes erase realm code coverage data. This bug no longer exists, so remove the workarounds that would skip tests when run under code coverage. (The bug was https://bugzilla.mozilla.org/show_bug.cgi?id=1447906)
* CI: Build only mozjs91 imagesPhilip Chimento2022-01-162-4/+4
| | | | | No longer necessary to build mozjs78 images. MOZJS_BUILDDEPS must still be set to mozjs78 until the underlying OS gains a mozjs91 package.
* Some Object-related functions have moved to js/Object.hEvan Welsh2022-01-161-3/+4
| | | | | | | | - JS_[Get,Set]Private is now JS::[Get,Set]Private - JS_GetReservedSlot is now JS::GetReservedSlot - JS_SetReservedSlot still exists, but we'll update it now See https://bugzilla.mozilla.org/show_bug.cgi?id=1663365
* js: Update includes for headers split out of JSAPIEvan Welsh2022-01-164-2/+5
| | | | | | | | | | | | | | | | | | | | | | Added - js/experimental/TypedData.h - js/friend/DumpFunctions.h - js/Context.h - js/MapAndSet.h - js/String.h Updated - js/ErrorReport.h - js/Exception.h - js/GCAPI.h - js/Realm.h Removed - js/RequiredDefines.h See https://bugzilla.mozilla.org/show_bug.cgi?id=1708330 See https://bugzilla.mozilla.org/show_bug.cgi?id=1656411 See https://bugzilla.mozilla.org/show_bug.cgi?id=1663365
* Add CI images for mozjs91.Evan Welsh2021-10-082-6/+7
|
* jsapi-util: Cast pointer to the correct type when calling ref/free-funcPhilip Chimento2021-09-301-0/+15
| | | | | | | | | In GjsAutoPointer, T* is the type of the pointer, but F* is the type of the pointer that ref_func/free_func accept. We need to cast to F* when calling these functions. Previously this mostly worked because F = void, but it would not compile if F != void and F != T.
* CI: Remove TASK_ID variablePhilip Chimento2021-09-301-1/+1
| | | | | There is already a predefined GitLab CI environment variable for the job name, $CI_JOB_NAME, so we don't need to define one.
* CI: Move thread sanitizer job to manual sectionPhilip Chimento2021-09-261-1/+1
| | | | | | | | Also remove the 'thread-safe' test suite, since the job is now marked as allowed-to-fail, we may as well run TSAN on the tests where we know that GLib or GIO cause false positives. See #440 for steps to restore the job.
* CI: Build images using Fedora 34 as the basePhilip Chimento2021-09-252-6/+6
| | | | This is an upgrade to continue building against more recent versions.
* context: Cleanup completed trampoline in context, as this is what they belong toMarco Trevisan (Treviño)2021-08-011-0/+1
| | | | | | We're currently keeping a list of trampolines in a static vector, this is acceptable (at least for a single-context scenario), but trampolines are bound to a specific context so better to move the handling in the context.
* GjsMaybeOwned: Remove notifier support and move it into GjsPrivateContextMarco Trevisan (Treviño)2021-08-011-4/+7
| | | | | | | | | | | | | | GjsMaybeOwned had a notification support that was used only by Closures (other than tests), this was causing adding an extra pointer to all the types using it (including Object) that was mostly unused. So, move this into private context, re-implementing it using our own notifier (instead of relying on GObject's that needs a specific order) and use it in closures. Also add an hook to handle gc events on private context that will be in later changes to cleanup more things, but for now is used to shrink the closures vector once we've done.
* jsapi-util-args: Add 'S' conversion specifierPhilip Chimento2021-07-021-21/+35
| | | | | | | | The 'S' specifier also expects a string argument, or additionally null if it is given as '?S'. Unlike 's' and 'F', it does not convert the string value at all, and instead puts it into a JS::MutableHandleString. This will be used in the Encoding specification.
* jsapi-util-args: Fix assert_match() in testsPhilip Chimento2021-07-021-9/+10
| | | | | | | | | | Apparently I never checked what happened when this assertion failed. Since it is only used directly in run_code_expect_exception(), the string and pattern are generated dynamically, so the error message would be something like '("message" matches "pattern")', totally unhelpful. Use g_assertion_message_cmpstr() with a made-up comparison operator, to give a more helpful message.
* CI: Add autoconf213 to dependencies in DockerfilePhilip Chimento2021-06-082-3/+3
| | | | | | | | | Fedora removed this from their build dependencies of mozjs78, but they had to add a big patch which we don't want to carry in ptomato/mozjs. So add autoconf213 to the list of dependencies to install manually. See commit: https://src.fedoraproject.org/rpms/mozjs78/c/0be21c3fd170b1e5e5920c4a59d6c7d6c6b9c7f7?branch=f33
* jsapi-util-string: Handle BigInt in gjs_debug_value()Philip Chimento2021-06-081-0/+36
| | | | | We print out the value % INT64_MAX in this debug function because printing out the full value requires a JSContext and may be fallible.
* object: Make ensure_toggle_reference to follow the JS API so we can throwMarco Trevisan (Treviño)2021-05-181-1/+2
|