Use G_TEST_OPTION_ISOLATE_DIRS for all unittests

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

grim
gplugin/gplugin
default
pidgin

Use G_TEST_OPTION_ISOLATE_DIRS for all unittests

Ran the unittests.

Summary
Make sure XDG_CONFIG_HOME is set for every unittest
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. 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: Closed (submitted)

Loading...