def test_builtin_options_documented(self):
        '''
        Test that universal options and base options are documented in
        Builtin-Options.md.
        '''
        from itertools import tee
        md = None
        with open('docs/markdown/Builtin-options.md', encoding='utf-8') as f:
            md = f.read()
        self.assertIsNotNone(md)

        found_entries = set()
        sections = re.finditer(r"^## (.+)$", md, re.MULTILINE)
        # Extract the content for this section
        u_subcontents = []
        content = self._get_section_content("Universal options", sections, md)
        subsections = tee(re.finditer(r"^### (.+)$", content, re.MULTILINE))
        u_subcontents.append(self._get_section_content("Directories", subsections[0], content))
        u_subcontents.append(self._get_section_content("Core options", subsections[1], content))

        mod_subcontents = []
        content = self._get_section_content("Module options", sections, md)
        subsections = tee(re.finditer(r"^### (.+)$", content, re.MULTILINE))
        for idx, mod in enumerate(['Pkgconfig', 'Python']):
            mod_subcontents.append(self._get_section_content(f'{mod} module', subsections[idx], content))
        for subcontent in u_subcontents + mod_subcontents:
            # Find the option names
            options = set()
            # Match either a table row or a table heading separator: | ------ |
            rows = re.finditer(r"^\|(?: (\w+) .* | *-+ *)\|", subcontent, re.MULTILINE)
            # Skip the header of the first table
            next(rows)
            # Skip the heading separator of the first table
            next(rows)
            for m in rows:
                value = m.group(1)
                # End when the `buildtype` table starts
                if value is None:
                    break
                options.add(value)
            self.assertEqual(len(found_entries & options), 0)
            found_entries |= options

        # TODO: put the module name back in the OptionKey
        def remove_module_name(key: OptionKey) -> OptionKey:
            if '.' in key.name:
                return key.evolve(name=key.name.split('.', 1)[1])
            return key

        self.assertEqual(found_entries, {
            *(str(remove_module_name(k)) for k in mesonbuild.options.BUILTIN_OPTIONS),
            *(str(remove_module_name(k)) for k in mesonbuild.options.BUILTIN_OPTIONS_PER_MACHINE),
        })

        # Check that `buildtype` table inside `Core options` matches how
        # setting of builtin options behaves
        #
        # Find all tables inside this subsection
        tables = re.finditer(r"^\| (\w+) .* \|\n\| *[-|\s]+ *\|$", u_subcontents[1], re.MULTILINE)
        # Get the table we want using the header of the first column
        table = self._get_section_content('buildtype', tables, u_subcontents[1])
        # Get table row data
        rows = re.finditer(r"^\|(?: (\w+)\s+\| (\w+)\s+\| (\w+) .* | *-+ *)\|", table, re.MULTILINE)
        env = get_fake_env()
        for m in rows:
            buildtype, debug, opt = m.groups()
            if debug == 'true':
                debug = True
            elif debug == 'false':
                debug = False
            else:
                raise RuntimeError(f'Invalid debug value {debug!r} in row:\n{m.group()}')
            env.coredata.set_option(OptionKey('buildtype'), buildtype)
            self.assertEqual(env.coredata.optstore.get_value('buildtype'), buildtype)
            self.assertEqual(env.coredata.optstore.get_value('optimization'), opt)
            self.assertEqual(env.coredata.optstore.get_value('debug'), debug)

        Test that universal options and base options are documented in
        Builtin-Options.md.
        
unittests/datatests.py