Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines.
[make.git] / tests / scripts / options / dash-C
blob42d0a8baeb43bdcd20cf3357b41d518502c079b5
1 #                                                                    -*-perl-*-
3 $description = "Test the -C option to GNU make.";
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.";
11 $example = $workdir . $pathsep . "EXAMPLE";
13 open(MAKEFILE,"> $makefile");
14 print MAKEFILE <<EOF;
15 all: ; \@echo This makefile did not clean the dir ... good
16 clean: ; $delete_command EXAMPLE\$(ext)
17 EOF
18 close(MAKEFILE);
20 # TEST #1
21 # -------
22 &touch($example);
24 &run_make_with_options("${testname}.mk",
25                        "-C $workdir clean",
26                        &get_logfile);
28 chdir $workdir;
29 $wpath = &get_this_pwd;
30 chdir $pwd;
32 if (-f $example) {
33   $test_passed = 0;
36 # Create the answer to what should be produced by this Makefile
37 $answer = "$make_name: Entering directory '$wpath'\n"
38         . "$delete_command EXAMPLE\n"
39         . "$make_name: Leaving directory '$wpath'\n";
41 &compare_output($answer,&get_logfile(1));
44 # TEST #2
45 # -------
46 # Do it again with trailing "/"; this should work the same
48 $example .= "slash";
50 &touch($example);
52 &run_make_with_options("${testname}.mk",
53                        "-C $workdir/ clean ext=slash",
54                        &get_logfile);
56 chdir $workdir;
57 $wpath = &get_this_pwd;
58 chdir $pwd;
60 if (-f $example) {
61   $test_passed = 0;
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";
69 &compare_output($answer,&get_logfile(1));