Changeset 284 in kBuild for branches/GNU/src/gmake/tests/scripts/options/dash-C
- Timestamp:
- May 16, 2005 4:54:08 PM (19 years ago)
- 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-*- 4 2 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."; 10 4 11 $example = $workdir . $pathsep . "EXAMPLE_FILE"; 5 $details = "\ 6 This test is similar to the clean test except that this test creates the file 7 to delete in the work directory instead of the current directory. Make is 8 called from another directory using the -C workdir option so that it can both 9 find the makefile and the file to delete in the work directory."; 10 11 $example = $workdir . $pathsep . "EXAMPLE"; 12 12 13 13 open(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 14 print MAKEFILE <<EOF; 15 all: ; \@echo This makefile did not clean the dir ... good 16 clean: ; $delete_command EXAMPLE\$(ext) 17 EOF 24 18 close(MAKEFILE); 25 19 20 # TEST #1 21 # ------- 26 22 &touch($example); 27 23 … … 34 30 chdir $pwd; 35 31 32 if (-f $example) { 33 $test_passed = 0; 34 } 35 36 36 # Create the answer to what should be produced by this Makefile 37 37 $answer = "$make_name: Entering directory `$wpath'\n" 38 . "$delete_command EXAMPLE _FILE\n"38 . "$delete_command EXAMPLE\n" 39 39 . "$make_name: Leaving directory `$wpath'\n"; 40 40 41 41 &compare_output($answer,&get_logfile(1)); 42 42 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 56 chdir $workdir; 57 $wpath = &get_this_pwd; 58 chdir $pwd; 59 60 if (-f $example) { 61 $test_passed = 0; 46 62 } 47 63 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 48 71 1;
Note:
See TracChangeset
for help on using the changeset viewer.

