bintools/rcomp/tsrc/TEST.CMD
changeset 0 044383f39525
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 @rem
       
     2 @rem Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 @rem All rights reserved.
       
     4 @rem This component and the accompanying materials are made available
       
     5 @rem under the terms of the License "Eclipse Public License v1.0"
       
     6 @rem which accompanies this distribution, and is available
       
     7 @rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 @rem
       
     9 @rem Initial Contributors:
       
    10 @rem Nokia Corporation - initial contribution.
       
    11 @rem
       
    12 @rem Contributors:
       
    13 @rem
       
    14 @rem Description: 
       
    15 @rem
       
    16 
       
    17 @ECHO OFF
       
    18 REM TEST.CMD ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       
    19 REM
       
    20 REM Called to run tests on the resource compiler.
       
    21 REM
       
    22 REM P1 may be a test number or "ALL" to cause all the tests to be run.
       
    23 REM
       
    24 REM ---------------------------------------------------------------------------
       
    25 REM
       
    26 SETLOCAL
       
    27 SET n_tests=2
       
    28 
       
    29 REM
       
    30 IF "%1" == "" GOTO HELP
       
    31 IF /I "%1" == "help" GOTO help
       
    32 REM
       
    33 IF /I "%1" == "ALL" GOTO test_all
       
    34 REM
       
    35 
       
    36 FOR %%i IN (1,2) DO IF "%1" == "%%i" GOTO valid_test
       
    37 
       
    38 ECHO ** problem: %1 is not a recognised test
       
    39 ENDLOCAL
       
    40 GOTO :EOF
       
    41 
       
    42 :valid_test
       
    43 CALL :test_%1
       
    44 
       
    45 ENDLOCAL
       
    46 GOTO :EOF
       
    47 
       
    48 :test_all
       
    49 ECHO Running through each test...
       
    50 FOR /L %%i IN (1,1,%n_tests%) DO CALL :test_%%i
       
    51 GOTO end
       
    52 
       
    53 
       
    54 :test_1
       
    55 ECHO Test 1 : Compare output with previous version
       
    56 
       
    57 IF EXIST test1.lis ERASE/Q TEST1.LIS
       
    58 
       
    59 ECHO.
       
    60 ECHO TUTEXT (16-bit)
       
    61 ECHO Expect five problem messages about deprecated characters...
       
    62 ECHO.
       
    63 rcomp -u -sTUTEXT.RSS -oTUTEXT16.RSC.NEW -hTUTEXT0.RSG.NEW
       
    64 FC TUTEXT0.RSG.NEW TUTEXT0.RSG >> test1.LIS
       
    65 FC/B TUTEXT16.RSC.NEW TUTEXT16.RSC >> test1.LIS
       
    66 
       
    67 
       
    68 ECHO.
       
    69 ECHO TWTEXT (16-bit only)...
       
    70 ECHO.
       
    71 rcomp -u -sTWTEXT.RSS -oTWTEXT16.RSC.NEW -hTWTEXT0.RSG.NEW
       
    72 FC TWTEXT0.RSG.NEW TWTEXT0.RSG >> test1.LIS
       
    73 FC/B TWTEXT16.RSC.NEW TWTEXT16.RSC >> test1.LIS
       
    74 
       
    75 
       
    76 
       
    77 
       
    78 
       
    79 DIR *lis |findstr/i test1
       
    80 
       
    81 ECHO Check the contents of test1.LIS for successful comparisons...
       
    82 ECHO A successful run yields a file of approximately 336 bytes in size.
       
    83 PAUSE
       
    84 
       
    85 
       
    86 GOTO :EOF
       
    87 
       
    88 
       
    89 :test_2
       
    90 ECHO Test 2 : Demonstrate behaviour with source errors
       
    91 
       
    92 FOR /F %%j IN (TEST2.DAT) DO cpp -I . -D%%j < ERROR1.RSS | rcomp -u -oERROR1.RSC -hERROR1.RSG
       
    93 
       
    94 ECHO.
       
    95 ECHO See the documentation in test.HTM for an explanation of the error messages
       
    96 PAUSE
       
    97 
       
    98 GOTO :EOF
       
    99 
       
   100 
       
   101 
       
   102 :help
       
   103 ECHO Usage: TEST parameter
       
   104 ECHO where parameter may be "HELP", "ALL" or a test number.
       
   105 ECHO The current tests are:
       
   106 ECHO  1 - Test compiler produces identical output to previous versions
       
   107 ECHO  2 - Test behaviour with various errors
       
   108 GOTO end
       
   109 
       
   110 
       
   111 
       
   112 :end
       
   113 ENDLOCAL
       
   114 REM ---------  end of TEST.CMD
       
   115