1 | # -*-perl-*-
|
---|
2 |
|
---|
3 | $description = "The following test creates a makefile to verify
|
---|
4 | the ability of make to sort lists of object. Sort
|
---|
5 | will also remove any duplicate entries. This will also
|
---|
6 | be tested.";
|
---|
7 |
|
---|
8 | $details = "The make file is built with a list of object in a random order
|
---|
9 | and includes some duplicates. Make should sort all of the elements
|
---|
10 | remove all duplicates\n";
|
---|
11 |
|
---|
12 | run_make_test('
|
---|
13 | foo := moon_light days
|
---|
14 | foo1:= jazz
|
---|
15 | bar := captured
|
---|
16 | bar2 = boy end, has rise A midnight
|
---|
17 | bar3:= $(foo)
|
---|
18 | s1 := _by
|
---|
19 | s2 := _and_a
|
---|
20 | t1 := $(addsuffix $(s1), $(bar) )
|
---|
21 | t2 := $(addsuffix $(s2), $(foo1) )
|
---|
22 | t3 := $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2)
|
---|
23 | t4 := $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3)
|
---|
24 | t5 := $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4)
|
---|
25 | t6 := $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5)
|
---|
26 | t7 := $(t6) $(t6) $(t6)
|
---|
27 | p1 := $(addprefix $(foo1), $(s2) )
|
---|
28 | blank:=
|
---|
29 | all:
|
---|
30 | @echo $(sort $(bar2) $(foo) $(addsuffix $(s1), $(bar) ) $(t2) $(bar2) $(bar3))
|
---|
31 | @echo $(sort $(blank) $(foo) $(bar2) $(t1) $(p1) )
|
---|
32 | @echo $(sort $(foo) $(bar2) $(t1) $(t4) $(t5) $(t7) $(t6) )
|
---|
33 | ',
|
---|
34 | '', 'A boy captured_by days end, has jazz_and_a midnight moon_light rise
|
---|
35 | A boy captured_by days end, has jazz_and_a midnight moon_light rise
|
---|
36 | A boy captured_by days end, has jazz_and_a midnight moon_light rise
|
---|
37 | ');
|
---|
38 |
|
---|
39 |
|
---|
40 | # Test with non-space/tab whitespace. Note that you can't see the
|
---|
41 | # original bug except using valgrind.
|
---|
42 |
|
---|
43 | run_make_test("FOO = a b\tc\rd\fe \f \f \f \f \ff
|
---|
44 | all: ; \@echo \$(words \$(sort \$(FOO)))\n",
|
---|
45 | '', "6\n");
|
---|
46 |
|
---|
47 | 1;
|
---|
48 |
|
---|
49 | ### Local Variables:
|
---|
50 | ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
|
---|
51 | ### End:
|
---|