VirtualBox

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

Current make snaphot, 2005-05-16.

Location:
branches/GNU/src/gmake/tests/scripts/options
Files:
4 edited

Legend:

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

    r53 r284  
    99is built again.";
    1010
    11 open(MAKEFILE,"> $makefile");
     11&touch('bar.x');
    1212
    13 print MAKEFILE <<'EOF';
     13run_make_test('
    1414.SUFFIXES:
    1515
     
    2020        @echo cp $< $@
    2121        @echo "" > $@
    22 EOF
     22',
     23              '', 'cp bar.x foo');
    2324
    24 close(MAKEFILE);
     25run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");
     26run_make_test(undef, '-B', 'cp bar.x foo');
     27
     28# Put the timestamp for foo into the future; it should still be remade.
     29
     30utouch(1000, 'foo');
     31run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");
     32run_make_test(undef, '-B', 'cp bar.x foo');
    2533
    2634
    27 &touch('bar.x');
     35# Clean up
    2836
    29 &run_make_with_options($makefile, '', &get_logfile);
    30 $answer = "cp bar.x foo\n";
    31 &compare_output($answer, &get_logfile(1));
    32 
    33 &run_make_with_options($makefile, '', &get_logfile);
    34 $answer = "$make_name: Nothing to be done for `all'.\n";
    35 &compare_output($answer, &get_logfile(1));
    36 
    37 &run_make_with_options($makefile, '-B', &get_logfile);
    38 $answer = "cp bar.x foo\n";
    39 &compare_output($answer, &get_logfile(1));
    40 
    41 unlink('bar.x', 'foo') unless $keep;
     37rmfiles('bar.x', 'foo');
    4238
    43391;
  • 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;
  • branches/GNU/src/gmake/tests/scripts/options/dash-k

    r53 r284  
    9898&compare_output($answer, &get_logfile(1));
    9999
     100# TEST -- make sure we keep the error code if we can't create an included
     101# makefile.
     102
     103run_make_test('all: ; @echo hi
     104include ifile
     105ifile: no-such-file; @false
     106',
     107              '-k',
     108              "#MAKEFILE#:2: ifile: No such file or directory
     109#MAKE#: *** No rule to make target `no-such-file', needed by `ifile'.
     110#MAKE#: Failed to remake makefile `ifile'.
     111hi\n",
     112              512);
     113
    1001141;
  • branches/GNU/src/gmake/tests/scripts/options/dash-q

    r53 r284  
    44$details = "Try various uses of -q and ensure they all give the correct results.\n";
    55
    6 open(MAKEFILE, "> $makefile");
     6# TEST 0
    77
    8 # The Contents of the MAKEFILE ...
    9 
    10 print MAKEFILE <<'EOMAKE';
     8run_make_test('
    119one:
    1210two: ;
     
    2220        : foo
    2321        $(.XY)
    24 EOMAKE
    25 
    26 close(MAKEFILE);
    27 
    28 # TEST 0
    29 
    30 &run_make_with_options($makefile, "-q one", &get_logfile);
    31 $answer = "";
    32 &compare_output($answer, &get_logfile(1));
     22',
     23              '-q one', '');
    3324
    3425# TEST 1
    3526
    36 &run_make_with_options($makefile, "-q two", &get_logfile);
    37 $answer = "";
    38 &compare_output($answer, &get_logfile(1));
     27run_make_test(undef, '-q two', '');
    3928
    4029# TEST 2
    4130
    42 &run_make_with_options($makefile, "-q three", &get_logfile, 256);
    43 $answer = "";
    44 &compare_output($answer, &get_logfile(1));
     31run_make_test(undef, '-q three', '', 256);
    4532
    4633# TEST 3
    4734
    48 &run_make_with_options($makefile, "-q four", &get_logfile);
    49 $answer = "";
    50 &compare_output($answer, &get_logfile(1));
     35run_make_test(undef, '-q four', '');
    5136
    5237# TEST 4
    5338
    54 &run_make_with_options($makefile, "-q five", &get_logfile);
    55 $answer = "";
    56 &compare_output($answer, &get_logfile(1));
     39run_make_test(undef, '-q five', '');
    5740
    5841# TEST 5
    5942
    60 &run_make_with_options($makefile, "-q six", &get_logfile);
    61 $answer = "";
    62 &compare_output($answer, &get_logfile(1));
     43run_make_test(undef, '-q six', '');
    6344
    6445# TEST 6
    6546
    66 &run_make_with_options($makefile, "-q seven", &get_logfile, 256);
    67 $answer = "";
    68 &compare_output($answer, &get_logfile(1));
     47run_make_test(undef, '-q seven', '', 256);
     48
     49# TEST 7 : Savannah bug # 7144
     50
     51run_make_test('
     52one:: ; @echo one
     53one:: ; @echo two
     54',
     55              '-q', '', 256);
    6956
    70571;
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