VirtualBox

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

Current make snaphot, 2005-05-16.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gmake/tests/scripts/options/dash-C

    r53 r284  
    1 $description = "The following test creates a makefile to test the -C dir \n"
    2               ."option in make.  This option tells make to change to \n"
    3               ."directory dir before reading the makefile.";
     1#                                                                    -*-perl-*-
    42
    5 $details = "This test is similar to the clean test except that this test\n"
    6           ."creates the file to delete in the work directory instead of\n"
    7           ."the current directory.  Make is called from another directory\n"
    8           ."using the -C workdir option so that it can both find the \n"
    9           ."makefile and the file to delete in the work directory. ";
     3$description = "Test the -C option to GNU make.";
    104
    11 $example = $workdir . $pathsep . "EXAMPLE_FILE";
     5$details = "\
     6This test is similar to the clean test except that this test creates the file
     7to delete in the work directory instead of the current directory.  Make is
     8called from another directory using the -C workdir option so that it can both
     9find the makefile and the file to delete in the work directory.";
     10
     11$example = $workdir . $pathsep . "EXAMPLE";
    1212
    1313open(MAKEFILE,"> $makefile");
    14 
    15 # The Contents of the MAKEFILE ...
    16 
    17 print MAKEFILE "all: \n";
    18 print MAKEFILE "\t\@echo This makefile did not clean the dir ... good\n";
    19 print MAKEFILE "clean: \n";
    20 print MAKEFILE "\t$delete_command EXAMPLE_FILE\n";
    21 
    22 # END of Contents of MAKEFILE
    23 
     14print MAKEFILE <<EOF;
     15all: ; \@echo This makefile did not clean the dir ... good
     16clean: ; $delete_command EXAMPLE\$(ext)
     17EOF
    2418close(MAKEFILE);
    2519
     20# TEST #1
     21# -------
    2622&touch($example);
    2723
     
    3430chdir $pwd;
    3531
     32if (-f $example) {
     33  $test_passed = 0;
     34}
     35
    3636# Create the answer to what should be produced by this Makefile
    3737$answer = "$make_name: Entering directory `$wpath'\n"
    38         . "$delete_command EXAMPLE_FILE\n"
     38        . "$delete_command EXAMPLE\n"
    3939        . "$make_name: Leaving directory `$wpath'\n";
    4040
    4141&compare_output($answer,&get_logfile(1));
    4242
    43 if (-f $example)
    44 {
    45    $test_passed = 0;
     43
     44# TEST #2
     45# -------
     46# Do it again with trailing "/"; this should work the same
     47
     48$example .= "slash";
     49
     50&touch($example);
     51
     52&run_make_with_options("${testname}.mk",
     53                       "-C $workdir/ clean ext=slash",
     54                       &get_logfile);
     55
     56chdir $workdir;
     57$wpath = &get_this_pwd;
     58chdir $pwd;
     59
     60if (-f $example) {
     61  $test_passed = 0;
    4662}
    4763
     64# Create the answer to what should be produced by this Makefile
     65$answer = "$make_name: Entering directory `$wpath'\n"
     66        . "$delete_command EXAMPLEslash\n"
     67        . "$make_name: Leaving directory `$wpath'\n";
     68
     69&compare_output($answer,&get_logfile(1));
     70
    48711;
Note: See TracChangeset for help on using the changeset viewer.

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