Stephen Lau wrote:
> Forrest Wu wrote:
>> Stephen Lau wrote:
>>> Hi Forrest,
>>>     digging up a really old thread here. :) Did you ever integrate 
>>> this into the onnv-scm tree?
>>>   
>> No. I haven't put it back.  Don't know if you accept my solution on 
>> this.
>
> Could you point me at your latest webrev and I'll take another look?
>
> cheers,
> steve
>
Hi Stephen,

Here is the latest hdrchk modification for HdrChk.py to support both 
TeamWare and Mercurial. I also modify the relevant test case and test 
example to verify those change. Please give me your comments and suggestion.

http://tas.eng/export/pub/Forrest/zfs/scm/scm_stool_2/webrev/

1> Modify interface of function hdrchk to support both Teamware and 
Mercurial.
2> Update Checks/HdrChk.py.
3> Currently, there is a bug in hdrchk.py. 'hdrchk -a' doesn't work as 
we expected. Fixed it.
4> Add a set of header check test examples, m-hdrchk,  for mercurial.
5> Rename hdrchk to t-hdrchk to keep the test examples for teamware.
6> Modify test_hdrchk.py to support both Teamware and Mercurial.
7> Add hdrchk2.py for Mercurial. So, wx will use hdrchk and Mercurial 
use hdrchk2

$ python tooltest.py -v HdrChk
hdrchk with malformed __cplusplus guards ... ok
hdrchk with missing copyright ... ok
hdrchk with invalid ending header guard ... ok
hdrchk with missing header guards ... ok
hdrchk with relative #include ... ok
hdrchk with invalid #pragma ident ... ok
hdrchk leniency with missing __cplusplus guards ... ok
hdrchk leniency with bad header guard names ... ok
hdrchk leniency with ident before header guard when lenient or not ... ok
hdrchk leniency with relative #include ... ok
hdrchk with missing __cplusplus end guard ... ok
hdrchk of file not needing __cplusplus guards ... ok
hdrchk with missing __cplusplus guards ... ok
hdrchk of valid header ... ok

----------------------------------------------------------------------
Ran 14 tests in 0.843s

$ pwd
/net/tas.eng/export/pub/Forrest/zfs/scm/scm_stool_2/usr/src/tools/onbld/Tests/tooltest
$ ../../../scripts/hdrchk tests/t-hdrchk/*.h
tests/t-hdrchk/badinclude.h: line 40: Bad include
tests/t-hdrchk/endguard.h: Missing or invalid ending header guard
tests/t-hdrchk/keywords.h: line 34: Invalid or missing #pragma ident
tests/t-hdrchk/keywordsbeforeguard.h: line 27: Invalid or missing header 
guard
tests/t-hdrchk/keywordsbeforeguard.h: Missing or invalid ending header guard
tests/t-hdrchk/malformedcppguards.h: line 39: Bad __cplusplus clause
tests/t-hdrchk/malformedcppguards.h: line 63: Bad __cplusplus clause
tests/t-hdrchk/nocopyright.h: line 22: Missing copyright in opening comment
tests/t-hdrchk/nocppguards.h: Missing __cplusplus guard
tests/t-hdrchk/noendcppguard.h: Missing closing #ifdef __cplusplus
tests/t-hdrchk/noguards.h: line 27: Invalid or missing header guard
tests/t-hdrchk/noguards.h: Missing or invalid ending header guard

$ ../../../scripts/hdrchk2 tests/m-hdrchk/*.h
tests/m-hdrchk/badinclude.h: line 38: Bad include
tests/m-hdrchk/endguard.h: Missing or invalid ending header guard
tests/m-hdrchk/keywords.h: line 30: Invalid keyword #ident for mercurial
tests/m-hdrchk/keywordsbeforeguard.h: line 27: Invalid keyword #ident 
for mercurial
tests/m-hdrchk/malformedcppguards.h: line 37: Bad __cplusplus clause
tests/m-hdrchk/malformedcppguards.h: line 61: Bad __cplusplus clause
tests/m-hdrchk/nocopyright.h: line 22: Missing copyright in opening comment
tests/m-hdrchk/nocppguards.h: Missing __cplusplus guard
tests/m-hdrchk/noendcppguard.h: Missing closing #ifdef __cplusplus
tests/m-hdrchk/noguards.h: line 31: Invalid or missing header guard
tests/m-hdrchk/noguards.h: Missing or invalid ending header guard

-- 
Thanks,

Forrest Wu, Sun China Engineering & Research
+86 10 62673294 http://blogs.sun.com/forrest


Reply via email to