mirror of
https://github.com/holub/mame
synced 2025-06-07 05:13:46 +03:00
Merge pull request #581 from ajrhacker/validity
Some more validity checking improvements [AJR]
This commit is contained in:
commit
3e6d16125c
@ -1595,7 +1595,8 @@ void cli_frontend::execute_commands(const char *exename)
|
|||||||
if (strcmp(m_options.command(), CLICOMMAND_VALIDATE) == 0)
|
if (strcmp(m_options.command(), CLICOMMAND_VALIDATE) == 0)
|
||||||
{
|
{
|
||||||
validity_checker valid(m_options);
|
validity_checker valid(m_options);
|
||||||
bool result = valid.check_all();
|
const char *sysname = m_options.system_name();
|
||||||
|
bool result = valid.check_all_matching((sysname[0] == 0) ? "*" : sysname);
|
||||||
if (!result)
|
if (!result)
|
||||||
throw emu_fatalerror(MAMERR_FAILED_VALIDITY, "Validity check failed (%d errors, %d warnings in total)\n", valid.errors(), valid.warnings());
|
throw emu_fatalerror(MAMERR_FAILED_VALIDITY, "Validity check failed (%d errors, %d warnings in total)\n", valid.errors(), valid.warnings());
|
||||||
return;
|
return;
|
||||||
|
@ -184,10 +184,11 @@ void validity_checker::check_shared_source(const game_driver &driver)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// check_all - check all drivers
|
// check_all_matching - check all drivers whose
|
||||||
|
// names match the given string
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
bool validity_checker::check_all()
|
bool validity_checker::check_all_matching(const char *string)
|
||||||
{
|
{
|
||||||
// start by checking core stuff
|
// start by checking core stuff
|
||||||
validate_begin();
|
validate_begin();
|
||||||
@ -210,7 +211,8 @@ bool validity_checker::check_all()
|
|||||||
// then iterate over all drivers and check them
|
// then iterate over all drivers and check them
|
||||||
m_drivlist.reset();
|
m_drivlist.reset();
|
||||||
while (m_drivlist.next())
|
while (m_drivlist.next())
|
||||||
validate_one(m_drivlist.driver());
|
if (m_drivlist.matches(string, m_drivlist.driver().name))
|
||||||
|
validate_one(m_drivlist.driver());
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
validate_end();
|
validate_end();
|
||||||
@ -967,17 +969,13 @@ void validity_checker::validate_devices()
|
|||||||
|
|
||||||
device_iterator iter_find(m_current_config->root_device());
|
device_iterator iter_find(m_current_config->root_device());
|
||||||
for (const device_t *device = iter_find.first(); device != nullptr; device = iter_find.next())
|
for (const device_t *device = iter_find.first(); device != nullptr; device = iter_find.next())
|
||||||
{
|
|
||||||
device->findit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// iterate over devices
|
|
||||||
device_iterator iter(m_current_config->root_device());
|
|
||||||
for (const device_t *device = iter.first(); device != nullptr; device = iter.next())
|
|
||||||
{
|
{
|
||||||
// track the current device
|
// track the current device
|
||||||
m_current_device = device;
|
m_current_device = device;
|
||||||
|
|
||||||
|
// validate auto-finders
|
||||||
|
device->findit(true);
|
||||||
|
|
||||||
// validate the device tag
|
// validate the device tag
|
||||||
validate_tag(device->basetag());
|
validate_tag(device->basetag());
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
// operations
|
// operations
|
||||||
void check_driver(const game_driver &driver);
|
void check_driver(const game_driver &driver);
|
||||||
void check_shared_source(const game_driver &driver);
|
void check_shared_source(const game_driver &driver);
|
||||||
bool check_all();
|
bool check_all_matching(const char *string = "*");
|
||||||
|
|
||||||
// helpers for devices
|
// helpers for devices
|
||||||
void validate_tag(const char *tag);
|
void validate_tag(const char *tag);
|
||||||
|
Loading…
Reference in New Issue
Block a user