summaryrefslogtreecommitdiff
path: root/tests/scripts/options/dash-n
blob: 97dac7a713e22eca82b28102638ac0b86be15ad2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#                                                                    -*-perl-*-
$description = "Test the -n option.\n";

$details = "Try various uses of -n and ensure they all give the correct results.\n";

open(MAKEFILE, "> $makefile");

# The Contents of the MAKEFILE ...

print MAKEFILE <<'EOMAKE';

final: intermediate ; touch $@
intermediate: orig ; touch $@

EOMAKE

close(MAKEFILE);

&touch('orig');

&run_make_with_options($makefile, "", &get_logfile);
$answer = "touch intermediate\ntouch final\n";
&compare_output($answer, &get_logfile(1));

&run_make_with_options($makefile, "-Worig -n", &get_logfile);
$answer = "touch intermediate\ntouch final\n";
&compare_output($answer, &get_logfile(1));

unlink('orig', 'intermediate', 'final');

1;