def test_prefix_dependent_defaults(self):
        '''
        Tests that configured directory paths are set to prefix dependent
        defaults.
        '''
        testdir = os.path.join(self.common_test_dir, '1 trivial')
        expected = {
            '/opt': {'prefix': '/opt',
                     'bindir': 'bin',
                     'datadir': 'share',
                     'includedir': 'include',
                     'infodir': 'share/info',
                     'libexecdir': 'libexec',
                     'localedir': 'share/locale',
                     'localstatedir': 'var',
                     'mandir': 'share/man',
                     'sbindir': 'sbin',
                     'sharedstatedir': 'com',
                     'sysconfdir': 'etc',
                     },
            '/usr': {'prefix': '/usr',
                     'bindir': 'bin',
                     'datadir': 'share',
                     'includedir': 'include',
                     'infodir': 'share/info',
                     'libexecdir': 'libexec',
                     'localedir': 'share/locale',
                     'localstatedir': '/var',
                     'mandir': 'share/man',
                     'sbindir': 'sbin',
                     'sharedstatedir': '/var/lib',
                     'sysconfdir': '/etc',
                     },
            '/usr/local': {'prefix': '/usr/local',
                           'bindir': 'bin',
                           'datadir': 'share',
                           'includedir': 'include',
                           'infodir': 'share/info',
                           'libexecdir': 'libexec',
                           'localedir': 'share/locale',
                           'localstatedir': '/var/local',
                           'mandir': 'share/man',
                           'sbindir': 'sbin',
                           'sharedstatedir': '/var/local/lib',
                           'sysconfdir': 'etc',
                           },
            # N.B. We don't check 'libdir' as it's platform dependent, see
            # default_libdir():
        }

        if default_prefix() == '/usr/local':
            expected[None] = expected['/usr/local']

        for prefix in expected:
            args = []
            if prefix:
                args += ['--prefix', prefix]
            self.init(testdir, extra_args=args, default_args=False)
            opts = self.introspect('--buildoptions')
            for opt in opts:
                name = opt['name']
                value = opt['value']
                if name in expected[prefix]:
                    with self.subTest(prefix=prefix, option=name):
                        self.assertEqual(value, expected[prefix][name], f'For option {name} and prefix {prefix}.')
            self.wipe()

        Tests that configured directory paths are set to prefix dependent
        defaults.
        
unittests/allplatformstests.py