summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2015-07-11 14:36:41 +0200
committer Dirk Best <mail@dirk-best.de>2015-07-11 14:39:36 +0200
commit4e50f95e62fc0fbf6b848564159c9eba477870d9 (patch)
tree8dc6c26422349426d987196208d60004be93d97a
parent0e8d3e4bb35a10e8ea8d44698bd941b7f79e286a (diff)
Actually return an error when the validity check fails
-rw-r--r--src/emu/clifront.c4
-rw-r--r--src/emu/validity.c4
-rw-r--r--src/emu/validity.h2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/emu/clifront.c b/src/emu/clifront.c
index f031a84ec0f..90f63bde35e 100644
--- a/src/emu/clifront.c
+++ b/src/emu/clifront.c
@@ -1550,7 +1550,9 @@ void cli_frontend::execute_commands(const char *exename)
if (strcmp(m_options.command(), CLICOMMAND_VALIDATE) == 0)
{
validity_checker valid(m_options);
- valid.check_all();
+ bool result = valid.check_all();
+ if (!result)
+ throw emu_fatalerror(MAMERR_FAILED_VALIDITY, "Validity check failed!\n");
return;
}
diff --git a/src/emu/validity.c b/src/emu/validity.c
index fe4c14cfa8c..dc6ee7cf9c6 100644
--- a/src/emu/validity.c
+++ b/src/emu/validity.c
@@ -186,7 +186,7 @@ void validity_checker::check_shared_source(const game_driver &driver)
// check_all - check all drivers
//-------------------------------------------------
-void validity_checker::check_all()
+bool validity_checker::check_all()
{
// start by checking core stuff
validate_begin();
@@ -218,6 +218,8 @@ void validity_checker::check_all()
// cleanup
validate_end();
+
+ return !(m_errors > 0 || m_warnings > 0);
}
diff --git a/src/emu/validity.h b/src/emu/validity.h
index 64984433ecf..acc271a7cae 100644
--- a/src/emu/validity.h
+++ b/src/emu/validity.h
@@ -43,7 +43,7 @@ public:
// operations
void check_driver(const game_driver &driver);
void check_shared_source(const game_driver &driver);
- void check_all();
+ bool check_all();
// helpers for devices
void validate_tag(const char *tag);