From a6917fc1296c48c8cdc5a179e39ad12355f0b086 Mon Sep 17 00:00:00 2001 From: 2Shirt <1923621+2Shirt@users.noreply.github.com> Date: Tue, 26 Dec 2017 15:57:36 -0700 Subject: [PATCH] run_mprime() finished * Results now determined from log files --- .bin/Scripts/functions/hw_diags.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 6cb50bc2..9ca2e526 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -168,6 +168,20 @@ def run_mprime(): item.path, global_vars['LogDir'])) + # Check logs + TESTS['Prime95']['NS'] = False + TESTS['Prime95']['CS'] = False + log = '{}/results.txt'.format(global_vars['LogDir']) + if os.path.exists(log): + with open(log, 'r') as f: + r = re.search(r'(error|fail)', f.read()) + TESTS['Prime95']['NS'] = bool(r) + log = '{}/prime.log'.format(global_vars['LogDir']) + if os.path.exists(log): + with open(log, 'r') as f: + r = re.search(r'completed.*0 errors, 0 warnings', f.read()) + TESTS['Prime95']['CS'] = bool(r) + # Update status if aborted: TESTS['Prime95']['Status'] = 'Aborted' @@ -175,7 +189,12 @@ def run_mprime(): update_progress() pause('Press Enter to return to menu... ') else: - TESTS['Prime95']['Status'] = 'CS' + if TESTS['Prime95']['NS']: + TESTS['Prime95']['Status'] = 'NS' + elif TESTS['Prime95']['CS']: + TESTS['Prime95']['Status'] = 'CS' + else: + TESTS['Prime95']['Status'] = 'Unknown' update_progress() # Done