1. 19 Dec, 2018 1 commit
  2. 17 Dec, 2018 3 commits
    • Philip Withnall's avatar
      gtestutils: Add XDG directory isolation · 13730c27
      Philip Withnall authored
      Add a new G_TEST_OPTIONS_ISOLATE_XDG_DIRS option for g_test_init() which
      automatically creates a temporary set of XDG directories, and a
      temporary home directory, and overrides the g_get_user_data_dir() (etc.)
      functions for the duration of the unit test with the temporary values.
      
      This is intended to better isolate unit tests from the user’s actual
      data and home directory. It works with g_test_subprocess(), but does not
      work with subprocesses spawned manually by the test — each unit test’s
      code will need to be amended to correctly set the XDG_* environment
      variables in the environment of any spawned subprocess.
      
      “Why not solve that by setting the XDG environment variables for the
      whole unit test process tree?” I hear you say. Setting environment
      variables is not thread safe and they would need to be re-set for each
      unit test, once worker threads have potentially been spawned.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      
      #538
      13730c27
    • Philip Withnall's avatar
      gtestutils: Forbid test paths from containing dots · 2c8ae9f1
      Philip Withnall authored
      In order to make some guarantees in an upcoming commit that test path
      components won’t clash with file system names used by GLib, add a
      restriction that test path components cannot start with a dot.
      
      This is an API break, but one which anyone is unlikely to have hit. If
      it is an issue, we can relax the restriction to be a warning.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      
      #538
      2c8ae9f1
    • Philip Withnall's avatar
      gtestutils: Move a documentation comment to the symbol it documents · f27532e7
      Philip Withnall authored
      Seems a bit odd to have the documentation comment miles from what it’s
      actually documenting.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      
      #538
      f27532e7
  3. 12 Dec, 2018 2 commits
  4. 23 Nov, 2018 1 commit
  5. 02 Nov, 2018 1 commit
    • Tomasz Miąsko's avatar
      gtestutils: Make test_rand_* thread-safe within a single test case · aed3c008
      Tomasz Miąsko authored
      Synchronize access to random number generator `test_run_rand` with
      a lock to ensure that `g_test_rand_*` family of functions is
      thread-safe.
      
      The reseeding taking place between test case runs is intentionally left
      unsynchronized. It is an error to continue using random number generator
      after test case has already finished running. Lack of synchronization
      here will make such erroneous use readily apparent with thread
      sanitizer.
      aed3c008
  6. 05 Sep, 2018 1 commit
  7. 03 Aug, 2018 3 commits
  8. 31 Jul, 2018 1 commit
  9. 11 Jul, 2018 2 commits
  10. 29 May, 2018 1 commit
    • Emmanuele Bassi's avatar
      Add fuzzy floating point comparison macro · 0b4c2eef
      Emmanuele Bassi authored
      Add a test macro that allows comparing two floating point values for
      equality within a certain tolerance.
      
      This macro has been independently reimplemented by various projects:
      
       * Clutter
       * Graphene
       * colord
      
      #914
      0b4c2eef
  11. 27 Apr, 2018 1 commit
  12. 18 Dec, 2017 1 commit
  13. 13 Dec, 2017 2 commits
  14. 28 Nov, 2017 1 commit
  15. 12 Nov, 2017 1 commit
  16. 07 Nov, 2017 1 commit
  17. 11 Oct, 2017 1 commit
  18. 03 Oct, 2017 2 commits
  19. 03 Aug, 2017 2 commits
    • Daniel Macks's avatar
      gtest: Handle -s as explicit SKIP instead of inhibiting altogether · f591366e
      Daniel Macks authored
      Improves diagnostics and makes test transcripts easier to compare
      
      https://bugzilla.gnome.org/show_bug.cgi?id=769135
      f591366e
    • Philip Withnall's avatar
      Consistently save errno immediately after the operation setting it · 5cddde1f
      Philip Withnall authored
      Prevent the situation where errno is set by function A, then function B
      is called (which is typically _(), but could be anything else) and it
      overwrites errno, then errno is checked by the caller.
      
      errno is a horrific API, and we need to be careful to save its value as
      soon as a function call (which might set it) returns. i.e. Follow the
      pattern:
        int errsv, ret;
        ret = some_call_which_might_set_errno ();
        errsv = errno;
      
        if (ret < 0)
          puts (strerror (errsv));
      
      This patch implements that pattern throughout GLib. There might be a few
      places in the test code which still use errno directly. They should be
      ported as necessary. It doesn’t modify all the call sites like this:
        if (some_call_which_might_set_errno () && errno == ESOMETHING)
      since the refactoring involved is probably more harmful than beneficial
      there. It does, however, refactor other call sites regardless of whether
      they were originally buggy.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=785577
      5cddde1f
  20. 24 May, 2017 1 commit
    • Sébastien Wilmet's avatar
      glib/: LGPLv2+ -> LGPLv2.1+ · f9faac76
      Sébastien Wilmet authored
      All glib/*.{c,h} files have been processed, as well as gtester-report.
      
      12 of those files are not licensed under LGPL:
      
      	gbsearcharray.h
      	gconstructor.h
      	glibintl.h
      	gmirroringtable.h
      	gscripttable.h
      	gtranslit-data.h
      	gunibreak.h
      	gunichartables.h
      	gunicomp.h
      	gunidecomp.h
      	valgrind.h
      	win_iconv.c
      
      Some of them are generated files, some are licensed under a BSD-style
      license and win_iconv.c is in the public domain.
      
      Sub-directories inside glib/:
      
      	deprecated/: processed in a previous commit
      	glib-mirroring-tab/: already LGPLv2.1+
      	gnulib/: not modified, the code is copied from gnulib
      	libcharset/: a copy
      	pcre/: a copy
      	tests/: processed in a previous commit
      
      https://bugzilla.gnome.org/show_bug.cgi?id=776504
      f9faac76
  21. 05 Mar, 2017 1 commit
  22. 22 Nov, 2016 1 commit
  23. 09 Nov, 2016 1 commit
  24. 24 Oct, 2016 1 commit
  25. 12 Oct, 2016 1 commit
  26. 22 Jul, 2016 1 commit
  27. 17 Jul, 2016 1 commit
  28. 04 Jun, 2016 1 commit
  29. 27 Apr, 2016 1 commit
  30. 07 Nov, 2015 2 commits