VirtualBox

Ignore:
Timestamp:
May 16, 2005 4:54:02 PM (20 years ago)
Author:
bird
Message:

Current make snaphot, 2005-05-16.

Location:
branches/GNU/src/gmake
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gmake

    • Property svn:ignore
      •  

        old new  
        3434README.DOS
        3535README.W32
         36README.OS2
        3637aclocal.m4
        3738autom4te.cache
  • branches/GNU/src/gmake/tests/scripts/test_template

    r53 r280  
    1 $description = "The following test creates a makefile to ...
    2                      <FILL IN DESCRIPTION HERE> ";
     1#                                                                    -*-perl-*-
    32
     3$description = "<FILL IN SHORT DESCRIPTION HERE>";
    44$details = "<FILL IN DETAILS OF HOW YOU TEST WHAT YOU SAY YOU ARE TESTING>";
    55
    6 # IF YOU NEED >1 MAKEFILE FOR THIS TEST, USE &get_tmpfile; TO GET
    7 # THE NAME OF THE MAKEFILE.  THIS INSURES CONSISTENCY AND KEEPS TRACK OF
    8 # HOW MANY MAKEFILES EXIST FOR EASY DELETION AT THE END.
    9 # EXAMPLE: $makefile2 = &get_tmpfile;
     6# Run a make test.  See the documentation of run_make_test() in
     7# run_make_tests.pl, but briefly the first argument is a string with the
     8# contents of a makefile to be tested, the second is a string containing the
     9# arguments to be passed to the make invocation, the third is a string
     10# containing the expected output.  The fourth is the expected exit code for
     11# make.  If not specified, it's assumed that the make program should succeed
     12# (exit with 0).
    1013
    11 open(MAKEFILE,"> $makefile");
     14run_make_test('Your test makefile goes here',
     15              'Arguments to pass to make go here',
     16              'Expected output from the invocation goes here');
    1217
    13 # The Contents of the MAKEFILE ...
     18# There are various special tokens, options, etc.  See the full documentation
     19# in run_make_tests.pl.
    1420
    15 print MAKEFILE " <FILL IN THE CONTENTS OF THE MAKEFILE HERE>  \n";
    16 
    17 # END of Contents of MAKEFILE
    18 
    19 close(MAKEFILE);
    20 
    21 
    22 # Run make.  You may specify a makefile, but if you don't want to, just
    23 # insert "" where $make_filename is now.  You may also specify specific
    24 # options to run make with, but you also don't have to. (Insert "" where it
    25 # says <FILL IN OPTIONS HERE>), The last field in this subroutine call
    26 # is the code which is returned from make.  If you think that make should
    27 # execute with no errors, you may OPTIONALLY put 0; Otherwise put the
    28 # error code that you expect back from make for this test.
    29 
    30 # Every time you run make, you just need to say &get_logfile and that
    31 # subroutine will get a new logfile name for you in incrementing order
    32 # according to how many times you call it within ONE test.  It is
    33 # reset to 0 at the beginning of every new test script.
    34 
    35 &run_make_with_options($makefile,
    36                        "<FILL IN OPTIONS HERE>",
    37                        &get_logfile,
    38                        0);
    39 
    40 
    41 # THE REST OF THIS FILE DEPENDS HIGHLY ON WHAT KIND OF TEST YOU ARE
    42 # CREATING, SO IT WILL VARY.  BASICALLY, YOU MAY INSERT ANYTHING YOU
    43 # WISH AT THIS POINT TO SEE IF THE TEST WORKED OK.  IF THERE ARE
    44 # ADDITIONAL TESTS BESIDES &compare_output, AND IT FAILES, YOU
    45 # MUST *** SET $test_passed = 0 !!! ***
    46 
    47 # Create the answer to what should be produced by this Makefile
    48 $answer = "<INSERT ANSWER HERE>";
    49 
    50 # COMPARE RESULTS
    51 
    52 # In this call to compare output, you should use the call &get_logfile(1)
    53 # to send the name of the last logfile created.  You may also use
    54 # the special call &get_logfile(1) which returns the same as &get_logfile(1).
    55 
    56 &compare_output($answer,&get_logfile(1));
    57 
    58 # If you wish to &error ("abort
    59 ") if the compare fails, then add a "|| &error ("abort
    60 ")" to the
    61 # end of the previous line.
    6221
    6322# This tells the test driver that the perl test script executed properly.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette