diff options
author | Brian Horton <brianh@linux.ibm.com> | 2012-04-09 14:57:23 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-04-16 09:58:13 -0500 |
commit | fd1bb17259b5c4ed249ec97827ac9ed24748ad5a (patch) | |
tree | e3c7a4ac76a45cfd2d28cba05df3b3a059025270 | |
parent | 7e30eba46d1e6cd145ac4db5fd92383c369cf5aa (diff) | |
download | talos-hostboot-fd1bb17259b5c4ed249ec97827ac9ed24748ad5a.tar.gz talos-hostboot-fd1bb17259b5c4ed249ec97827ac9ed24748ad5a.zip |
Cause build to fail if duplicate reason code / module id is found
Change the scanforsrcs.pl script to die w/ an error if a duplicate
reason code is found within a module. In addition, correct makefile
so that the script is run all the time, so that errors are caught
before jenkins. And more script to code_pass instead of gen_pass
so that all files it needs are created before it's run.
Change-Id: Idd5fe546207920e9561091bbed1817efc04f2ebc
RTC: 38731
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/869
Tested-by: Jenkins Server
Reviewed-by: Terry J. Opie <opiet@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r-- | src/usr/errl/parser/makefile | 8 | ||||
-rwxr-xr-x | src/usr/errl/parser/scanforsrcs.pl | 15 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/usr/errl/parser/makefile b/src/usr/errl/parser/makefile index dd9f132bf..e0307c629 100644 --- a/src/usr/errl/parser/makefile +++ b/src/usr/errl/parser/makefile @@ -49,9 +49,9 @@ CFLAGS:=-g -O0 -I $(ROOTPATH)/src/include/usr -I ${GENDIR} all: gen_pass code_pass -gen_pass: mkdirs ${SRCPARSE_HEADER_TARGET} ${GENDIR}/comps.C +gen_pass: mkdirs ${GENDIR}/comps.C -code_pass: ${IMGDIR}/errlparser +code_pass: ${SRCPARSE_HEADER_TARGET} ${IMGDIR}/errlparser # errlparserbase and errlusrparser are plugins stuff, not errlparser. # OBJFILES = ${OBJDIR}/errlparserbase.o ${OBJDIR}/errlusrparser.o @@ -63,7 +63,7 @@ mkdirs: mkdir -p ${GENDIR} # Parse for error log tags in the Hostboot code, and generate hostBootSrcParse.H -${SRCPARSE_HEADER_TARGET} : +${SRCPARSE_HEADER_TARGET} :: ./scanforsrcs.pl -b ${ROOTPATH} -o ${GENDIR} ${GENDIR}/comps.C: ${ROOTPATH}/src/include/usr/hbotcompid.H @@ -72,7 +72,7 @@ ${GENDIR}/comps.C: ${ROOTPATH}/src/include/usr/hbotcompid.H sed 's/const compId_t \([A-Z0-9]*\)_COMP_ID[ =\t]*\(0[xX][0-9a-fA-F]*\).*/{ "\1", \2 },/' \ > $@ -${OBJDIR}/errlparser.o: errlparser.C ${ROOTPATH}/src/include/usr/errl/hberrltypes.H ${GENDIR}/comps.C +${OBJDIR}/errlparser.o: errlparser.C ${ROOTPATH}/src/include/usr/errl/hberrltypes.H ${GENDIR}/comps.C ${SRCPARSE_HEADER_TARGET} $(CC) -c $(CFLAGS) -o $@ $< diff --git a/src/usr/errl/parser/scanforsrcs.pl b/src/usr/errl/parser/scanforsrcs.pl index 6c187a848..4f6cb73da 100755 --- a/src/usr/errl/parser/scanforsrcs.pl +++ b/src/usr/errl/parser/scanforsrcs.pl @@ -238,11 +238,17 @@ $fh = openHeaderFile(); # Start writing the main header file that will be included by errlparser.C startMainHeaderFile( $fh ); +my $found_dup = 0; + # Write each case statement for printing foreach my $key (sort(keys(%Comps))) { writePrintStatement( $fh, $key, \@{$Comps{$key}} ); } +if($found_dup > 0) +{ + die( "ERROR! Duplicate hash found!\n" ); +} # Finish writing the header finishMainHeaderFile( $fh ); @@ -672,19 +678,20 @@ sub writePrintStatement debugMsg( "Reason Code: $reasonCode" ); # If we've got a duplicate Module Id/Reason code go, on to the - # next one. We can't have duplicates, and its been asked that - # we don't have compile errors because of it. + # next one. We can't have duplicates, so if we do we set found_dup + # so that we can die after this loop if( "$modId.$reasonCode" eq $caseHash{ $compName } ) { debugMsg( "Hash exists, skip subsequent." ); - # Print a warning message + # Print a error message print "\n#################################################################\n"; - print " WARNING - Duplicate hash found for:\n"; + print " ERROR - Duplicate hash found for:\n"; print " component $compName\n"; print " module id $modId\n"; print " reason code $reasonCode\n"; print "#################################################################\n"; + $found_dup = 1; next; } else |