VirtualBox

source: kBuild/vendor/gnumake/current/tests/scripts/options/dash-C@ 3208

最後變更 在這個檔案從3208是 3138,由 bird 提交於 7 年 前

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

  • 屬性 svn:eol-style 設為 LF
檔案大小: 1.7 KB
 
1# -*-perl-*-
2
3$description = "Test the -C option to GNU make.";
4
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";
12
13open(MAKEFILE,"> $makefile");
14print MAKEFILE <<EOF;
15all: ; \@echo This makefile did not clean the dir ... good
16clean: ; $delete_command EXAMPLE\$(ext)
17EOF
18close(MAKEFILE);
19
20# TEST #1
21# -------
22&touch($example);
23
24&run_make_with_options("${testname}.mk",
25 "-C $workdir clean",
26 &get_logfile);
27
28chdir $workdir;
29$wpath = &get_this_pwd;
30chdir $pwd;
31
32if (-f $example) {
33 $test_passed = 0;
34}
35
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";
40
41&compare_output($answer,&get_logfile(1));
42
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;
62}
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
711;
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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