VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/functions/sort@ 3140

Last change on this file since 3140 was 3140, checked in by bird, 7 years ago

kmk: Merged in changes from GNU make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6 / https://git.savannah.gnu.org/git/make.git).

  • Property svn:eol-style set to LF
File size: 1.7 KB
Line 
1# -*-perl-*-
2
3$description = "The following test creates a makefile to verify
4the ability of make to sort lists of object. Sort
5will also remove any duplicate entries. This will also
6be tested.";
7
8$details = "The make file is built with a list of object in a random order
9and includes some duplicates. Make should sort all of the elements
10remove all duplicates\n";
11
12run_make_test('
13foo := moon_light days
14foo1:= jazz
15bar := captured
16bar2 = boy end, has rise A midnight
17bar3:= $(foo)
18s1 := _by
19s2 := _and_a
20t1 := $(addsuffix $(s1), $(bar) )
21t2 := $(addsuffix $(s2), $(foo1) )
22t3 := $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2)
23t4 := $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3)
24t5 := $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4)
25t6 := $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5)
26t7 := $(t6) $(t6) $(t6)
27p1 := $(addprefix $(foo1), $(s2) )
28blank:=
29all:
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
35A boy captured_by days end, has jazz_and_a midnight moon_light rise
36A 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
43run_make_test("FOO = a b\tc\rd\fe \f \f \f \f \ff
44all: ; \@echo \$(words \$(sort \$(FOO)))\n",
45 '', "6\n");
46
471;
48
49### Local Variables:
50### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
51### End:
Note: See TracBrowser for help on using the repository browser.

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