📄 double_colon
字号:
# -*-perl-*-$description = "Test handling of double-colon rules.";$details = "\We test these features: - Multiple commands for the same (double-colon) target - Different prerequisites for targets: only out-of-date ones are rebuilt. - Double-colon targets that aren't the goal target.Then we do the same thing for parallel builds: double-colontargets should always be built serially.";# The Contents of the MAKEFILE ...open(MAKEFILE,"> $makefile");print MAKEFILE <<'EOF';all: bazfoo:: f1.h ; @echo foo FIRSTfoo:: f2.h ; @echo foo SECONDbar:: ; @echo aaa; sleep 1; echo aaa donebar:: ; @echo bbbbaz:: ; @echo aaabaz:: ; @echo bbbbiz:: ; @echo aaabiz:: two ; @echo bbbtwo: ; @echo twof1.h f2.h: ; @echo $@d :: ; @echo okd :: d ; @echo oopsEOFclose(MAKEFILE);# TEST 0: A simple double-colon rule that isn't the goal target.&run_make_with_options($makefile, "all", &get_logfile, 0);$answer = "aaa\nbbb\n";&compare_output($answer, &get_logfile(1));# TEST 1: As above, in parallelif ($parallel_jobs) { &run_make_with_options($makefile, "-j10 all", &get_logfile, 0); $answer = "aaa\nbbb\n"; &compare_output($answer, &get_logfile(1));}# TEST 2: A simple double-colon rule that is the goal target&run_make_with_options($makefile, "bar", &get_logfile, 0);$answer = "aaa\naaa done\nbbb\n";&compare_output($answer, &get_logfile(1));# TEST 3: As above, in parallelif ($parallel_jobs) { &run_make_with_options($makefile, "-j10 bar", &get_logfile, 0); $answer = "aaa\naaa done\nbbb\n"; &compare_output($answer, &get_logfile(1));}# TEST 4: Each double-colon rule is supposed to be run individually&utouch(-5, 'f2.h');&touch('foo');&run_make_with_options($makefile, "foo", &get_logfile, 0);$answer = "f1.h\nfoo FIRST\n";&compare_output($answer, &get_logfile(1));# TEST 5: Again, in parallel.if ($parallel_jobs) { &run_make_with_options($makefile, "-j10 foo", &get_logfile, 0); $answer = "f1.h\nfoo FIRST\n"; &compare_output($answer, &get_logfile(1));}# TEST 6: Each double-colon rule is supposed to be run individually&utouch(-5, 'f1.h');unlink('f2.h');&touch('foo');&run_make_with_options($makefile, "foo", &get_logfile, 0);$answer = "f2.h\nfoo SECOND\n";&compare_output($answer, &get_logfile(1));# TEST 7: Again, in parallel.if ($parallel_jobs) { &run_make_with_options($makefile, "-j10 foo", &get_logfile, 0); $answer = "f2.h\nfoo SECOND\n"; &compare_output($answer, &get_logfile(1));}# TEST 8: Test circular dependency check; PR/1671&run_make_with_options($makefile, "d", &get_logfile, 0);$answer = "ok\n$make_name: Circular d <- d dependency dropped.\noops\n";&compare_output($answer, &get_logfile(1));# TEST 8: I don't grok why this is different than the above, but it is...## Hmm... further testing indicates this might be timing-dependent?##if ($parallel_jobs) {# &run_make_with_options($makefile, "-j10 biz", &get_logfile, 0);# $answer = "aaa\ntwo\nbbb\n";# &compare_output($answer, &get_logfile(1));#}unlink('foo','f1.h','f2.h');1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -