1. 13 Aug, 2018 1 commit
    • Simon McVittie's avatar
      build: Clean up all installed-tests metadata · a5d4ad5b
      Simon McVittie authored
      Otherwise running
      make distcheck DISTCHECK_CONFIGURE_FLAGS=--enable-installed-tests
      fails because installed-tests/debugger/*.test are still in present
      in the $(builddir) after distclean.
      
      These files are created by 'make', so they should be deleted by
      'make clean', not by 'make distclean'.
      Signed-off-by: 's avatarSimon McVittie <smcv@debian.org>
      a5d4ad5b
  2. 30 Mar, 2018 1 commit
    • Philip Chimento's avatar
      build: Specify code coverage flags correctly · eb041ee9
      Philip Chimento authored
      This uses CODE_COVERAGE_LIBS instead of CODE_COVERAGE_LDFLAGS; the two
      are equivalent but CODE_COVERAGE_LDFLAGS is from an older version of the
      code coverage macro and discouraged.
      
      Also uses CODE_COVERAGE_CXXFLAGS for C++ compilation.
      
      In some cases the flags weren't being passed to all compilations because
      AM_*FLAGS is not used by default if there are per-target flags.
      eb041ee9
  3. 23 Mar, 2018 1 commit
  4. 21 Feb, 2018 1 commit
  5. 01 Feb, 2018 1 commit
    • Philip Chimento's avatar
      build: Install suppressions files · 776651b5
      Philip Chimento authored
      This installs the suppressions files for Valgrind and LSan, in
      /usr/share/gjs-1.0/valgrind/gjs.supp and
      /usr/share/gjs-1.0/lsan/lsan.supp.
      
      Closes #2.
      776651b5
  6. 24 Jan, 2018 2 commits
    • Philip Chimento's avatar
      profiler: Allow configuring with --disable-profiler · 9424ffa2
      Philip Chimento authored
      We check for the existence of timer_settime() with some M4 macros from
      gnulib. These POSIX APIs are required for building the profiler.
      
      Allow disabling the profiler with a configure switch. This keeps the API
      (and its preconditions as much as possible) but makes it a no-op and
      prints an informational message at runtime on attempted use. We also
      leave out the sysprof writer code and skip the profiler tests if the
      profiler is not being built.
      9424ffa2
    • Philip Chimento's avatar
      profiler: Suppress cppcheck warning · 12b5a8f9
      Philip Chimento authored
      The cppcheck program will warn about alloca() even though there's no
      equivalent alternative in C++. I don't think there's necessarily a better
      way to do this, so we suppress the warning and add a justification.
      12b5a8f9
  7. 25 Aug, 2017 1 commit
    • Claudio André's avatar
      maint: add ASAN Address Sanitizer · 98830739
      Claudio André authored
      AddressSanitizer (or ASan) is a programming tool that detects memory
      corruption bugs such as buffer overflows or use after free. AddressSanitizer
      is based on compiler instrumentation.
      
      UndefinedBehaviorSanitizer (or UBSan) is a fast undefined behavior
      detector. It modifies the program at compile-time to catch errors
      such as using misaligned or null pointer and signed integer overflow.
      
      The llvm.org states that Sanitizers have found thousands of bugs everywhere.
      Sanitizers running during CI can prevent bugs from taking up residence. They
      are helper tools to maintain bugs out.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=783220
      98830739
  8. 07 Aug, 2017 1 commit
    • Philip Chimento's avatar
      build: Fix distcheck · 2ef67864
      Philip Chimento authored
      A deleted docs file was still left in the Makefile. At the same time, add
      Hacking.md to the makefile so that it is distributed.
      
      Unreviewed.
      2ef67864
  9. 06 Jul, 2017 1 commit
  10. 06 Feb, 2017 4 commits
  11. 28 Jan, 2017 1 commit
  12. 25 Jan, 2017 1 commit
  13. 28 Dec, 2016 1 commit
    • Philip Chimento's avatar
      tests: Use embedded copy of Jasmine to run tests · 3d6e9fab
      Philip Chimento authored
      This replaces the old JSUnit test harness with an embedded copy of
      Jasmine [1], which makes writing tests less of a pain, includes more
      handy test facilities, and produces better output.
      
      jasmine.js is a copy of upstream Jasmine 2.5.2. minijasmine.js contains
      code for starting up Jasmine, adapting it to the GJS environment, and
      producing TAP output. minijasmine.cpp makes an executable which loads the
      preceding two files from the unit test GResource.
      
      All the tests in installed-tests/js are converted to use Jasmine's
      describe()/it() style. Quite often this allows simplifying them since
      Jasmine has features like array and object equality, spies, and clock
      ticks.
      
      [1] https://jasmine.github.io/2.5/introduction.html
      
      https://bugzilla.gnome.org/show_bug.cgi?id=775444
      3d6e9fab
  14. 21 Dec, 2016 1 commit
  15. 10 Dec, 2016 2 commits
    • Philip Chimento's avatar
      js: Workaround for function with custom prototype · 72c0298c
      Philip Chimento authored
      It's not possible in JS to directly create a function object with a
      custom prototype. We previously got around this by directly altering the
      prototype by setting the __proto__ property, but SpiderMonkey now
      conspicuously warns that this will make your code slow.
      
      It would be possible to do this with ES6 Proxy objects, although
      SpiderMonkey 31 doesn't support the particular getPrototypeOf() proxy
      trap that we would need in order to implement this correctly --- at
      least not in JS. Therefore we implement the proxy in C++.
      
      We add a debug topic for proxies and a memory counter.
      
      All in all, the proxy is probably still slower than a function object
      with a real prototype would be, but hopefully faster than direct
      alteration of the prototype. At the very least we can avoid printing a
      big warning every time our class framework is used.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=751252
      72c0298c
    • Philip Chimento's avatar
      js: Call JS_Init() and JS_ShutDown() · 6b25ce3b
      Philip Chimento authored
      Starting with mozjs31, JS_Init() is required. Calling JS_ShutDown() on
      exit is not required, but may become so in the future.
      
      This does so in the constructor and destructor of a static object.
      Normally this is discouraged because the order in which the constructors
      and destructors are called is not guaranteed, but I don't think that is a
      problem here since it's unlikely that anyone will try to use GJS API from
      a static constructor.
      
      However, API clients still must unref any GjsContext before the program
      shuts down. Usually this is not a problem, unless a JS script calls
      System.exit(), in which case the code would exit immediately without
      unreffing the GjsContext before JS_ShutDown was called. Instead, we make
      System.exit() throw an uncatchable exception, which is propagated all the
      way up to JS::Evaluate() and turned into a GError with code
      GJS_ERROR_SYSTEM_EXIT, thrown from gjs_context_eval().
      
      For this, we need to expose GjsError and its error codes in the public
      API. (They should have been exposed already, because gjs_context_eval()
      could already throw GJS_ERROR_FAILED.)
      
      Finally, the tests added as part of this patch made the testSystemExit
      script obsolete.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=751252
      6b25ce3b
  16. 30 Nov, 2016 3 commits
    • Philip Chimento's avatar
    • Philip Chimento's avatar
      build: Reorganize testing makefiles · 838a7f34
      Philip Chimento authored
      These were a bit hard to navigate before, it was difficult to determine
      where to look if you wanted to write a test for new functionality. Now
      everything devoted to making "make check" work is in Makefile-test.am.
      The file is delineated into sections and comments are added.
      
      All the rules for converting some of the tests into installed tests, and
      installing them in the right place, are in Makefile-insttest.am now.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=775205
      838a7f34
    • Philip Chimento's avatar
      build: Use Automake test driver with TAP output · 8feb2e49
      Philip Chimento authored
      For better integration with the build system and nicer output, use
      Automake's TAP driver and gtester's TAP output mode.
      
      There are a few things going on in this commit:
      
      - We don't put logs in test_user_data/logs anymore. That really assumed
        in the first place that all tests would be run serially, and we want
        them to be run in parallel. So we'll let Automake take care of the
        stderr and debug outputs and redirect them to a per-test log file.
      
      - We use the significant-to-Automake variable TESTS instead of
        TEST_PROGS. TESTS contains whatever is in check_PROGRAMS plus whatever
        else we put into it (our test script.)
      
      - TESTS_ENVIRONMENT is also significant to Automake, but should not be
        set within Automake, instead the AM_TESTS_ENVIRONMENT variable should
        be used so that the developer can override TESTS_ENVIRONMENT from the
        command line. This variable consists of a sequence of commands and
        needs to end with a semicolon. (So we can stuff XVFB_START in there
        too.)
      
      - We need to put the test invocation in a separate script since gtester
        doesn't pass the --tap option on to its test binary.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=775205
      8feb2e49
  17. 22 Oct, 2016 2 commits
  18. 20 Oct, 2016 3 commits
  19. 18 Oct, 2016 3 commits
  20. 01 Oct, 2016 1 commit
  21. 30 Sep, 2016 8 commits