Use G_TEST_OPTION_ISOLATE_DIRS for all unittests

Review Request #1588 — Created Aug. 13, 2022 and submitted

Information

gplugin/gplugin
default

Reviewers

Use G_TEST_OPTION_ISOLATE_DIRS for all unittests

Ran the unittests.

Summary ID
Make sure XDG_CONFIG_HOME is set for every unittest
1de38003672103b6415cb19ad2d0021a02130a4b
Description From Last Updated

So I'm a bit late at realizing this, but I went to look at GLib Test's documentation and found G_TEST_OPTION_ISOLATE_DIRS, …

QuLogicQuLogic
QuLogic
  1. 
      
  2. Show all issues

    So I'm a bit late at realizing this, but I went to look at GLib Test's documentation and found G_TEST_OPTION_ISOLATE_DIRS, which can be passed to g_test_init.

    Should we be using that instead? Note, it only takes effect in g_test_run.

    1. Oh dang, this looked like it was going to be perfect until...

      Note that this doesn’t take effect until g_test_run() is called, so calls to (for example) g_get_user_home_dir() will return the system-wide value when made in a test program’s main() function.
      

      Since we can't re-init libpurple (I don't think we can anyways), we genernal initialize the test-ui before calling g_test_run() which means for now we're stuck with the envvars.

    2. But this is gplugin... (though I guess it might be the same problem)

    3. oh right, well for gplugin, talkatu, and maybe libgnt we should be fine to use this option. I'll update this quick for that.

  3. 
      
grim
QuLogic
  1. Ship It!
  2. 
      
grim
Review request changed
Status:
Completed