diff options
author | Marty Gloff <mgloff@us.ibm.com> | 2017-02-07 11:09:44 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-02-11 21:37:17 -0500 |
commit | 9fb6c6be5a35e14bb06f285282db6f2ed4220f7d (patch) | |
tree | d67c9b53b94d2ec0954b4034e02ee1341606e771 /src/usr | |
parent | ea1efc2a4755f9c0882933cc0dd4a3f19220b062 (diff) | |
download | talos-hostboot-9fb6c6be5a35e14bb06f285282db6f2ed4220f7d.tar.gz talos-hostboot-9fb6c6be5a35e14bb06f285282db6f2ed4220f7d.zip |
Output list of cxxtest failures
Include a list of the first 10 cxxtest failures with the summary
of the cxxtest results.
Change-Id: I932b63d29b26f6d5afff7c3f5a67679e2a66fd5f
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36168
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr')
-rwxr-xr-x | src/usr/cxxtest/TestSuite.C | 20 | ||||
-rw-r--r-- | src/usr/cxxtest/cxxtestexec.C | 51 |
2 files changed, 63 insertions, 8 deletions
diff --git a/src/usr/cxxtest/TestSuite.C b/src/usr/cxxtest/TestSuite.C index 3e7e92634..92feb4886 100755 --- a/src/usr/cxxtest/TestSuite.C +++ b/src/usr/cxxtest/TestSuite.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2017 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -29,6 +31,7 @@ #include <limits.h> #include <stdarg.h> #include <arch/ppc.H> +#include <string.h> #include <cxxtest/TestSuite.H> @@ -89,6 +92,14 @@ void doWarn( ) void doFailTest( ) { + TRACDCOMP( g_trac_test, + "!!! > Test Failed " ); + if(g_FailedTests < CXXTEST_FAIL_LIST_SIZE) + { + memcpy(g_FailedTestList[g_FailedTests].failTestFile, + "---", + 3); + } __sync_add_and_fetch( &g_FailedTests, 1 ); } @@ -108,6 +119,13 @@ void doFailTest( const char *filename, uint32_t linenum ) "!!! > Test %s Failed at line %d ", filename, linenum ); + if(g_FailedTests < CXXTEST_FAIL_LIST_SIZE) + { + memcpy(g_FailedTestList[g_FailedTests].failTestFile, + filename, + CXXTEST_FILENAME_SIZE); + g_FailedTestList[g_FailedTests].failTestData = linenum; + } __sync_add_and_fetch( &g_FailedTests, 1 ); } diff --git a/src/usr/cxxtest/cxxtestexec.C b/src/usr/cxxtest/cxxtestexec.C index 3bced8299..145537f66 100644 --- a/src/usr/cxxtest/cxxtestexec.C +++ b/src/usr/cxxtest/cxxtestexec.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2017 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -24,6 +26,7 @@ #include <vfs/vfs.H> #include <sys/task.h> #include <string.h> +#include <stdio.h> #include <kernel/console.H> #include <sys/time.h> #include <sys/sync.h> @@ -65,11 +68,24 @@ TASK_ENTRY_MACRO( cxxinit ); void cxxinit( errlHndl_t &io_taskRetErrl ) { + struct cxxtask_t + { + tid_t tid; + const char * module; + } cxxtask; errlHndl_t l_errl = NULL; std::vector<const char *> module_list; - std::vector<tid_t> tasks; + std::vector<cxxtask_t> tasks; tid_t tidrc = 0; + for (uint64_t i = 0; i < CxxTest::CXXTEST_FAIL_LIST_SIZE; i++) + { + memset(CxxTest::g_FailedTestList[i].failTestFile, + 0x00, + CxxTest::CXXTEST_FILENAME_SIZE); + CxxTest::g_FailedTestList[i].failTestData = 0; + }; + // output a blank line so that it's easier to find the beginning of // CxxTest TRACDCOMP( g_trac_cxxtest, " "); @@ -120,28 +136,40 @@ void cxxinit( errlHndl_t &io_taskRetErrl ) tidrc = task_exec( *i, NULL ); TRACFCOMP( g_trac_cxxtest, "Launched task: %s tidrc=%d", *i, tidrc ); - tasks.push_back(tidrc); + cxxtask.tid = tidrc; + cxxtask.module = *i; + tasks.push_back(cxxtask); } TRACFCOMP( g_trac_cxxtest, "Waiting for all (%d) tasks to finish....", CxxTest::g_ModulesStarted ); // wait for all the launched tasks to finish - for (std::vector<tid_t>::iterator t = tasks.begin(); + for (std::vector<cxxtask_t>::iterator t = tasks.begin(); t != tasks.end(); ++t) { int status = 0; - task_wait_tid(*t, &status, NULL); + task_wait_tid(t->tid, &status, NULL); if (status != TASK_STATUS_EXITED_CLEAN) { - TRACFCOMP( g_trac_cxxtest, "Task %d crashed.", *t ); + TRACFCOMP( g_trac_cxxtest, "Task %d crashed with status %d.", + t->tid, status ); + if(CxxTest::g_FailedTests < CxxTest::CXXTEST_FAIL_LIST_SIZE) + { + CxxTest::CxxTestFailedEntry *l_failedEntry = + &CxxTest::g_FailedTestList[CxxTest::g_FailedTests]; + sprintf(l_failedEntry->failTestFile, + "%s crashed", + t->module); + l_failedEntry->failTestData = t->tid; + } __sync_add_and_fetch(&CxxTest::g_FailedTests, 1); } else { - TRACFCOMP( g_trac_cxxtest, "Task %d finished.", *t ); + TRACFCOMP( g_trac_cxxtest, "Task %d finished.", t->tid ); } } @@ -158,6 +186,15 @@ void cxxinit( errlHndl_t &io_taskRetErrl ) CxxTest::g_Warnings ); TRACFCOMP( g_trac_cxxtest, " trace calls: %d", CxxTest::g_TraceCalls ); + for (uint64_t i = 0; + (i < CxxTest::g_FailedTests) && (i < CxxTest::CXXTEST_FAIL_LIST_SIZE); + i++ ) + { + TRACFCOMP( g_trac_cxxtest, " failed test[%d]: %s (%d)", + i, + CxxTest::g_FailedTestList[i].failTestFile, + CxxTest::g_FailedTestList[i].failTestData); + } // @todo dump out an informational errorlog?? |