Changeset 355 for trunk/src


Ignore:
Timestamp:
Jul 11, 2003, 2:27:52 PM (22 years ago)
Author:
bird
Message:

All dependencies done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/testcase/checkhdrs.cmd

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r354 r355  
    1313 */
    1414
    15 parse arg sInclude sOther
     15parse arg sInclude sOther
    1616if (sInclude = '') then
    1717do
    18     say 'syntax: checkhdrs <includedir>';
     18    say 'syntax: checkhdrs <includedir>';
    1919    exit 8;
    2020end
     
    3737 */
    3838i = 1;
    39 asExcludes.i = ''; i=i+1;
     39asExcludes.i = 'os2tk.h'; i=i+1;
     40asExcludes.i = 'sys\moddef.h'; i=i+1;   /* f**kup */
     41asExcludes.i = 'objc\encoding.h'; i=i+1;
     42asExcludes.i = 'objc\hash.h'; i=i+1;
     43asExcludes.i = 'objc\NXConstS.h'; i=i+1;
     44asExcludes.i = 'objc\objc-api.h'; i=i+1;
     45asExcludes.i = 'objc\objc-lis.h'; i=i+1;
     46asExcludes.i = 'objc\objc.h'; i=i+1;
     47asExcludes.i = 'objc\Object.h'; i=i+1;
     48asExcludes.i = 'objc\Protocol.h'; i=i+1;
     49asExcludes.i = 'objc\sarray.h'; i=i+1;
     50asExcludes.i = 'objc\thr.h'; i=i+1;
     51asExcludes.i = 'objc\typedstr.h'; i=i+1;
     52asExcludes.i = '386\types.h'; i=i+1;
     53asExcludes.i = 'machine\types.h'; i=i+1;
    4054asExcludes.0 = i - 1;
    4155
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
    42101
    43102/*
     
    45104 */
    46105asFiles.0 = 0;
    47 rc = SysFileTree(sInclude'\*.h', 'asFiles', 'OSF');
     106if (sFile <> '') then
     107do
     108    rc = SysFileTree(sFile, 'asFiles', 'OSF');
     109    if (asFiles.0 = 0) then
     110        rc = SysFileTree(sInclude'\'sFile, 'asFiles', 'OSF');
     111end
     112else
     113    rc = SysFileTree(sInclude'\*.h', 'asFiles', 'OSF');
    48114if (rc <> 0) then
    49115do
     
    59125asFailed.0 = 0;
    60126do i = 1 to asFiles.0
    61     sName = substr(asFiles.i, length(sInclude) + 2);
    62     say 'info: testing 'sName'....';
     127    call testfile sInclude, asFiles.i;
     128end
     129
     130if (asFailed.0 > 0) then
     131do
     132    say 'The following files failed:'
     133    do i = 1 to asFailed.0
     134        say '  'asFailed.i;
     135    end
     136end
     137
     138exit(asFailed.0);
     139
     140
     141
     142/**
     143 * Test one file.
     144 * @returns 0
     145 * @param   sDir    Include directory (for the -I option and for basing sFile).
     146 * @param   sFile   The include file to test, full path.
     147 */
     148testfile: procedure expose asFailed. asExcludes. aReq.
     149parse arg sDir, sFile
     150    sName = substr(sFile, length(sDir) + 2);
     151    if (isExcluded(sName)) then
     152    do
     153        say 'info: skipping 'sName'...';
     154        return 0;
     155    end
     156
     157    say 'info: testing 'sName'...';
    63158    sTmp = '.\tmpfile.cpp';
    64159    sTmpS = '.\tmpfile.s';
    65160    call SysFileDelete sTmp;
     161
    66162    call lineout sTmp, '#include <'sName'>';
    67163    call lineout sTmp, 'int main() {return 0;}';
    68164    call lineout sTmp
    69     Address CMD 'gcc -S -I'sInclude sTmp;
     165    /*Address CMD 'type 'sTmp; */
     166    Address CMD 'gcc -S -O -Wall -I'sDir sTmp;
    70167    if (rc <> 0) then
    71168    do
     
    76173    call SysFileDelete sTmp;
    77174    call SysFileDelete sTmpS;
    78 end
    79 
    80 if (asFailed.0 > 0) then
    81 do
    82     say 'The following files failed:'
    83     do i = 1 to asFailed.0
    84         say '  'asFailed.i;
    85     end
    86 end
    87 
    88 exit(asFailed.0);
     175return 0;
     176
     177
     178/**
     179 * Check if sFile is excluded from testing.
     180 */
     181isExcluded: procedure expose asExcludes.
     182parse arg sFile
     183    do i = 1 to asExcludes.0
     184        if (sFile = asExcludes.i) then
     185            return 1;
     186    end
     187return 0;
     188
     189
     190/**
     191 * Writes required code (#includes) for a given header.
     192 */
     193writeReqs: procedure expose aReq.
     194parse arg sOutput, sFile
     195    do i = 1 to aReq.0
     196        if (sFile = aReq.i.msHdr) then
     197        do
     198            do j = 1 to words(aReq.i.msIncs)
     199                call lineout sOutput, '#include <'word(aReq.i.msIncs, j)'>';
     200            end
     201            leave i;
     202        end
     203    end
     204return 0;
Note: See TracChangeset for help on using the changeset viewer.