aboutsummaryrefslogtreecommitdiff
path: root/tests/manifest/testscript
blob: f4a528236519a418f72f7551b4494d81aad8ab96 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
# file      : tests/manifest/testscript
# license   : MIT; see accompanying LICENSE file

: package
:
{
  test.options += -p

  : name
  :
  {
    : valid
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo.c++-2
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      url: http://www.example.org/projects/libfoo/
      email: libfoo-users@example.org
      EOF

    : short
    :
    $* <<EOI 2>'stdin:2:7: error: invalid package name: length is less than two characters' != 0
      : 1
      name: b
      EOI

    : illegal
    :
    $* <<EOI 2>'stdin:2:7: error: invalid package name: illegal name' != 0
      : 1
      name: com3
      EOI

    : illegal-first-char
    :
    $* <<EOI 2>'stdin:2:7: error: invalid package name: illegal first character (must be alphabetic)' != 0
      : 1
      name: 2b
      EOI

    : illegal-last-char
    :
    $* <<EOI 2>'stdin:2:7: error: invalid package name: illegal last character (must be alphabetic, digit, or plus)' != 0
      : 1
      name: foo_
      EOI

    : illegal-char
    :
    $* <<EOI 2>'stdin:2:7: error: invalid package name: illegal character' != 0
      : 1
      name: foo'bar
      EOI
  }

  : upstream-version
  :
  {
    : valid
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      upstream-version: 0.28.0.abc.15
      summary: Modern C++ parser
      license: LGPLv2
      description: libfoo is a very modern C++ XML parser.
      EOF

    : duplicate
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      upstream-version: 0.28.0.abc.15
      summary: Modern C++ parser
      license: LGPLv2
      description: libfoo is a very modern C++ XML parser.
      upstream-version: 0.28.0.abc.15
      EOI
      stdin:8:1: error: upstream package version redefinition
      EOE

    : stub
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 0+1
      upstream-version: 0.28.0.abc.15
      summary: Modern C++ parser
      license: LGPLv2
      description: libfoo is a very modern C++ XML parser.
      EOI
      stdin:4:1: error: upstream package version specified for a stub
      EOE
  }

  : license
  :
  {
    : no-scheme
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: MIT
      EOF

    : other-scheme
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: other:proprietary
      EOF

    : user-defined
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2; MIT-alike
      EOF

    : invalid-scheme
    :
    $* <<EOI 2>>EOE != 0
      : 1
      license: custom:proprietary
      EOI
      stdin:2:10: error: invalid package license scheme
      EOE
  }

  : topics
  :
  {
    : valid
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      topics: c++ library, foo library, libfoo
      EOF

    : too-many
    :
    $* <<EOI 2>>EOE != 0
      : 1
      topics: c++, library, lib, foo, libfoo, libbar
      EOI
      stdin:2:9: error: up to five topics allowed
      EOE
  }

  : keywords
  :
  {
    : valid
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      keywords: c++ library lib foo libfoo
      EOF

    : redefinition
    :
    $* <<EOI 2>>EOE != 0
      : 1
      keywords: c++ library lib foo libfoo
      keywords: c++ library lib foo libfoo
      EOI
      stdin:3:1: error: package keywords redefinition
      EOE

    : too-many
    :
    $* <<EOI 2>>EOE != 0
      : 1
      keywords: c++ library lib foo libfoo libbar
      EOI
      stdin:2:11: error: up to five keywords allowed
      EOE

    : empty
    :
    $* <<EOI 2>>EOE != 0
      : 1
      keywords:
      EOI
      stdin:2:10: error: empty package keywords specification
      EOE
  }

  : tags
  :
  {
    : truncate
    :
    $* <<EOI >>EOO
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tags: c++, library, lib, foo, libfoo, libbar
      EOI
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      keywords: c++ library lib foo libfoo
      EOO

    : with-space
    :
    $* <<EOI 2>>EOE != 0
      : 1
      tags: c++ library, lib, foo, libfoo
      EOI
      stdin:2:7: error: only single-word tags allowed
      EOE
  }

  : description-file
  :
  {
    : absolute-path
    :
    $* <<EOI 2>>~%EOE% != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      description-file: /README
      EOI
      %(
      stdin:6:19: error: package description-file path is absolute
      %|
      stdin:6:19: error: invalid package description file: invalid filesystem path
      %)
      EOE
  }

  : description-type
  :
  {
    : absent
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      description: libfoo is a very modern C++ XML parser.
      EOF

    : not-text
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      description: libfoo is a very modern C++ XML parser.
      description-type: image/gif
      EOI
      stdin:7:19: error: invalid package description type: text type expected
      EOE

    : deducing
    :
    {
      : fail
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: libfoo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        description-file: README.rtf
        EOI
        stdin:6:19: error: invalid package description file: unknown text type
        EOE

      : ignore-unknown
      :
      $* -i <<EOF >>EOF
        : 1
        name: libfoo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        description-file: README.rtf
        EOF
    }

    : unknown
    :
    {
      : fail
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: libfoo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        description: libfoo is a very modern C++ XML parser.
        description-type: text/markdowns
        EOI
        stdin:7:19: error: invalid package description type: unknown text type
        EOE

      : ignore
      :
      $* -i <<EOF >>EOF
        : 1
        name: libfoo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        description: libfoo is a very modern C++ XML parser.
        description-type: text/markdowns
        EOF
    }

    : plain
    :
    {
      : valid
      :
      $* <<EOF >>EOF
        : 1
        name: libfoo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        description: libfoo is a very modern C++ XML parser.
        description-type: text/plain
        EOF

      : invalid
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: libfoo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        description: libfoo is a very modern C++ XML parser.
        description-type: text/plain;
        EOI
        stdin:7:19: error: invalid package description type: missing '='
        EOE
    }

    : markdown
    :
    {
      : default
      :
      $* <<EOF >>EOF
        : 1
        name: libfoo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        description: libfoo is a very modern C++ XML parser.
        description-type: text/markdown
        EOF

      : gfm
      :
      $* <<EOF >>EOF
        : 1
        name: libfoo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        description: libfoo is a very modern C++ XML parser.
        description-type: text/markdown; variant=GFM
        EOF

      : common-mark
      :
      $* <<EOF >>EOF
        : 1
        name: libfoo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        description: libfoo is a very modern C++ XML parser.
        description-type: text/markdown; variant=CommonMark
        EOF

      : invalid-variant
      :
      {
        : fail
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: libfoo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          description: libfoo is a very modern C++ XML parser.
          description-type: text/markdown; variant=Original
          EOI
          stdin:7:19: error: invalid package description type: unknown text type
          EOE

        : ignore
        :
        $* -i <<EOF >>EOF
          : 1
          name: libfoo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          description: libfoo is a very modern C++ XML parser.
          description-type: text/markdown; variant=Original
          EOF
      }

      : invalid-parameter
      :
      {
        : fail
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: libfoo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          description: libfoo is a very modern C++ XML parser.
          description-type: text/markdown; variants=GFM
          EOI
          stdin:7:19: error: invalid package description type: unknown text type
          EOE

        : ignore
        :
        $* -i <<EOF >>EOF
          : 1
          name: libfoo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          description: libfoo is a very modern C++ XML parser.
          description-type: text/markdown; variants=GFM
          EOF
      }
    }
  }

  : src-url
  :
  {
    : no-scheme
    :
    $* <<EOI 2>>EOE != 0
      : 1
      src-url: libfoo
      EOI
      stdin:2:10: error: invalid src url: no scheme
      EOE

    : rootless
    :
    $* <<EOI 2>>EOE != 0
      : 1
      src-url: pkcs11:libfoo
      EOI
      stdin:2:10: error: invalid src url: rootless URL
      EOE

    : local
    :
    $* <<EOI 2>>EOE != 0
      : 1
      src-url: file:/libfoo/bar
      EOI
      stdin:2:10: error: invalid src url: local URL
      EOE

    : authority-absent
    :
    $* <<EOI 2>>EOE != 0
      : 1
      src-url: http:/libfoo/bar
      EOI
      stdin:2:10: error: invalid src url: no authority
      EOE

    : authority-empty
    :
    $* <<EOI 2>>EOE != 0
      : 1
      src-url: http:///libfoo/bar
      EOI
      stdin:2:10: error: invalid src url: no authority
      EOE
  }

  : builds
  :
  {
    : empty
    :
    $* <<EOI 2>"stdin:2:9: error: invalid package builds: class expression separator ':' expected" != 0
      : 1
      builds: default -gcc
      EOI
  }

  : build-config
  :
  {
    : multiple
    :
    {
      $* <<EOF >>EOF
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        bar-build-config: config.foo.bar = true; Bar.
        bar-builds: all
        baz-build-config: config.foo.baz = true; Baz.
        EOF
    }

    : empty
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      network-build-config: ; None.
      EOF

    : undefined
    :
    {
      $* <<EOF >>EOF
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        bar-builds: default
        baz-build-config: config.foo.bar = true
        EOF
    }

    : redefinition
    :
    {
      $* <<EOI 2>"stdin:3:1: error: build configuration redefinition" != 0
        : 1
        bar-build-config: config.foo.bar = true
        bar-build-config: config.foo.bar = true
        EOI
    }

    : unexpected-underlying-class-set
    :
    {
      $* <<EOI 2>"stdin:4:13: error: invalid package builds: unexpected underlying class set" != 0
        : 1
        bar-build-config: config.foo.bar = true
        bar-builds: all
        bar-builds: all
        EOI
    }
  }

  : distribution
  :
  {
    : incomplete
    :
    {
      $* <<EOF >>EOF
        : 1
        name: libcrypto
        version: 1.1.1+18
        upstream-version: 1.1.1n
        summary: C library providing general cryptography and X.509 support
        license: OpenSSL
        debian-name: libssl1.1 libssl-dev
        debian-version: 1.1.1n
        debian-to-downstream-version: /([^.])\.([^.])\.([^.])n/\1.\2.\3+18/
        debian-to-downstream-version: /([^.])\.([^.])\.([^.])o/\1.\2.\3+19/
        debian-to-downstream-version: /([^.])\.([^.])\.([^.])p/\1.\2.\3+20/
        fedora-name: openssl-libs openssl-devel
        fedora-version: $
        EOF
    }

    : complete
    :
    {
      $* -c <<EOI >>EOO
        : 1
        name: libcrypto
        version: +2-1.1.1-a.1+2
        upstream-version: 1.1.1n
        summary: C library providing general cryptography and X.509 support
        license: OpenSSL
        fedora-name: openssl-libs openssl-devel
        fedora-version: $
        fedora-to-downstream-version: $
        EOI
        : 1
        name: libcrypto
        version: +2-1.1.1-a.1+2
        upstream-version: 1.1.1n
        summary: C library providing general cryptography and X.509 support
        license: OpenSSL
        fedora-name: openssl-libs openssl-devel
        fedora-version: 1.1.1
        fedora-to-downstream-version: $
        EOO
    }

    : multiple-names
    :
    {
      $* <<EOO >>EOO
        : 1
        name: libcrypto
        version: 1.1.1+18
        upstream-version: 1.1.1n
        summary: C library providing general cryptography and X.509 support
        license: OpenSSL
        debian-name: libcurl4 libcurl4-doc libcurl4-openssl-dev
        debian-name: libcurl3-gnutls libcurl4-gnutls-dev
        EOO
    }

    : dash-in-name
    :
    {
      $* <<EOI 2>>EOE != 0
        : 1
        name: libcrypto
        version: 1.1.1+18
        upstream-version: 1.1.1n
        summary: C library providing general cryptography and X.509 support
        license: OpenSSL
        de-bian-name: libssl1.1 libssl-dev
        EOI
        stdin:7:1: error: distribution name 'de-bian' contains '-'
        EOE
    }

    : empty-value
    :
    {
      $* <<EOI 2>>EOE != 0
        : 1
        name: libcrypto
        version: 1.1.1+18
        upstream-version: 1.1.1n
        summary: C library providing general cryptography and X.509 support
        license: OpenSSL
        debian-name:
        EOI
        stdin:7:13: error: empty package distribution value
        EOE
    }
  }

  : depends
  :
  {
    : short-name
    :
    $* <<EOI 2>'stdin:6:10: error: invalid package name: length is less than two characters' != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      depends: b
      EOI

    : invalid-version-range
    :
    $* -c <<EOI 2>"stdin:6:10: error: invalid package constraint '[\$ 1.0.0]': min version is greater than max version" != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      depends: bar [$ 1.0.0]
      EOI

    : corner-case
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      depends: bar [1.0.0+2 1.0.0]
      EOF

    : complete
    :
    {
      test.options += -c

      : final
      :
      $* <<EOI >>EOO
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        depends: bar == $ | libbaz ~$ | libbox ^$ | libfox [1.0 $)
        EOI
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        depends: bar == 2.0.0 | libbaz ~2.0.0 | libbox ^2.0.0 | libfox [1.0 2.0.0)
        EOO

      : non-standard
      :
      $* <<EOI >>EOO
        : 1
        name: foo
        version: 2.0.0-x
        summary: Modern C++ parser
        license: LGPLv2
        depends: bar == $ | libfox [1.0 $)
        EOI
        : 1
        name: foo
        version: 2.0.0-x
        summary: Modern C++ parser
        license: LGPLv2
        depends: bar == 2.0.0-x | libfox [1.0 2.0.0-x)
        EOO

      : non-standard-shortcut
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0-x
        summary: Modern C++ parser
        license: LGPLv2
        depends: bar ~$
        EOI
        stdin:6:10: error: invalid package constraint '~$': dependent version is not standard
        EOE

      : latest-snapshot
      :
      $* <<EOI >>EOO
        : 1
        name: foo
        version: 2.0.0-a.0.z
        summary: Modern C++ parser
        license: LGPLv2
        depends: bar == $ | libbaz ~$ | libbox ^$ | libfox [1.0 $)
        EOI
        : 1
        name: foo
        version: 2.0.0-a.0.123
        summary: Modern C++ parser
        license: LGPLv2
        depends: bar == 2.0.0-a.0.123 | libbaz [2.0.0-a.0.1 2.0.0-a.1) | libbox\
         [2.0.0-a.0.1 2.0.0-a.1) | libfox [1.0 2.0.0-a.0.123)
        EOO
    }

    : incomplete
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      depends: bar == $ | libbaz ~$ | libbox ^$ | libfox [1.0 $)
      EOF

    : single-line
    :
    {
      : curly-braces
      :
      {
        : multiple-dependencies
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: {bar ^1.0.0 baz [1.0.0 1.3.0-) libfoo}
          EOF

        : common-version-constraint
        :
        {
          : valid
          :
          $* <<EOI >>EOO
            : 1
            name: foo
            version: 2.0.0
            summary: Modern C++ parser
            license: LGPLv2
            depends: {bar ^1.0.0 libfoo} >= 2.0.0
            EOI
            : 1
            name: foo
            version: 2.0.0
            summary: Modern C++ parser
            license: LGPLv2
            depends: {bar ^1.0.0 libfoo >= 2.0.0}
            EOO

          : bad-operation
          :
          $* <<EOI 2>>EOE != 0
            : 1
            name: foo
            version: 2.0.0
            summary: Modern C++ parser
            license: LGPLv2
            depends: {bar ^1.0.0 libfoo} =+ 2.0.0
            EOI
            stdin:6:30: error: version constraint expected instead of '=+'
            EOE

          : bad-version
          :
          $* <<EOI 2>>EOE != 0
            : 1
            name: foo
            version: 2.0.0
            summary: Modern C++ parser
            license: LGPLv2
            depends: {bar ^1.0.0 libfoo} == 2-0-0
            EOI
            stdin:6:30: error: invalid version constraint: invalid version: unexpected '-' character position
            EOE
        }

        : unterminated
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: {bar ^1.0.0 libfoo
          EOI
          stdin:6:28: error: dependency or '}' expected
          EOE

        : missing
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar ^1.0.0 libfoo
          EOI
          stdin:6:21: error: config.foo.* variable assignment expected instead of <buildfile fragment>
          EOE
      }

      : no-curly-braces
      :
      {
        : dependency
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar == 1.0.0
          EOF

        : invalid-constraint
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar == 1-0-0
          EOI
          stdin:6:10: error: invalid package constraint: invalid version: unexpected '-' character position
          EOE
      }

      : enable-condition
      :
      {
        : no-version-constraint
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar ? ($cxx.target.class == 'windows')
          EOF

        : version-constraint
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar == 1.0.0 ? ($cxx.target.class == 'windows')
          EOF

        : missed-dependency
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: ? ($cxx.target.class == 'windows')
          EOI
          stdin:6:10: error: dependency expected instead of '?'
          EOE

        : multiple-dependencies
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: {bar ^1.0.0 libfoo} ? ($cxx.target.class == 'windows')
          EOF

        : multiple-alternatives
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: {bar ^1.0.0 libfoo} ? ($cxx.target.class == 'windows') | baz
          EOF

        : empty
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar ? ()
          EOI
          stdin:6:17: error: condition expected
          EOE

        : unterminated1
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar ? ($cxx.target.class == 'windows'
          EOI
          stdin:6:47: error: unterminated evaluation context
          EOE

        : unterminated2
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar ? ($cxx.target.class == 'windows' | baz
          EOI
          stdin:6:53: error: unterminated evaluation context
          EOE
      }

      : reflect
      :
      {
        : no-version-constraint
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar config.foo.bar=true
          EOF

        : version-constraint
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar == 1.0.0 config.foo.bar=true
          EOF

        : multiple-dependencies
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: {bar ^1.0.0 libfoo} config.foo.bar=true
          EOF

        : enable-condition
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar ? ($cxx.target.class == 'windows') config.foo.bar=true
          EOF

        : multiple-alternatives
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar ? ($cxx.target.class == 'windows') config.foo.bar=true | baz
          EOF

        : expected-config
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar baz config.foo.bar=true
          EOI
          stdin:6:14: error: config.foo.* variable assignment expected instead of <buildfile fragment>
          EOE
      }

      : comments
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        depends:\
        bar
        {
          require
          {
            config.bar.frame=4016
            config.bar.timeout=10
          }
        } |
        {bar # Error.
        \
        EOI
        stdin:15:6: error: invalid package name: length is less than two characters
        EOE
    }

    : multi-line
    :
    {
      : surrounding-newlines
      :
      $* <<EOI >>EOO
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        depends:
        \
        *

        bar

        ;
        Comment.
        \
        EOI
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        depends: * bar; Comment.
        EOO

      : enable-clause
      :
      {
        : single-line
        :
        $* <<EOI >>EOO
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:
          \
          bar
          {
            enable ($cxx.target.class == 'windows')
          }
          \
          EOI
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends: bar ? ($cxx.target.class == 'windows')
          EOO

        : empty
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:
          \
          bar
          {
            enable ()
          }
          \
          EOI
          stdin:10:11: error: condition expected
          EOE

        : inline-enable
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:
          \
          bar ? ($windows)
          {
            enable ($windows)
          }
          \
          EOI
          stdin:9:1: error: multi-line dependency form with inline enable clause
          EOE

        : unterminated
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:
          \
          bar
          {
            enable ($cxx.target.class == 'windows'
          }
          \
          EOI
          stdin:10:41: error: unterminated evaluation context
          EOE
      }

      : prefer-clause
      :
      {
        : accept-clause
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            prefer
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }

            accept ($config.bar.frame >= 1024 && config.bar.timeout < 20)
          }
          \
          EOF


        : empty
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            prefer
            {
            }

            accept (true)
          }
          \
          EOF

        : no-accept-clause
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            prefer
            {
              config.bar.frame=4016
            }
          }
          \
          EOI
          stdin:13:1: error: accept clause expected instead of '}'
          EOE

        : enable-clause
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            enable ($cxx.target.class == 'windows')

            prefer
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }

            accept ($config.bar.frame >= 1024 && config.bar.timeout < 20)
          }
          \
          EOF

        : wrong-order
        :
        $* <<EOF 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            prefer
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }

            accept ($config.bar.frame >= 1024 && config.bar.timeout < 20)

            enable ($cxx.target.class == 'windows')
          }
          \
          EOF
          stdin:17:3: error: enable clause should precede prefer clause
          EOE

        : require-clause
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            prefer
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }

            accept ($config.bar.frame >= 1024 && config.bar.timeout < 20)

            require
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }
          }
          \
          EOI
          stdin:17:3: error: require and prefer clauses are mutually exclusive
          EOE
      }

      : require-clause
      :
      {
        : valid
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            require
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }
          }
          \
          EOF

        : enable-clause
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            enable ($cxx.target.class == 'windows')

            require
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }
          }
          \
          EOF

        : prefer-clause
        :
        $* <<EOF 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            require
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }

            prefer
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }
          }
          \
          EOF
          stdin:15:3: error: prefer and require clauses are mutually exclusive
          EOE

        : unescaped-semicolon
        :
        $* <<EOF 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            require
            {
              config.bar.baz=a
          ;
            }
          }
          \
          EOF
          stdin:11:21: error: unterminated buildfile block
          EOE

        : huge
        :
        $* -l <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            require
            {
              # @@ Version tagging? See
              #    upstream/qtbase/src/corelib/global/minimum-linux{.S,_p.h},
              #    global/qversiontagging.cpp, and QtCore.version (linker version script) in
              #    the upstream build.
              #
              #    Precompiled headers?

              intf_libs = # Interface dependencies.
              import impl_libs  = libicuuc%lib{icuuc}
              import impl_libs += libicui18n%lib{icui18n}
              import impl_libs += libpcre2%lib{pcre2-16}
              import impl_libs += libtinycbor%lib{tinycbor}
              import impl_libs += libz%lib{z}

              import! [metadata] moc = Qt5Moc%exe{qt5moc}

              windows = ($cxx.target.class  == 'windows')
              unix    = ($cxx.target.class  != 'windows')
              linux   = ($cxx.target.class  == 'linux')
              freebsd = ($cxx.target.system == 'freebsd')
              openbsd = ($cxx.target.system == 'openbsd')
              netbsd  = ($cxx.target.system == 'netbsd')
              bsd     = ($cxx.target.class  == 'bsd')
              macos   = ($cxx.target.class  == 'macos')

              x86 = ($cxx.target.cpu == 'x86_64' || $cxx.target.cpu == 'i686')

              # True if the CPU and compiler support the F16C instructions. F16C has been
              # supported since Intel's Ivy Bridge (2012) and AMD's Bulldozer (2011). Added
              # to GCC 4.6.4 (2013) at the latest, so assume it's supported on all i686 and
              # x86_64 compilers.
              #
              f16c = $x86

              # Source files.
              #
              src = animation/qabstractanimation              \\
                    animation/qvariantanimation               \\
                    animation/qpropertyanimation              \\
                    animation/qanimationgroup                 \\
                    animation/qsequentialanimationgroup       \\
                    animation/qparallelanimationgroup         \\
                    animation/qpauseanimation                 \\
                    codecs/qicucodec                          \\
                    codecs/qisciicodec                        \\
                    codecs/qlatincodec                        \\
                    codecs/qsimplecodec                       \\
                    codecs/qtextcodec                         \\
                    codecs/qtsciicodec                        \\
                    codecs/qutfcodec                          \\
                    global/archdetect                         \\
                    global/qendian                            \\
                    global/qglobal                            \\
                    global/qlibraryinfo                       \\
                    global/qmalloc                            \\
                    global/qnumeric                           \\
                    global/qfloat16                           \\
                    global/qoperatingsystemversion            \\
                    global/qlogging                           \\
                    global/qrandom                            \\
                    global/qhooks                             \\
                    io/qabstractfileengine                    \\
                    io/qbuffer                                \\
                    io/qdataurl                               \\
                    io/qtldurl                                \\
                    io/qdebug                                 \\
                    io/qdir                                   \\
                    io/qdiriterator                           \\
                    io/qfile                                  \\
                    io/qfiledevice                            \\
                    io/qfileinfo                              \\
                    io/qfilesystemwatcher                     \\
                    io/qfilesystemwatcher_polling             \\
                    io/qipaddress                             \\
                    io/qiodevice                              \\
                    io/qlockfile                              \\
                    io/qnoncontiguousbytedevice               \\
                    io/qprocess                               \\
                    io/qsettings                              \\
                    io/qstorageinfo                           \\
                    io/qtemporarydir                          \\
                    io/qtemporaryfile                         \\
                    io/qresource                              \\
                    io/qresource_iterator                     \\
                    io/qsavefile                              \\
                    io/qstandardpaths                         \\
                    io/qurl                                   \\
                    io/qurlidna                               \\
                    io/qurlquery                              \\
                    io/qurlrecode                             \\
                    io/qfsfileengine                          \\
                    io/qfsfileengine_iterator                 \\
                    io/qfilesystementry                       \\
                    io/qfilesystemengine                      \\
                    io/qfileselector                          \\
                    io/qloggingcategory                       \\
                    io/qloggingregistry                       \\
                    itemmodels/qabstractitemmodel             \\
                    itemmodels/qabstractproxymodel            \\
                    itemmodels/qconcatenatetablesproxymodel   \\
                    itemmodels/qidentityproxymodel            \\
                    itemmodels/qitemselectionmodel            \\
                    itemmodels/qsortfilterproxymodel          \\
                    itemmodels/qstringlistmodel               \\
                    itemmodels/qtransposeproxymodel           \\
                    kernel/qabstracteventdispatcher           \\
                    kernel/qabstractnativeeventfilter         \\
                    kernel/qbasictimer                        \\
                    kernel/qcoreapplication                   \\
                    kernel/qcoreevent                         \\
                    kernel/qcoreglobaldata                    \\
                    kernel/qdeadlinetimer                     \\
                    kernel/qelapsedtimer                      \\
                    kernel/qeventloop                         \\
                    kernel/qmetaobject                        \\
                    kernel/qmetaobjectbuilder                 \\
                    kernel/qmetatype                          \\
                    kernel/qmath                              \\
                    kernel/qmimedata                          \\
                    kernel/qobject                            \\
                    kernel/qobjectcleanuphandler              \\
                    kernel/qpointer                           \\
                    kernel/qsharedmemory                      \\
                    kernel/qsignalmapper                      \\
                    kernel/qsocketnotifier                    \\
                    kernel/qsystemerror                       \\
                    kernel/qsystemsemaphore                   \\
                    kernel/qtestsupport_core                  \\
                    kernel/qtimer                             \\
                    kernel/qtranslator                        \\
                    kernel/qvariant                           \\
                    mimetypes/qmimedatabase                   \\
                    mimetypes/qmimetype                       \\
                    mimetypes/qmimemagicrulematcher           \\
                    mimetypes/qmimetypeparser                 \\
                    mimetypes/qmimemagicrule                  \\
                    mimetypes/qmimeglobpattern                \\
                    mimetypes/qmimeprovider                   \\
                    plugin/qelfparser_p                       \\
                    plugin/qfactoryinterface                  \\
                    plugin/qfactoryloader                     \\
                    plugin/qlibrary                           \\
                    plugin/qmachparser                        \\
                    plugin/qpluginloader                      \\
                    plugin/quuid                              \\
                    serialization/qbinaryjson                 \\
                    serialization/qbinaryjsonarray            \\
                    serialization/qbinaryjsonobject           \\
                    serialization/qbinaryjsonvalue            \\
                    serialization/qcborcommon                 \\
                    serialization/qcbordiagnostic             \\
                    serialization/qcborstreamreader           \\
                    serialization/qcborstreamwriter           \\
                    serialization/qcborvalue                  \\
                    serialization/qdatastream                 \\
                    serialization/qjsoncbor                   \\
                    serialization/qjsondocument               \\
                    serialization/qjsonobject                 \\
                    serialization/qjsonarray                  \\
                    serialization/qjsonvalue                  \\
                    serialization/qjsonwriter                 \\
                    serialization/qjsonparser                 \\
                    serialization/qtextstream                 \\
                    serialization/qxmlstream                  \\
                    serialization/qxmlutils                   \\
                    statemachine/qstatemachine                \\
                    statemachine/qabstractstate               \\
                    statemachine/qeventtransition             \\
                    statemachine/qstate                       \\
                    statemachine/qfinalstate                  \\
                    statemachine/qhistorystate                \\
                    statemachine/qabstracttransition          \\
                    statemachine/qsignaltransition            \\
                    text/qbytearray                           \\
                    text/qbytearraylist                       \\
                    text/qbytearraymatcher                    \\
                    text/qcollator                            \\
                    text/qcollator_icu                        \\
                    text/qharfbuzz                            \\
                    text/qlocale                              \\
                    text/qlocale_icu                          \\
                    text/qlocale_tools                        \\
                    text/qregexp                              \\
                    text/qregularexpression                   \\
                    text/qstring                              \\
                    text/qstringbuilder                       \\
                    text/qstringlist                          \\
                    text/qstringview                          \\
                    text/qtextboundaryfinder                  \\
                    text/qunicodetools                        \\
                    text/qvsnprintf                           \\
                    thread/qatomic                            \\
                    thread/qexception                         \\
                    thread/qfutureinterface                   \\
                    thread/qfuturewatcher                     \\
                    thread/qmutex                             \\
                    thread/qreadwritelock                     \\
                    thread/qresultstore                       \\
                    thread/qrunnable                          \\
                    thread/qsemaphore                         \\
                    thread/qthread                            \\
                    thread/qthreadpool                        \\
                    thread/qthreadstorage                     \\
                    time/qdatetime                            \\
                    time/qdatetimeparser                      \\
                    time/qcalendar                            \\
                    time/qgregoriancalendar                   \\
                    time/qhijricalendar                       \\
                    time/qislamiccivilcalendar                \\
                    time/qjalalicalendar                      \\
                    time/qjuliancalendar                      \\
                    time/qmilankoviccalendar                  \\
                    time/qromancalendar                       \\
                    time/qtimezone                            \\
                    time/qtimezoneprivate                     \\
                    tools/qarraydata                          \\
                    tools/qbitarray                           \\
                    tools/qcommandlineoption                  \\
                    tools/qcommandlineparser                  \\
                    tools/qcryptographichash                  \\
                    tools/qeasingcurve                        \\
                    tools/qfreelist                           \\
                    tools/qhash                               \\
                    tools/qline                               \\
                    tools/qlinkedlist                         \\
                    tools/qlist                               \\
                    tools/qpoint                              \\
                    tools/qmap                                \\
                    tools/qmargins                            \\
                    tools/qmessageauthenticationcode          \\
                    tools/qcontiguouscache                    \\
                    tools/qrect                               \\
                    tools/qrefcount                           \\
                    tools/qringbuffer                         \\
                    tools/qshareddata                         \\
                    tools/qsharedpointer                      \\
                    tools/qsimd                               \\
                    tools/qsize                               \\
                    tools/qtimeline                           \\
                    tools/qversionnumber

              # Headers to be moc'ed.
              #
              moc_hdr = qabstracteventdispatcher              \\
                        qabstractanimation                    \\
                        qabstractitemmodel                    \\
                        qabstractproxymodel                   \\
                        qabstractstate                        \\
                        qabstracttransition                   \\
                        qanimationgroup                       \\
                        qbuffer                               \\
                        qcalendar                             \\
                        qcborcommon                           \\
                        qcborstreamreader                     \\
                        qcborvalue                            \\
                        qconcatenatetablesproxymodel          \\
                        qcoreapplication                      \\
                        qcoreevent                            \\
                        qcryptographichash                    \\
                        qeasingcurve                          \\
                        qeventloop                            \\
                        qeventtransition                      \\
                        qfile                                 \\
                        qfiledevice                           \\
                        qfileselector                         \\
                        qfilesystemwatcher                    \\
                        qfinalstate                           \\
                        qfuturewatcher                        \\
                        qhistorystate                         \\
                        qidentityproxymodel                   \\
                        qiodevice                             \\
                        qitemselectionmodel                   \\
                        qlocale                               \\
                        qlibrary                              \\
                        qmimedata                             \\
                        qmimetype                             \\
                        qnamespace                            \\
                        qobject                               \\
                        qobjectcleanuphandler                 \\
                        qparallelanimationgroup               \\
                        qpauseanimation                       \\
                        qpluginloader                         \\
                        qprocess                              \\
                        qpropertyanimation                    \\
                        qsavefile                             \\
                        qsequentialanimationgroup             \\
                        qsettings                             \\
                        qsignalmapper                         \\
                        qsignaltransition                     \\
                        qsharedmemory                         \\
                        qsocketnotifier                       \\
                        qsortfilterproxymodel                 \\
                        qstandardpaths                        \\
                        qstate                                \\
                        qstatemachine                         \\
                        qstringlistmodel                      \\
                        qtemporaryfile                        \\
                        qthread                               \\
                        qthreadpool                           \\
                        qtimeline                             \\
                        qtimer                                \\
                        qtranslator                           \\
                        qtransposeproxymodel                  \\
                        qvariantanimation                     \\
                        private/qabstractanimation_p          \\
                        private/qeventdispatcher_cf_p         \\
                        private/qeventdispatcher_unix_p       \\
                        private/qeventdispatcher_win_p        \\
                        private/qfactoryloader_p              \\
                        private/qfilesystemwatcher_fsevents_p \\
                        private/qfilesystemwatcher_inotify_p  \\
                        private/qfilesystemwatcher_kqueue_p   \\
                        private/qfilesystemwatcher_p          \\
                        private/qfilesystemwatcher_polling_p  \\
                        private/qfilesystemwatcher_win_p      \\
                        private/qnoncontiguousbytedevice_p    \\
                        private/qwindowspipereader_p          \\
                        private/qwindowspipewriter_p          \\
                        private/qtextstream_p

              # Source files to be moc'ed.
              #
              moc_src = io/qfilesystemwatcher_win     \\
                        kernel/qtimer                 \\
                        statemachine/qhistorystate    \\
                        statemachine/qstatemachine    \\
                        thread/qthreadpool

              moc_mm  = kernel/qeventdispatcher_cf

              # UNIX source files.
              #
              unix_src = io/forkfd_qt                         \\
                         io/qfsfileengine_unix                \\
                         io/qfilesystemengine_unix            \\
                         io/qlockfile_unix                    \\
                         io/qfilesystemiterator_unix          \\
                         io/qprocess_unix                     \\
                         kernel/qcore_unix                    \\
                         kernel/qeventdispatcher_unix         \\
                         kernel/qsharedmemory_posix           \\
                         kernel/qsharedmemory_systemv         \\
                         kernel/qsharedmemory_unix            \\
                         kernel/qsystemsemaphore_posix        \\
                         kernel/qsystemsemaphore_systemv      \\
                         kernel/qsystemsemaphore_unix         \\
                         kernel/qtimerinfo_unix               \\
                         plugin/qlibrary_unix                 \\
                         thread/qthread_unix                  \\
                         thread/qwaitcondition_unix

              # Linux source files.
              #
              linux_src = io/qfilesystemwatcher_inotify

              # Windows source files.
              #
              win_src = global/qoperatingsystemversion_win    \\
                        io/qfilesystemwatcher_win             \\
                        io/qprocess_win                       \\
                        io/qsettings_win                      \\
                        io/qfsfileengine_win                  \\
                        io/qlockfile_win                      \\
                        io/qfilesystemengine_win              \\
                        io/qfilesystemiterator_win            \\
                        io/qstandardpaths_win                 \\
                        io/qstorageinfo_win                   \\
                        io/qwindowspipereader                 \\
                        io/qwindowspipewriter                 \\
                        kernel/qcoreapplication_win           \\
                        kernel/qelapsedtimer_win              \\
                        kernel/qeventdispatcher_win           \\
                        kernel/qsharedmemory_win              \\
                        kernel/qsystemsemaphore_win           \\
                        kernel/qwineventnotifier              \\
                        kernel/qwinregistry                   \\
                        plugin/qsystemlibrary                 \\
                        plugin/qlibrary_win                   \\
                        text/qlocale_win                      \\
                        thread/qthread_win                    \\
                        thread/qwaitcondition_win

              # Mac OS source files.
              #
              macos_src = io/qsettings_mac            \\
                          io/qstorageinfo_mac         \\
                          kernel/qcfsocketnotifier    \\
                          kernel/qcoreapplication_mac \\
                          kernel/qelapsedtimer_mac

              # Define the Objective-C++ source file type.
              #
              define mm: file
              mm{*}: extension = mm

              macos_mm = global/qoperatingsystemversion_darwin        \\
                         io/qfilesystemengine_mac                     \\
                         io/qfilesystemwatcher_fsevents               \\
                         io/qprocess_darwin                           \\
                         io/qstandardpaths_mac                        \\
                         kernel/qcore_foundation                      \\
                         kernel/qcore_mac                             \\
                         kernel/qeventdispatcher_cf                   \\
                         text/qlocale_mac                             \\
                         time/qtimezoneprivate_mac

              # C sources from the Harfbuzz library.
              #
              # @@ Package this? (And double-conversion?)
              #
              harfbuzz_src = harfbuzz-buffer  \\
                             harfbuzz-gdef    \\
                             harfbuzz-gsub    \\
                             harfbuzz-gpos    \\
                             harfbuzz-impl    \\
                             harfbuzz-open    \\
                             harfbuzz-stream

              # Generated headers.
              #
              gen_hdr = qconfig       private/qconfig_p       \\
                        qtcore-config private/qtcore-config_p

              # Force headers that are included by C source files to be C headers otherwise
              # they are most likely to be detected as C++ headers due to being included
              # most often from C++ source files, which could break build2's header
              # dependency extraction.
              #
              c_hdr = qglobal qsystemdetection qprocessordetection qcompilerdetection \\
                      $gen_hdr

              # Headers, source files, and libraries.
              #
              lib{Qt5Core}: hxx{** -{$c_hdr} +Q*.} h{$c_hdr} cxx{$src}        \\
                            3rdparty/harfbuzz/src/h{harfbuzz}                 \\
                            3rdparty/harfbuzz/src/c{$harfbuzz_src}            \\
                            3rdparty/harfbuzz/src/cxx{harfbuzz-shaper-all}    \\
                            3rdparty/double-conversion/cxx{*.cc}              \\
                            3rdparty/double-conversion/hxx{**}

              # Ensure included source files are distributed.
              #
              # @@ thread/qmutex_{linux,unix,mac,win}.cpp is included by
              #        thread/qmutex.cpp, but thread/thread.pri adds it to SOURCES, meaning
              #        the upstream build should compile it as well (which would lead to
              #        multiple definition errors). This is confirmed by the fact that the
              #        makefile generated by `qmake
              #        upstream/qtbase/src/corelib/thread/thread.pri` has qmutex_linux.cpp
              #        in SOURCES.
              #
              #        However, the upstream build, when run, doesn't actually compile it,
              #        and its makefile doesn't have qmutex_linux.cpp in SOURCES either.
              #
              #        No idea what's going on but what we have here looks right and works
              #        and matches what the upstream build actually ends up doing.
              #
              # @@ mimetypes/qmimeprovider_database.cpp (note: ~2MB) is generated by
              #    mimetypes/mime/generate.{pl,bat} from
              #    mimetypes/mime/packages/freedesktop.org.xml which is from
              #    http://www.freedesktop.org/wiki/Software/shared-mime-info/. This doesn't
              #    seem like it should change often so perhaps it's not necessary for us to
              #    generate it?
              #
              lib{Qt5Core}: cxx{** -{$src}}                                                   \\
                            3rdparty/{h hxx c cxx}{** -harfbuzz/**}                           \\
                            3rdparty/harfbuzz/{cxx c}{**                                      \\
                                                      -harfbuzz-shaper-all -{$harfbuzz_src}}  \\
                            3rdparty/harfbuzz/h{** -harfbuzz}                                 \\
                            3rdparty/sha3/file{**.macros}                                     \\
                            testlib/3rdparty/h{valgrind_p}:                                   \\
                include = adhoc

              # The "metadata library": its purpose is to make sure all the imported
              # libraries are resolved for the ad hoc .mm compilation rules below.
              #
              # @@ Using cxx{dummy} as link rule hint (added `using c` recently).
              #
              libul{Qt5CoreMeta}: mkspecs/features/data/cxx{dummy} $impl_libs $intf_libs

              # Generated headers and source files.
              #
              lib{Qt5Core}: global/cxx{qconfig-install}: for_install = true
              lib{Qt5Core}: global/cxx{qconfig-develop}: for_install = false

              # Platform-specific source files.
              #
              lib{Qt5Core}: cxx{$unix_src}:  include = $unix
              lib{Qt5Core}: cxx{$linux_src}: include = $linux
              lib{Qt5Core}: cxx{$win_src}:   include = $windows
              lib{Qt5Core}: cxx{$macos_src}: include = $macos
              lib{Qt5Core}: cxx{io/qfilesystemwatcher_kqueue}: include = $bsd
              lib{Qt5Core}: cxx{io/qstandardpaths_unix        \\
                                io/qstorageinfo_unix          \\
                                kernel/qelapsedtimer_unix     \\
                                text/qlocale_unix             \\
                                time/qtimezoneprivate_tz}:  include = ($unix && ! $macos)
              lib{Qt5Core}: cxx{time/qtimezoneprivate_icu}: include = (! $macos)

              # Declare the dependency of the library target on the Objective-C++ source
              # files via the corresponding object files.
              #
              for n: $macos_mm
              {
                obja{$(n).a.o}: mm{$n}
                objs{$(n).so.o}: mm{$n}
              }

              liba{Qt5Core}: obja{$regex.apply($macos_mm,'(.+)','\1.a.o')}: \\
                include = $macos
              libs{Qt5Core}: objs{$regex.apply($macos_mm,'(.+)','\1.so.o')}: \\
                include = $macos

              # Rules for compiling Objective-C++ source files into object files.
              #
              # Note: these rules are only used on Mac OS (so no -fPIC, etc).
              # Note: exclude libua{Qt5CoreMeta} from update during match not to mess
              #       up its for-install'ness.
              #
              obja{~'/(.*).a/'}: mm{~'/\1/'} libua{Qt5CoreMeta}
              {{
                dep_poptions = $cxx.lib_poptions(libua{Qt5CoreMeta}, obja)
                depdb hash $dep_poptions
                depdb dyndep "-I$out_root/QtCore" "-I$src_root/QtCore"                \\
                             --what=header --default-type=h                           \\
                             --update-exclude libua{Qt5CoreMeta}                      \\
                             -- $cxx.path $cc.poptions $cxx.poptions $dep_poptions    \\
                                $cc.coptions $cxx.coptions $cxx.mode -M -MG $path($<[0])
                diag obj-c++ ($<[0])
                $cxx.path $cc.poptions $cxx.poptions $dep_poptions    \\
                          $cc.coptions $cxx.coptions $cxx.mode        \\
                          -o $path($>) -c -x objective-c++ $path($<[0])
              }}

              objs{~'/(.*).so/'}: mm{~'/\1/'} libus{Qt5CoreMeta}
              {{
                dep_poptions = $cxx.lib_poptions(libus{Qt5CoreMeta}, objs)
                depdb hash $dep_poptions
                depdb dyndep "-I$out_root/QtCore" "-I$src_root/QtCore"                \\
                             --what=header --default-type=h                           \\
                             --update-exclude libus{Qt5CoreMeta}                      \\
                             -- $cxx.path $cc.poptions $cxx.poptions $dep_poptions    \\
                                $cc.coptions $cxx.coptions $cxx.mode -M -MG $path($<[0])
                diag obj-c++ ($<[0])
                $cxx.path $cc.poptions $cxx.poptions $dep_poptions    \\
                          $cc.coptions $cxx.coptions $cxx.mode        \\
                          -o $path($>) -c -x objective-c++ $path($<[0])
              }}

              # Rule to generate a header with C++ compiler's predefined macros. It is used
              # to make them available to moc.
              #
              # This is necessary because moc's (built-in) preprocessor evaluates conditions
              # and expands macros and thus the set of defined macros can affect its
              # output. For example, signals and/or slots can be defined conditionally.
              #
              # Not all compilers have a mode that produces such a macro list. GCC, Clang,
              # and the Intel compiler do, but MSVC (for one) does not.
              #
              # The upstream build does not generate this header unless the compiler
              # supports such a mode (that is, moc gets no macro definitions at all). The
              # only exception is MSVC in which case Qt5 uses qmake to produce the required
              # output (by passing /Bx<path-to-qmake> to cl.exe, specifying an alternative
              # preprocessor executable), and Qt6 (via CMake) does nothing except for adding
              # the WIN32 macro to moc's definitions. We emulate the Qt6 behavior here for
              # now.
              #
              # Note also that this approach is not limited to the Qt libraries themselves:
              # applications may have preprocessor directives that affect the moc output and
              # thus will either need to do something similar or supply the necessary macro
              # definitions manually. As a result, it may make sense to provide a utility
              # (probably as part of the moc package, maybe call it moc-predefs) that knows
              # how to extract this list for various compilers (we could just pass to it the
              # compiler id and maybe the target followed by the compiler command line and
              # it can decide on the best method, potentially invoking the compiler,
              # including for MSVC).
              #
              hxx{moc_predefs}: mkspecs/features/data/cxx{dummy}
              %
              if ($cxx.id != 'msvc')
              {{
                diag gen ($>[0])
                $cxx.path $cc.poptions $cxx.poptions $cc.coptions $cxx.coptions $cxx.mode \\
                          -o $path($>) -dM -E $path($<)
              }}
              else
              {{
                diag gen ($>[0])
                cat <<EOI >$path($>)
                #define _WIN32
                #define WIN32
                EOI
              }}

              # Dependencies involving source files generated by moc from headers.
              #
              # @@ Have to list hxx{moc_predefs} here to make dist work -- why?
              #
              #    @@ Is this comment still relevant? moc_predefs is now only a
              #       dependency in the ad hoc rule below.
              #
              for s: hxx{$moc_hdr}
              {
                n = $name($s)
                lib{Qt5Core}: cxx{moc_$n}: include = adhoc
                cxx{moc_$n}: $s
              }

              # Target type for source file generated by moc from a source file.
              #
              define moc: cxx
              moc{*}: extension = moc

              # Dependencies involving source files generated by moc from source files.
              #
              for s: cxx{$moc_src} mm{$moc_mm}
              {
                n = $name($s)
                lib{Qt5Core}: moc{$n}: include = adhoc
                moc{$n}: $s
              }

              # Rule to run moc on a header file.
              #
              # Use -f to override the path moc uses to #include the input file, which is
              # relative to the output directory, with just the name of the input file.
              #
              # Explicitly list the generated headers as dependencies in case the
              # moc-generated file includes any of them (if only indirectly). Note that,
              # because moc's `--output-dep-file` mode (which produces a list of header
              # dependencies for the input file) silently omits non-existent headers from
              # its output, it does not support generated headers and thus there is no
              # choice but to declare these dependencies manually.
              #
              # Note that hxx{moc_predefs} must always be in position 1.
              #
              cxx{~'/moc_(.*)/'}: hxx{~'/\1/'} hxx{moc_predefs} h{$gen_hdr} $moc
              {{
                o = $path($>[0])
                t = $(o).t

                depdb dyndep \\
                  --byproduct --drop-cycles --what=header --default-type=h --file $t

                diag moc ($<[0])

                s = $path($<[0])

                $moc --include $path($<[1]) $cc.poptions $cxx.poptions -f $leaf($s) \\
                  --output-dep-file --dep-file-path $t -o $o $s
              }}

              # Rule to run moc on a source file.
              #
              # See the header-input moc rule regarding the header prerequisites.
              #
              moc{~'/(.*)/'}: cxx{~'/\1/'} hxx{moc_predefs} h{$gen_hdr} $moc
              {{
                o = $path($>[0])
                t = $(o).t

                depdb dyndep \\
                  --byproduct --drop-cycles --what=header --default-type=h --file $t

                diag moc ($<[0])

                s = $path($<[0])

                $moc --include $path($<[1]) $cc.poptions $cxx.poptions \\
                  --output-dep-file --dep-file-path $t -o $o $s
              }}

              # Rule to run moc on an Objective-C++ source file.
              #
              # See the header-input moc rule regarding the header prerequisites.
              #
              moc{~'/(.*)/'}: mm{~'/\1/'} hxx{moc_predefs} h{$gen_hdr} $moc
              {{
                o = $path($>[0])
                t = $(o).t

                depdb dyndep \\
                  --byproduct --drop-cycles --what=header --default-type=h --file $t

                diag moc ($<[0])

                s = $path($<[0])

                $moc --include $path($<[1]) $cc.poptions $cxx.poptions \\
                  --output-dep-file --dep-file-path $t -o $o $s
              }}

              # Ensure that a moc-generated target's moc-generated dependencies are updated
              # before it itself is updated. This is necessary because a moc target's
              # dependencies are extracted at the same time as it is updated.
              #
              # moc{foo} depends on cxx{moc_foo} because moc{foo} is generated from cxx{foo}
              # which includes cxx{moc_foo}. (Note that other generated dependencies common
              # to all moc-generated targets are declared above.)
              #
              moc{qeventdispatcher_cf}: cxx{moc_qeventdispatcher_cf_p}
              moc{qhistorystate}:       cxx{moc_qhistorystate}
              moc{qstatemachine}:       cxx{moc_qstatemachine}
              moc{qthreadpool}:         cxx{moc_qthreadpool}
              moc{qtimer}:              cxx{moc_qtimer}

              # A small minority of moc-generated files need to be compiled (most are
              # included). And that's not where the inconsistency ends:
              # qfilesystemwatcher_win.cpp includes qfilesystemwatcher_win.moc but not
              # moc_qfilesystemwatcher_win.cpp, so the latter has to be compiled.
              #
              lib{Qt5Core}: cxx{moc_qcalendar moc_qmimetype}

              lib{Qt5Core}: cxx{moc_qeventdispatcher_win_p    \\
                                moc_qfilesystemwatcher_win_p  \\
                                moc_qwindowspipereader_p      \\
                                moc_qwindowspipewriter_p}: include = $windows

              lib{Qt5Core}: cxx{moc_qfilesystemwatcher_kqueue_p}:   include = $bsd
              lib{Qt5Core}: cxx{moc_qfilesystemwatcher_fsevents_p}: include = $macos

              lib{Qt5Core}: libul{Qt5CoreMeta}

              # Generated headers.
              #
              # In the Qt source code the features (QT_FEATURE_foo macros) are checked using
              # the QT_CONFIG(foo) macro (defined in qglobal.h) which will not compile
              # unless the macro is defined and has a value of 1 or -1.
              #
              # @@ To find usage instances, grep under ../upstream/qtbase/ for
              #    '(qtConfig|QT_CONFIG)\(<feature-name>\)'
              #
              # The files qtbase/configure.json and qtbase/src/corelib/configure.json are
              # the sources used by qtbase/mkspecs/features/qt_configure.prf to generate
              # qtconfig{,_p}.h and qtcore-config{,_p}.h, respectively. Entries in the
              # `features` array in configure.json files correspond to .prf files under
              # upstream/qtbase/mkspecs/features/. See https://wiki.qt.io/Qt5_Build_System.
              #
              # The configure.json files declare dependencies between features so be sure to
              # consult them before disabling or enabling any features.
              #

              # General public configuration header. Included by other Qt libraries via
              # QtCore/qglobal.h.
              #
              # See the .in files for more information.
              #
              h{qconfig}: in{qconfig}
              {
                QT_VERSION_STR="$version.major.$version.minor.$version.patch"
                QT_VERSION_MAJOR="$version.major"
                QT_VERSION_MINOR="$version.minor"
                QT_VERSION_PATCH="$version.patch"

                QT_FEATURE_framework = ($macos ? 1 : -1)

                # Given that SSE4.2 support was added to GCC in version 4.3 (2008), and
                # AVX512 support in version 4.9 (2014), assume all versions of SSE and all
                # versions of AVX are supported on all i686 and x86_64 compilers. Disable
                # SSE and AVX on all other targets.
                #
                compiler_supports_sse_avx = ($x86 ? 1 : -1)

                QT_COMPILER_SUPPORTS_F16C = ($f16c ? 1 : -1)
              }

              # General private configuration header. Included by a few other Qt libraries
              # via QtCore/qglobal_p.h.
              #
              # See the .in file for more information.
              #
              private/h{qconfig_p}: private/in{qconfig_p}
              {
                QT_FEATURE_dlopen          = ($unix ? 1 : -1)
                QT_FEATURE_posix_fallocate = ($linux || $freebsd || $openbsd ? 1 : -1)
              }

              # Public QtCore library configuration (mostly high-level features). Included
              # by other Qt libraries via QtCore/qglobal.h.
              #
              # See the .in file for more information.
              #
              h{qtcore-config}: in{qtcore-config}

              # Private QtCore library configuration (lower-level features and
              # settings). Included by a few other Qt libraries via QtCore/qglobal_p.h.
              #
              # See the .in file for more information.
              #
              private/h{qtcore-config_p}: private/in{qtcore-config_p}
              {
                QT_FEATURE_futimens   = ($windows ? -1 : 1)
                QT_FEATURE_getauxval  = ($linux ? 1 : -1)
                QT_FEATURE_glibc      = ($linux ? 1 : -1)
                QT_FEATURE_inotify    = ($linux ? 1 : -1)
                QT_FEATURE_linkat     = ($linux ? 1 : -1)
                QT_FEATURE_syslog     = ($windows ? -1 : 1)

                QT_FEATURE_poll_select = -1
                QT_FEATURE_poll_ppoll  = ($linux || $freebsd || $openbsd ? 1 : -1)
                QT_FEATURE_poll_poll   = ($macos ? 1 : -1)
                QT_FEATURE_poll_pollts = ($netbsd ? 1 : -1)
              }

              # global/qconfig.cpp:
              #
              # This file provides information relating to installation paths. It is
              # included by global/qlibraryinfo.cpp (so we don't compile it). In upstream it
              # is generated during the configure step (qtbase/configure.pri).
              #
              # In order to support different installation paths for the installed and
              # uninstalled cases in build2 we turn qconfig.cpp into a real file (that is,
              # not generated) and turn its static variable and macro definitions into
              # extern variable declarations. Then we generate two source files,
              # qconfig-install.cpp and qconfig-develop.cpp, that define the variables to
              # values appropriate for the installed and uninstalled cases, respectively,
              # and we use (above) the `for_install` prerequisite-specific variable to
              # control which of the two gets linked in each case.
              #
              # See also comments in qconfig.cpp.in.
              #
              lib{Qt5Core}: global/cxx{qconfig}: include = adhoc

              # Installed case: Here the installation prefix is an absolute path and the
              # other paths are all relative (to the prefix).
              #
              # Note that while this object file should only be linked when we are
              # installing, it will be compiled even in the uninstalled case where we may
              # have no install.root.
              #
              global/cxx{qconfig-install}:
              {
                i = ($install.root != [null])

                # Values of the installation paths. Make the $install.* paths relative to
                # $install.root.
                #
                prefix       = [dir_path] ($i ? $install.root : .)
                doc          = [dir_path] ($i ? $leaf($install.resolve($install.doc), $prefix) : .)
                incl         = [dir_path] ($i ? $leaf($install.resolve($install.include), $prefix) : .)
                lib          = [dir_path] ($i ? $leaf($install.resolve($install.lib), $prefix) : .)
                bin          = [dir_path] ($i ? $leaf($install.resolve($install.bin), $prefix) : .)
                libexec      = [dir_path] ($i ? $leaf($install.resolve($windows ? $install.bin : $install.libexec), $prefix) : .)
                plugins      = [dir_path] $lib
                imports      = [dir_path] $lib
                qml          = [dir_path] $lib
                data         = [dir_path] ($i ? $leaf($install.resolve($install.data), $prefix) : .)
                arch_data    = [dir_path] $data
                translations = [dir_path] translations
                examples     = [dir_path] examples
                tests        = [dir_path] tests

                # A path appended to the path of the directory containing the installed
                # QtCore library to get to the prefix path.
                #
                # For example, if the prefix is /usr/local and the library is installed in
                # /usr/local/lib, upstream would do "/usr/local/lib" + "/" + "../" to get
                # "/usr/local".
                #
                lib_to_prefix = [dir_path] ($i ? $relative($prefix, $install.resolve($install.lib)) : .)
              }

              # Uninstalled case: Here the installation prefix is the filesystem root and
              # the other directories are all absolute paths (because the source and output
              # directories may not have a longer common prefix).
              #
              assert ($root_directory($out_root) == $root_directory($src_root)) \\
                "out_root and src_root must have common filesystem root"

              global/cxx{qconfig-develop}:
              {
                # Values of the installation paths.
                #
                prefix       = [dir_path] $root_directory($out_root)
                doc          = [dir_path] $out_root/doc
                incl         = [dir_path] $src_root
                lib          = [dir_path] $out_root
                libexec      = [dir_path] $out_root
                bin          = [dir_path] $out_root
                plugins      = [dir_path] $out_root/plugins
                imports      = [dir_path] $out_root
                qml          = [dir_path] $out_root
                arch_data    = [dir_path] $src_root
                data         = [dir_path] $src_root
                translations = [dir_path] $out_root/translations
                examples     = [dir_path] $src_root/examples
                tests        = [dir_path] $src_root/tests

                # See comment in the installed case above.
                #
                lib_to_prefix = [dir_path] $relative($prefix, $lib)
              }

              # Installed and uninstalled cases.
              #
              global/cxx{qconfig-install qconfig-develop}: global/in{qconfig}
              {
                # The directory path containing user application settings. Ignored on
                # Windows where the registry is used instead.
                #
                settingspath = ($macos ? /Library/Preferences/Qt : etc/xdg)

                # The offsets of the beginning of each substring within the
                # qt_configure_strs string which contains the installation path values
                # defined above.
                #
                o_doc            = [uint64] 0
                o_incl           = $size($doc)
                o_incl          += 1
                o_incl          += $o_doc
                o_lib            = $size($incl)
                o_lib           += 1
                o_lib           += $o_incl
                o_libexec        = $size($lib)
                o_libexec       += 1
                o_libexec       += $o_lib
                o_bin            = $size($libexec)
                o_bin           += 1
                o_bin           += $o_libexec
                o_plugins        = $size($bin)
                o_plugins       += 1
                o_plugins       += $o_bin
                o_imports        = $size($plugins)
                o_imports       += 1
                o_imports       += $o_plugins
                o_qml            = $size($imports)
                o_qml           += 1
                o_qml           += $o_imports
                o_arch_data      = $size($qml)
                o_arch_data     += 1
                o_arch_data     += $o_qml
                o_data           = $size($arch_data)
                o_data          += 1
                o_data          += $o_arch_data
                o_translations   = $size($data)
                o_translations  += 1
                o_translations  += $o_data
                o_examples       = $size($translations)
                o_examples      += 1
                o_examples      += $o_translations
                o_tests          = $size($examples)
                o_tests         += 1
                o_tests         += $o_examples

                # Escape backslashes on Windows. Note: must be done after offset
                # calculations.
                #
                prefix       = [dir_path] $regex.replace($prefix, '\\', '\\\\')
                doc          = [dir_path] $regex.replace($doc, '\\', '\\\\')
                incl         = [dir_path] $regex.replace($incl, '\\', '\\\\')
                lib          = [dir_path] $regex.replace($lib, '\\', '\\\\')
                libexec      = [dir_path] $regex.replace($libexec, '\\', '\\\\')
                bin          = [dir_path] $regex.replace($bin, '\\', '\\\\')
                plugins      = [dir_path] $regex.replace($plugins, '\\', '\\\\')
                imports      = [dir_path] $regex.replace($imports, '\\', '\\\\')
                qml          = [dir_path] $regex.replace($qml, '\\', '\\\\')
                arch_data    = [dir_path] $regex.replace($arch_data, '\\', '\\\\')
                data         = [dir_path] $regex.replace($data, '\\', '\\\\')
                translations = [dir_path] $regex.replace($translations, '\\', '\\\\')
                examples     = [dir_path] $regex.replace($examples, '\\', '\\\\')
                tests        = [dir_path] $regex.replace($tests, '\\', '\\\\')

                lib_to_prefix = [dir_path] $regex.replace($lib_to_prefix, '\\', '\\\\')
              }

              # Build options.
              #
              # Add QtCore/3rdparty/ for include of <double-conversion/fixed-dtoa.h> (in
              # double-conversion/fixed-dtoa.cc); QtCore/3rdparty/double-conversion/include/
              # for includes of <double-conversion/*>; QtCore/3rdparty/harfbuzz/src/ for an
              # include of <harfbuzz-shaper.h>; and QtCore/3rdparty/forkfd/ for an include
              # of <forkfd.h>.
              #
              cxx.poptions =+ "-I$out_root" "-I$src_root"                                     \\
                              "-I$out_root/QtCore" "-I$src_root/QtCore"                       \\
                              "-I$out_root/QtCore/private" "-I$src_root/QtCore/private"       \\
                              "-I$src_root/QtCore/3rdparty"                                   \\
                              "-I$src_root/QtCore/3rdparty/double-conversion/include"         \\
                              "-I$src_root/QtCore/3rdparty/harfbuzz/src"                      \\
                              "-I$src_root/QtCore/3rdparty/forkfd"

              cxx.poptions += -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB            \\
                              -DQT_NO_LINKED_LIST                             \\
                              -DQT_NO_JAVA_STYLE_ITERATORS                    \\
                              -DQT_NO_USING_NAMESPACE                         \\
                              -DQT_NO_FOREACH                                 \\
                              -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT        \\
                              -DQT_ASCII_CAST_WARNINGS                        \\
                              -DQT_MOC_COMPAT                                 \\
                              -DQT_USE_QSTRINGBUILDER                         \\
                              -DQT_DEPRECATED_WARNINGS                        \\
                              -D_REENTRANT                                    \\
                              -DQT_DEPRECATED_WARNINGS_SINCE=0x060000         \\
                              -DQT_NO_VERSION_TAGGING

              # @@ Are the hbmi* of any use?
              #
              {hbmia obja}{*}: cxx.poptions += -DQT_STATIC
              {hbmis objs}{*}: cxx.poptions += -DQT_SHARED

              # @@ TODO -DQT_NO_DEBUG (as one would expect, upstream defines it for release
              #    builds).
              #

              # Add platform-specific header directories, libraries, compilation options,
              # and macro definitions.
              #
              if $windows
              {
                cxx.poptions += -DQT_DISABLE_DEPRECATED_BEFORE=0x040800       \\
                                -D_CRT_SECURE_NO_WARNINGS                     \\
                                -D_USE_MATH_DEFINES                           \\
                                -DUNICODE                                     \\
                                -D_UNICODE                                    \\
                                -DWIN32
              }
              else
              {
                cxx.poptions += -DQT_DISABLE_DEPRECATED_BEFORE=0x050000       \\
                                -DQT_NO_CAST_TO_ASCII                         \\
                                -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
                # @@ TODO Boost only adds -ldl if on Linux.
                #
                lib{Qt5Core}: cxx.libs += -ldl
              }

              # @@ Not sure if/when this is necessary.
              #
              # cxx.libs += -latomic

              # libexecinfo is required for backtrace(3) on BSD (see global/qlogging.cpp).
              #
              # @@ When we did libboost-stacktrace we considered packaging libbacktrace:
              #    build2-packaging/boost/downstream/libs/stacktrace/src/buildfile.
              #
              if $bsd
                lib{Qt5Core}: cxx.libs += -lexecinfo

              # If the compiler is always generating F16C code (no special options
              # required), have global/qgloat16.cpp include global/qfloat16_f16c.c,
              # otherwise compile it separately. Details including the Clang exception are
              # explained in global/global.pri but see also the SSE/AVX comments in
              # qconfig.h.in.
              #
              # @@ Assuming the comments regarding special compiler options for
              #    SSE/AVX/NEON in qconfig.h.in apply to F16C as well. global/global.pri
              #    seems to make this connection as well (if only for GCC; x86SimdAlways in
              #    global.pri corresponds to QT_COMPILER_SUPPORTS_SIMD_ALWAYS in
              #    qconfig.h.in).
              #
              # @@ TODO This logic is probably not correct at the moment. qfloat16_f16c.c
              #    should be included if F16C code is generated without any special compiler
              #    options, but the upstream Qt6 build chose to compile it on my machine (in
              #    contradiction of the configure report) which contradicts the logic
              #    currently used in this buildfile.
              #
              if ($f16c && ! $regex.match($cxx.id, 'clang.*'))
              {
                lib{Qt5Core}: global/c{qfloat16_f16c}: include = false
                cxx.poptions += -DQFLOAT16_INCLUDE_FAST
              }
              else
              {
                lib{Qt5Core}: global/c{qfloat16_f16c}: include = true

                obj{global/qfloat16_f16c}:
                {
                  c.poptions += $cxx.poptions
                  c.coptions += -mf16c
                }
              }

              # Every directory under mkspecs/ contains a unique `qplatformdefs.h`.
              #
              # Note that Mac OS with GCC is not supported by upstream (see README-DEV for
              # details).
              #
              switch $cxx.target.class, $cxx.id, $cxx.target.system
              {
                case 'linux', 'gcc'
                  cxx.poptions += "-I$src_root/QtCore/mkspecs/linux-g++"
                case 'linux', 'clang'
                  cxx.poptions += "-I$src_root/QtCore/mkspecs/linux-clang"
                case 'macos', 'clang-apple'
                {
                  cxx.poptions += "-I$src_root/QtCore/mkspecs/macx-clang"
                  lib{Qt5Core}: cxx.libs += -framework AppKit                 \\
                                            -framework CoreServices           \\
                                            -framework DiskArbitration        \\
                                            -framework Foundation             \\
                                            -framework IOKit                  \\
                                            -framework Security
                }
                case 'bsd', 'clang', 'freebsd'
                  cxx.poptions += "-I$src_root/QtCore/mkspecs/freebsd-clang"
                case 'bsd', 'gcc', 'openbsd'
                  cxx.poptions += "-I$src_root/QtCore/mkspecs/openbsd-g++"
                case 'bsd', 'gcc', 'netbsd'
                  cxx.poptions += "-I$src_root/QtCore/mkspecs/netbsd-g++"
                case 'windows', 'msvc'
                {
                  cxx.poptions += "-I$src_root/QtCore/mkspecs/win32-msvc" \\
                                  -D_ENABLE_EXTENDED_ALIGNED_STORAGE

                  lib{Qt5Core}: cxx.libs += ole32.lib advapi32.lib shell32.lib        \\
                                            mpr.lib netapi32.lib userenv.lib          \\
                                            version.lib winmm.lib ws2_32.lib
                }
                case 'windows', 'msvc-clang' | 'clang'
                {
                  cxx.poptions += "-I$src_root/QtCore/mkspecs/win32-clang-msvc" \\
                                  -D_ENABLE_EXTENDED_ALIGNED_STORAGE

                  lib{Qt5Core}: cxx.libs += ole32.lib advapi32.lib shell32.lib        \\
                                            mpr.lib netapi32.lib userenv.lib          \\
                                            version.lib winmm.lib ws2_32.lib

                  # @@ The upstream build says it's only clang-cl that needs special
                  #    compiler options "for anything above SSE2" (see
                  #    mkspecs/win32-clang-msvc/qmake.conf) but plain clang does need
                  #    `-msse4.2` at least.
                  #
                  obj{tools/qhash}: cxx.coptions += -msse4.2
                }
                case 'windows', 'gcc', 'mingw32'
                {
                  cxx.poptions += "-I$src_root/QtCore/mkspecs/win32-g++" \\
                                  -DMINGW_HAS_SECURE_API=1
                  cxx.coptions += -fno-keep-inline-dllexport

                  lib{Qt5Core}: cxx.libs += -lole32 -ladvapi32 -lshell32 -lmpr        \\
                                            -lnetapi32 -luuid -luserenv -lversion     \\
                                            -lwinmm -lws2_32
                }
              }

              # Export options.
              #
              lib{Qt5Core}:
              {
                cxx.export.poptions = "-I$out_root" "-I$src_root"                     \\
                                      "-I$out_root/QtCore" "-I$src_root/QtCore"       \\
                                      -DQT_NO_VERSION_TAGGING
                cxx.export.libs = $intf_libs
              }

              liba{Qt5Core}: cxx.export.poptions += -DQT_STATIC
              libs{Qt5Core}: cxx.export.poptions += -DQT_SHARED

              # For pre-releases use the complete version to make sure they cannot be used
              # in place of another pre-release or the final version. See the version module
              # for details on the version.* variable values.
              #
              if $version.pre_release
                lib{Qt5Core}: bin.lib.version = "-$version.project_id"
              else
                lib{Qt5Core}: bin.lib.version = "-$version.major.$version.minor"

              # Install public headers into the QtCore/ subdirectory of, say, /usr/include/.
              #
              private/{hxx h}{*}: install = false
              {hxx h}{*}:
              {
                install = include/QtCore/
              }
            }
          }
          \
          EOF
      }

      : reflect-clause
      :
      {
        : valid
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            reflect
            {
              config.foo.bar=true
              config.foo.baz=false
            }
          }
          \
          EOF

        : enable-clause
        :
        $* <<EOF >>EOF
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            enable ($cxx.target.class == 'windows')

            reflect
            {
              config.foo.bar=true
              config.foo.baz=false
            }
          }
          \
          EOF

        : inline-reflect
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:
          \
          bar config.foo.bar=true
          {
            reflect
            {
              config.foo.bar=true
            }
          }
          \
          EOI
          stdin:9:1: error: multi-line dependency form with inline reflect clause
          EOE
      }

      : comments
      :
      {
        : single-line-separate
        :
        $* <<EOI >>EOO
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            # Configure bar.
            #
            require
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }
          }
          \
          EOI
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            require
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }
          }
          \
          EOO

        : single-line-trailing
        :
        $* <<EOI >>EOO
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            require # Configure bar.
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }
          }
          \
          EOI
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            require
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }
          }
          \
          EOO

        : multi-line
        :
        $* <<EOI >>EOO
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            #\\
            # Configure bar.
            #
            require
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }
            #\\

            prefer
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }

            accept ($config.bar.frame >= 1024 && config.bar.timeout < 20)
          }
          \
          EOI
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            prefer
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }

            accept ($config.bar.frame >= 1024 && config.bar.timeout < 20)
          }
          \
          EOO

        : multi-line-unterm
        :
        $* <<EOI 2>>EOE != 0
          : 1
          name: foo
          version: 2.0.0
          summary: Modern C++ parser
          license: LGPLv2
          depends:\
          bar
          {
            #\\
            # Configure bar.
            #
            require
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }

            prefer
            {
              config.bar.frame=4016
              config.bar.timeout=10
            }

            accept ($config.bar.frame >= 1024 && config.bar.timeout < 20)
          }
          \
          EOI
          stdin:25:2: error: unterminated multi-line comment
          EOE
      }
    }

    : multiple-alternatives
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      depends:\
      baz |
      bar
      {
        require
        {
          config.bar.frame=4016
        }
      }
      |
      box
      \
      EOF

    : newlines
    :
    $* <<EOI >>EOO
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      depends:\

      baz

      |

      bar

      \
      EOI
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      depends: baz | bar
      EOO

    : missed-alternative
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      depends: baz |
      EOI
      stdin:6:15: error: dependency expected
      EOE

    : missed-dependencies
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      depends:
      EOI
      stdin:6:9: error: dependency alternatives expected
      EOE

    : missed-dependencies-newline
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      depends:\

      \
      EOI
      stdin:7:1: error: dependency alternatives expected
      EOE
  }

  : requires
  :
  {
    : multiple-requirements
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      requires: {linux zlib >= 1.2.0}; Should already have it.
      EOF

    : enable-condition
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      requires: zlib >= 1.2.0 ? ($cxx.target.class == 'linux')
      EOF

    : multiple-alternatives
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      requires: * linux ? ($linux) | windows ? ($windows)
      EOF

    : enable-condition-reflect
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      requires: zlib >= 1.2.0 ? ($cxx.target.class == 'linux') config.foo.zlib=true
      EOF

    : enable-reflect-clauses
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      requires:\
      zlib >= 1.2.0
      {
        enable ($cxx.target.class == 'linux')

        reflect
        {
          config.foo.zlib=true
        }
      }
      \
      EOF

    : require-clause
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      requires:\
      libbar >= 1.2.0
      {
        require
        {
          config.libbar.frame=4016
        }
      }
      \
      EOI
      stdin:9:3: error: require clause is not permitted for requirements
      EOE

    : simple
    :
    {
      : comment
      :
      $* <<EOF >>EOF
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: ; X11 libs.
        EOF

      : no-comment
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires:
        EOI
        stdin:6:10: error: requirement or comment expected
        EOE

      : comment-multiline
      :
      $* <<EOI >>EOO
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires:\

        ;
        X11 libs.
        \
        EOI
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: ; X11 libs.
        EOO

      : condition
      :
      $* <<EOF >>EOF
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: ? ($windows); Only 64-bit.
        EOF

      : condition-no-comment
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: ? ($windows)
        EOI
        stdin:6:11: error: no comment specified for simple requirement
        EOE

      : no-condition
      :
      $* <<EOF >>EOF
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: ? ; VC 15 or later if targeting Windows.
        EOF

      : no-condition-no-comment
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: ?
        EOI
        stdin:6:11: error: no comment specified for simple requirement
        EOE

      : no-condition-multiple
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: ? | foo ; VC 15 or later if targeting Windows.
        EOI
        stdin:6:13: error: end of simple requirement expected
        EOE

      # @@ TMP Drop this test and uncomment the next one when toolchain 0.15.0
      #    is released (see dependency_alternatives_parser::parse_alternative()
      #    for details).
      #
      : old-fashioned
      :
      $* <<EOI >>EOO
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: ? vc15; VC 15 or later if targeting Windows.
        EOI
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: vc15 ? ; VC 15 or later if targeting Windows.
        EOO

      #\
      : reflect
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: ? config.foo.bar=true
        EOI
        stdin:6:13: error: end of simple requirement expected
        EOE
      #\

      : with-id
      :
      $* <<EOF >>EOF
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: x86_64 ? ; Only if on Windows.
        EOF

      : with-id-no-comment
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: x86_64 ?
        EOI
        stdin:6:11: error: no comment specified for simple requirement
        EOE

      : with-id-multiple
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: x86_64 ? | foo ; Only if on Windows.
        EOI
        stdin:6:20: error: end of simple requirement expected
        EOE

      : with-id-junk
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: x86_64 ? foo=bar | foo ; Only if on Windows.
        EOI
        stdin:6:20: error: end of simple requirement expected
        EOE

      : buildtime-no-condition
      :
      $* <<EOF >>EOF
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        requires: * ? ; VC 15 or later if targeting Windows.
        EOF
    }
  }

  : tests
  :
  {
    : short-name
    :
    $* <<EOI 2>'stdin:6:8: error: invalid package name: length is less than two characters' != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: b
      EOI

    : invalid-version-range-incomplete
    :
    $* -c <<EOI 2>"stdin:6:8: error: invalid package constraint '[\$ 1.0.0]': min version is greater than max version" != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: bar [$ 1.0.0]
      EOI

    : invalid-version-range
    :
    $* -c <<EOI 2>'stdin:6:8: error: invalid package constraint: min version is greater than max version' != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: bar [2.0.0 1.0.0]
      EOI

    : invalid-version
    :
    $* -c <<EOI 2>'stdin:6:8: error: invalid package constraint: invalid version: equal version endpoints are earliest' != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: bar == 2.0.0-
      EOI

    : no-name
    :
    $* <<EOI 2>'stdin:6:8: error: no package name specified' != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: *
      EOI

    : buildtime
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: * foo-tests
      EOF

    : complete
    :
    {
      test.options += -c

      : final
      :
      $* <<EOI >>EOO
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        tests: bar == $
        EOI
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        tests: bar == 2.0.0
        EOO

      : non-standard-shortcut
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0-x
        summary: Modern C++ parser
        license: LGPLv2
        tests: bar ~$
        EOI
        stdin:6:8: error: invalid package constraint '~$': dependent version is not standard
        EOE
    }

    : incomplete
    :
    $* <<EOF >>EOF
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: bar == $
      EOF

    : reflect
    :
    {
      : after-version-constraint
      :
      $* <<EOF >>EOF
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        tests: bar == 1.0.0 config.bar.test = foo
        EOF

      : no-version-constraint
      :
      $* <<EOF >>EOF
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        tests: bar config.bar.test = foo
        EOF

      : invalid-variable
      :
      $* <<EOI 2>>EOE != 0
        : 1
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        tests: bar config.foo.test = bar
        EOI
        stdin:6:8: error: config.bar.* variable assignment expected instead of <buildfile fragment>
        EOE
    }

    : newline
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests:\
      *
      bar
      \
      EOI
      stdin:7:1: error: unexpected <newline>
      EOE

    : no-package
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: *
      EOI
      stdin:6:8: error: no package name specified
      EOE

    : multiple-alternatives
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: bar | baz
      EOI
      stdin:6:8: error: unexpected '|'
      EOE

    : multiple-dependencies
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: {bar baz}
      EOI
      stdin:6:8: error: only single package allowed
      EOE

    : enable
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: foo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      tests: bar ? (windows)
      EOI
      stdin:6:8: error: unexpected enable clause
      EOE
  }

  : buildfile
  :
  {
    : standard-naming
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      bootstrap-build:\
      project = libfoo

      using version
      using config
      using dist
      using test
      using install
      \
      root-build:\
      include config/common.build

      cxx.std = latest

      using cxx
      \
      config/common-build:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      EOF

    : alt-naming
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      bootstrap-build2:\
      project = libfoo

      using version
      using config
      using dist
      using test
      using install
      \
      root-build2:\
      include config/common.build2

      cxx.std = latest

      using cxx
      \
      config/common-build2:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      EOF

    : mixed-naming
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      bootstrap-build:\
      project = libfoo

      using version
      using config
      using dist
      using test
      using install
      \
      root-build:\
      include config/common.build

      cxx.std = latest

      using cxx
      \
      config/common-build2:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      EOI
      stdin:22:1: error: standard buildfile naming scheme is already used
      EOE

    : backslash
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      config\common-build:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      EOI
      stdin:6:1: error: backslash in package buildfile path
      EOE

    : unknown
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      common.build:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      EOI
      stdin:6:1: error: unknown name 'common.build' in package manifest
      EOE

    : empty-name
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      config/-build:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      EOI
      stdin:6:1: error: empty package buildfile name
      EOE

    : absolute-invalid
    :
    $* <<EOI 2>>~%EOE% != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      /config/common-build:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      EOI
      %stdin:6:1: error: (absolute|invalid) package buildfile path%
      EOE

    : outside
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      common/../../common-build:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      EOI
      stdin:6:1: error: package buildfile path refers outside build/ subdirectory
      EOE

    : redefinition
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      common-build:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      common-build:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      EOI
      stdin:11:1: error: package buildfile redefinition
      EOE
  }

  : buildfile-path
  :
  {
    : standard-naming
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      bootstrap-build:\
      project = libfoo

      using version
      using config
      using dist
      using test
      using install
      \
      root-build:\
      include config/common.build
      include config/extra.build

      cxx.std = latest

      using cxx
      \
      config/common-build:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      build-file: config/extra.build
      EOF

    : alt-naming
    :
    $* <<EOF >>EOF
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      bootstrap-build2:\
      project = libfoo

      using version
      using config
      using dist
      using test
      using install
      \
      root-build2:\
      include config/common.build2

      cxx.std = latest

      using cxx
      \
      build-file: config/common.build2
      EOF

    : mixed-naming
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      build-file: config/common.build
      build-file: config/extra.build2
      \
      EOI
      stdin:7:13: error: standard buildfile naming scheme is already used
      EOE

    : empty-path
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      build-file:
      EOI
      stdin:6:12: error: path with build or build2 extension expected
      EOE

    : invalid-extension
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      build-file: common.buildfile
      EOI
      stdin:6:13: error: path with build or build2 extension expected
      EOE

    : redefinition1
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      common-build:\
      {
        config [bool] config.libfoo.extras ?= false
      }
      \
      build-file: common.build
      EOI
      stdin:11:13: error: package buildfile redefinition
      EOE

    : redefinition2
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      build-file: config/common.build
      build-file: config/common.build
      EOI
      stdin:7:13: error: package buildfile redefinition
      EOE

    : bootstrap-build
    :
    $* <<EOI 2>>EOE != 0
      : 1
      name: libfoo
      version: 2.0.0
      summary: Modern C++ parser
      license: LGPLv2
      build-file: bootstrap.build
      EOI
      stdin:6:13: error: bootstrap not allowed
      EOE
  }
}

: package-list
:
{
  : pkg
  :
  {
    test.options += -pp

    : roundtrip
    :
    $* <<EOF >>EOF
      : 1
      sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
      :
      name: libfoo
      version: 1.2.3+2
      project: foo
      priority: high; Due to critical bug fix.
      summary: Modern XML parser
      license: LGPLv2, MIT; Both required.
      license: BSD
      keywords: c++ xml parser serializer pull
      description: libfoo is a very modern C++ XML parser.
      description-type: text/plain
      changes: 1.2.3+2: applied upstream patch for critical bug bar
      changes: 1.2.3+1: applied upstream patch for critical bug foo
      url: http://www.example.org/projects/libfoo/; libfoo project page url
      doc-url: http://www.example.org/projects/libfoo/man.xhtml; documentation page
      src-url: http://scm.example.com/?p=odb/libodb.git\;a=tree; source tree
      package-url: http://www.example.org/projects/libfoo/1.2.3+2; package url
      email: libfoo-users@example.org; Public mailing list, posts by non-members\
       are allowed but moderated.
      package-email: libfoo-1.2.3+2@example.org; Bug reports are welcome.
      build-email: libfoo-builds@example.org; Mailing list for bbot notification\
       emails.
      build-warning-email: libfoo-issues@example.org; Email for libfoo issues.
      depends: libz ~1.0.0 | libz ^2.0.0
      depends: libgnutls <= 1.2.3 | libopenssl >= 2.3.4
      depends: libboost-regex >= 1.52.0 ? (!$cxx_regex); Only if C++ compiler does\
       not support C++11 <regex>.
      depends: libqtcore >= 5.0.0 ? ($config.libfoo.gui); Only if GUI is enabled.
      requires: linux | windows | macosx; symbian is coming.
      requires: c++11
      requires: ? ; VC++ 12.0 or later if targeting Windows.
      requires: ? ; libc++ standard library if using Clang on Mac OS X.
      requires: zlib; Most Linux/UNIX systems already have one; or get it at\
       www.zlib.net.
      tests: libfoo-tests
      examples: libfoo-examples == 1.2.3
      benchmarks: libfoo-benchmarks ~1.2.0
      builds: +!windows &( +gcc +clang ) +( +windows &msvc )
      build-include: linux*
      build-include: freebsd*
      build-exclude: *; Only supports Linux and FreeBSD.
      network-build-config: config.libfoo.network=true; Enable networking API.
      network-builds: default
      network-build-include: linux*
      network-build-exclude: *; Only supports Linux.
      bootstrap-build:\
      project = libfoo

      \
      root-build:\
      cxx.std = latest

      using cxx

      \
      location: libfoo-1.2.3+2.tar.bz2
      sha256sum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
      :
      name: libbar
      version: 3.4A.5+6
      summary: Modern bar management framework
      license: LGPLv2
      keywords: c++, xml, modern
      url: http://www.example.org/projects/libbar/
      email: libbar-users@example.org
      build-email:
      depends: libbaz (1- 2-) | libbaz [3 4-) | libbaz (5 6] | libbaz [7 8]
      builds: default legacy; Default and legacy.
      builds: -windows; Not on Windows.
      build-exclude: *-msvc_14*/i?86-*; Linker crash.
      bootstrap-build:\
      project = libbar

      \
      location: bar/libbar-3.4A.5+6.tbz
      sha256sum: d4b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
      :
      name: libbaz
      version: +2-3.4A.5+3
      summary: Modern baz system
      license: LGPLv2
      url: http://www.example.org/projects/libbar/
      email: libbaz-users@example.org
      build-error-email: libbaz-issues@example.org; Email for libbaz issues.
      builds: default experimental
      bootstrap-build:\
      project = libbaz

      \
      location: libbaz/libbaz-+2-3.4A.5+3.tar.gz
      sha256sum: b5b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
      EOF

    : dependency
    :
    {
      : incomplete
      :
      $* <<EOI 2>"stdin:8:10: error: invalid package constraint '== \$': \$ not allowed" != 0
        : 1
        sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
        :
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        depends: bar == $
        EOI
    }

    : buildfiles
    :
    {
      # @@ TMP Uncomment when the missing bootstrap-build value related
      #    workaround is removed (see manifest.cxx for details).
      #\
      : no-bootstrap
      :
      $* <<EOI 2>"stdin:10:1: error: no package bootstrap build specified" != 0
        : 1
        sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
        :
        name: foo
        version: 2.0.0
        summary: Modern C++ parser
        license: LGPLv2
        location: foo/foo-2.0.0.tar.gz
        sha256sum: b5b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
        EOI
      #\
    }
  }

  : dir
  :
  {
    test.options += -dp

    : empty
    :
    $* <"" >:""

    : non-empty
    :
    $* <<EOF >>EOF
      : 1
      location: hello/
      :
      location: mhello/
      EOF

    : duplicate
    :
    $* <<EOI 2>'stdin:5:1: error: duplicate package manifest' != 0
      : 1
      location: hello/
      :
      location: hello/
      :
      location: mhello/
      EOI
  }

  : git
  :
  {
    test.options += -gp

    : fragment
    :
    $* <<EOF >>EOF
      : 1
      location: hello/
      fragment: ca602c2d46b0dca7a9ebc856871767b0ba6b74f3
      :
      location: mhello/
      fragment: ca602c2d46b0dca7a9ebc856871767b0ba6b74f3
      EOF
  }
}

: repository-list
:
{
  : header
  :
  {
    +$* -v | set v

    test.options += -pr

    : version
    :
    {
      $* <<"EOF" >>"EOF"
        : 1
        min-bpkg-version: $v
        :
        location: http://pkg.example.org/1/math
        type: pkg
        role: prerequisite
        :
        url: http://cppget.org
        email: repoman@cppget.org; General mailing list.
        EOF
    }

    : invalid-version
    :
    {
      $* <<EOI 2>'stdin:2:19: error: invalid minimum bpkg version: invalid major version' != 0
        : 1
        min-bpkg-version: foo
        EOI
    }

    : too-new
    :
    {
      $* <<EOI 2>'stdin:2:19: error: incompatible repositories manifest: minimum bpkg version is 1000.0.0' != 0
        : 1
        min-bpkg-version: 1000.0.0
        EOI
    }

    : non-version
    :
    {
      $* <<EOF >>EOF
        : 1
        compression: none
        :
        location: http://pkg.example.org/1/math
        type: pkg
        role: prerequisite
        :
        url: http://cppget.org
        email: repoman@cppget.org; General mailing list.
        EOF
    }

    : version-non-first
    :
    {
      $* <<"EOI" 2>"stdin:3:1: error: minimum bpkg version must be first in repositories manifest header" != 0
        : 1
        compression: none
        min-bpkg-version: $v
        EOI
    }

    : unknown-header-value
    :
    {
      $* <<EOI 2>"stdin:3:1: error: unknown name 'unknown' in repositories manifest header" != 0
        : 1
        compression: none
        unknown: foo
        EOI
    }

    : unknown-manifest-value
    :
    {
      $* <<EOI 2>"stdin:2:1: error: unknown name 'unknown' in repository manifest" != 0
        : 1
        unknown: foo
        EOI
    }

    : empty-repository-manifest
    :
    {
      $* <<EOF >>EOF
        : 1
        compression: none
        :
        EOF
    }

    : base-redefinition
    :
    {
      $* <<EOI 2>'stdin:4:1: error: base repository manifest redefinition' != 0
        : 1
        compression: none
        :
        :
        EOI
    }

    : empty-base
    :
    {
      $* <<"EOF" >>"EOF"
        : 1
        compression: none
        :
        location: http://pkg.example.org/1/math
        type: pkg
        role: prerequisite
        :
        EOF
    }

    : no-repository-manifest
    :
    {
      $* <<EOF >>EOF
        : 1
        compression: none
        EOF
    }

    : only-empty-base
    :
    {
      $* <<EOF >>EOF
        : 1
        EOF
    }

    : empty-manifest-list
    :
    $* <'' 2>'stdin:2:1: error: start of repository manifest expected' != 0
  }

  : pkg
  :
  {
    test.options += -pr

    : roundtrip
    :
    $* <<EOF >>EOF
      : 1
      location: http://pkg.example.org/1/math
      type: pkg
      role: prerequisite
      :
      location: ../stable
      type: pkg
      role: complement
      :
      url: http://cppget.org
      email: repoman@cppget.org; General mailing list.
      summary: General C++ package repository
      description: This is the awesome C++ package repository full of exciting\
       stuff.
      certificate:\
      -----BEGIN CERTIFICATE-----
      MIIFLzCCAxegAwIBAgIJAJ71rMp8mDy1MA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV
      BAoMDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDDA9uYW1lOmNwcGdldC5vcmcwHhcN
      MTYwNDA4MTc1NTUwWhcNMTcwNDA4MTc1NTUwWjAzMRcwFQYDVQQKDA5Db2RlIFN5
      bnRoZXNpczEYMBYGA1UEAwwPbmFtZTpjcHBnZXQub3JnMIICIjANBgkqhkiG9w0B
      AQEFAAOCAg8AMIICCgKCAgEAwj7lwxkr19ygfNIzQsiKkmyyRG0c5AwMrwvldEk7
      2UIwz5kNb04zveUzQcfNFhau60+xC980Y4TKA4/ScfinyaDfp1I3pmiv4OSDUoBw
      9e8a+4Jyo5fuiAXoAYaQyAdwvH1mIbYq1ObRfKW2MTrUXp/HRJAWHHBnv3VmCYBZ
      dllY1hasA+SBDMBv6iTXkKUIfEdNDk8cjUR3FjxaefIdip9pHR3G0y4iWctS1drq
      AKLE1J0KIJyPsJCvoZnzIeePaCNL/UtRup9mYi2vxHHFD4Ml5Bbp+gE6vq5XhcQz
      LeCcGYKB3UjVWuszcpFIoHACw9ja2JUumbTiclUDgLBk8WXJvLjOCNLp9i/MKQws
      p5CDfrNe2P6u63ZmtW2v0Qpj/6b6JQmqJaMgHQdDEBUFO3bjwm7yyXyvEjj/EAEJ
      pGziWZjan5NKGgKCX1JChQJloMHhzr42YMvceWTMJjAr07Es9vCsCS2KPvAKY7Mv
      yewAyK9ucFRDObZVuaFjU+WUTXB1munwO3Jso56EMxeFvu+W1B+m49XS3k/TlBvF
      HGnkiSaMwLEJvgFVgQPpG2gD39WDFqX28pWdLL4hM+hXUfdeH0OdXfq66CLu7P8d
      cgkZdHRs5UauxLzm1Qo06aLsm2HXrfDnmsd5ENi7RkiFMx1aLh3/cjZD0uHndQUC
      LEcCAwEAAaNGMEQwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF
      BwMDMBoGA1UdEQQTMBGBD2luZm9AY3BwZ2V0Lm9yZzANBgkqhkiG9w0BAQsFAAOC
      AgEAHLfv2w82bBMgDgsRX8GU/3eK6CnyfRu4Auto1XjyHCrD6qcIdmebC0hihpSg
      5xSlfVwjPRWBmg3z5/K8ln5jM6KKiWHd47OCfx+DW7wbesq2+6lS1btXpRR2pv7j
      zG+41Cncu/xVNs9F4CQluVn5xyWFVDUxQfkQqAE46EbkjAmq42y+1ZQnq2Zm47Wr
      iMRXQtg1yx7Fs2EpVU+sbW4ImuXgv0YbyYbI1lPhvmx8rIL6lybN3evEfIj7crh7
      5abWPDZzA+1aNL5tiaSNrn3nS/BfJyEYhGMyy0bsekPZiaqGB1q/mgv2rmR/2SRL
      Tx+T7sthy/IHTOUbDTY0lUhjc6thQMncgGTaD4TC3QaXhdLWzO9XTh0K7U8BOMwh
      wppr1G5aTXY0PUB0+Hs+IQZ4mVfBvKO0Wn6GgoDAs/mW9qvbWP3ZnpdvhB52a49P
      g07JQ+R0QgBNQY7t0lT0mOpAPx79Dwc5R8jQCkx4gTr1bWtgyCvza+gpTgUQDOH5
      nawOIIDOnRv4heFdvgfEQs2oKa3X4bM+BsgOx7OTvnWCzJy0IXo0uBbcTrMv9Z62
      +KVwnghQdpURRnUpomt03cTwjqVJVrq287owGv8qqnuGcTTi1SgzNNYREFoljY58
      CCj4yYvTUzXjcAUXaNC5YNw3JEQp8vmciuJwhyUkbifLrHU=
      -----END CERTIFICATE-----
      \
      EOF

    : prerequisite-type
    :
    $* <<EOI >>EOO
      : 1
      url: http://cppget.org
      :
      location: http://example.org/math.git#master
      role: prerequisite
      :
      location: ../stable
      role: complement
      :
      location: ../unstable.git
      role: complement
      :
      location: git://example.org/foo#master
      type: git
      role: prerequisite
      :
      location: http://pkg.example.org/1/bar
      role: prerequisite
      trust: 37:CE:2C:A5:1D:CF:93:81:D7:07:46:AD:66:B3:C3:90:83:B8:96:9E:34:F0:E7:B3:A2:B0:6C:EF:66:A4:BE:65
      EOI
      : 1
      url: http://cppget.org
      :
      location: http://example.org/math.git#master
      type: git
      role: prerequisite
      :
      location: ../stable
      type: pkg
      role: complement
      :
      location: ../unstable.git
      type: git
      role: complement
      :
      location: git://example.org/foo#master
      type: git
      role: prerequisite
      :
      location: http://pkg.example.org/1/bar
      type: pkg
      role: prerequisite
      trust: 37:CE:2C:A5:1D:CF:93:81:D7:07:46:AD:66:B3:C3:90:83:B8:96:9E:34:F0:E7:B\
      3:A2:B0:6C:EF:66:A4:BE:65
      EOO

    : no-base
    :
    $* <<EOO >>EOO
      : 1
      location: http://pkg.example.org/1/math
      type: pkg
      role: prerequisite
      :
      location: ../stable
      type: pkg
      role: complement
      EOO

    : base-manifest-redefinition
    :
     $* <<EOI 2>'stdin:3:1: error: base repository manifest redefinition' != 0
      : 1
      url: http://cppget.org
      :
      url: http://cppget.org
      EOI
  }

  : git
  :
  {
    test.options += -gr

    : roundtrip
    :
    $* <<EOF >>EOF
      : 1
      location: http://example.org/math.git#master
      type: git
      role: prerequisite
      :
      location: ../stable.git#stable
      type: git
      role: complement
      :
      location: ../unstable.git
      type: git
      role: complement
      :
      url: http://cppget.org
      email: repoman@cppget.org; General mailing list.
      summary: General C++ package repository
      description: This is the awesome C++ package repository full of exciting\
       stuff.
      EOF

    : fragment
    :
    $* <<EOF >>EOF
      : 1
      location: http://example.org/math.git#master
      type: git
      role: prerequisite
      fragment: ca602c2d46b0dca7a9ebc856871767b0ba6b74f3
      :
      location: ../stable.git#stable
      type: git
      role: complement
      fragment: ca602c2d46b0dca7a9ebc856871767b0ba6b74f3
      :
      location: ../unstable.git
      type: git
      role: complement
      fragment: ca602c2d46b0dca7a9ebc856871767b0ba6b74f3
      :
      location: http://example.org/math.git#master
      type: git
      role: prerequisite
      fragment: abc1232d46b0dca7a9ebc856871767b0ba6b74f3
      :
      location: ../stable.git#stable
      type: git
      role: complement
      fragment: abc1232d46b0dca7a9ebc856871767b0ba6b74f3
      :
      url: http://cppget.org
      email: repoman@cppget.org; General mailing list.
      summary: General C++ package repository
      description: This is the awesome C++ package repository full of exciting\
       stuff.
      EOF

    : prerequisite-type
    :
    $* <<EOI >>EOO
      : 1
      location: http://example.org/math.git#master
      role: prerequisite
      :
      location: ../stable.git#stable
      role: complement
      :
      location: git://example.org/foo#master
      type: git
      role: prerequisite
      :
      location: http://pkg.example.org/1/bar
      role: prerequisite
      :
      url: http://cppget.org
      EOI
      : 1
      location: http://example.org/math.git#master
      type: git
      role: prerequisite
      :
      location: ../stable.git#stable
      type: git
      role: complement
      :
      location: git://example.org/foo#master
      type: git
      role: prerequisite
      :
      location: http://pkg.example.org/1/bar
      type: pkg
      role: prerequisite
      :
      url: http://cppget.org
      EOO
  }

  : dir
  :
  {
    test.options += -dr

    : roundtrip
    :
    $* <<EOF >>EOF
      : 1
      location: ../stable
      type: dir
      role: complement
      :
      EOF

    : prerequisite-with-fragment
    :
    $* <<EOI 2>>EOE != 0
      : 1
      location: ../stable.git#stable
      type: dir
      role: complement
      :
      EOI
      stdin:2:11: error: unexpected fragment for dir repository
      EOE
  }
}

: signature
:
{
  : roundtrip
  :
  $* -s <<EOF >>EOF
    : 1
    sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
    signature:\
    geWdw7Gm+Rt+CLDMBby5Y796E8rxwImb0bmcZwGWar9D3vkFm9Kjh00Buuo1PuU7tP1dV6yvRbH8
    NzC0IryEoUJHx9909AJ449ET9Zb+C3ykEeBlKH2wonj7cAVK9ZEDpPEGAtp56XWZQEawl50mwq6t
    XkZAABxtOswXiicdh3HK7kaPHp38/9CBMc0rva6wDnkbTigUYA2ULqLtP5a5mLovVc48zI9A/hmb
    Qx1/Nr7nzTZNDGK7CwTAb1fPam9rZklTfCTPSPUUjvWjM9XdY8cbRE1FrE14TXdyQPxCLzHO2dUO
    YWH5/qMikEoCYhYXQ6KhekoT/MUiVC3PMcYQbYOrOtSxq6RcgnymexBe1XIyld5Rfo1eXu8TK11r
    QPULIqAGy6RwEUhGznuEiGHQwb1UymNyJ/qgr4vBPjJtlvptqG5XNmtiJ22f07nmeVRi2Vg2UyOw
    HoVpy5t/w0tEnUXPA39Vt0v1bUm7Knhc8qL4JFEqK/j/CzEHzEtAjn0aoGuKubCO0WUa+v6ZlkLU
    YrNUIdgT1wgj4yEhLO3g+NsnxFH05D2sfR16rrkI2E6st5crAHR8FOl2FDsWxgKqNbzXZw7rl+Fa
    TobGycX7MDf2mbBmR/KmEkMBJ4mziWLAycSAGyE5VRYDwHPJlQE0143wBzT8eNw4VLm/r+88VYw=
    \
    EOF
}

: effective-constraints
:
{
  test.options += -ec

  : regular
  :
  $* '1.2.3+1' <<EOI >>EOO
    [1.0 $)
    [1.0 $]
    [$ 1.2.4]
    ($ 1.2.4]
    == $
    >= $
    EOI
    [1.0 $) [1.0 1.2.3)
    [1.0 $] [1.0 1.2.3]
    [$ 1.2.4] [1.2.3 1.2.4]
    ($ 1.2.4] (1.2.3 1.2.4]
    == $ == 1.2.3
    >= $ >= 1.2.3
    EOO

  : shortcut
  :
  {
    : final
    :
    {
      $* '1.2.3+1' <'~$' >'~$ ~1.2.0' : tilda
      $* '1.2.3+1' <'^$' >'^$ ^1.0.0' : carrot
    }

    : pre-release
    :
    {
      : tilda
      :
      {
        $* '1.2.0-b.2' <'~$' >'~$ ~1.2.0-a.1' : no-final
        $* '1.2.1-a.1' <'~$' >'~$ ~1.2.0'     : final-patch
      }

      : carrot
      :
      {
        $* '1.0.0-b.2' <'^$' >'^$ ^1.0.0-a.1' : no-final
        $* '1.0.1-a.1' <'^$' >'^$ ^1.0.0'     : final-patch
        $* '1.1.0-b.2' <'^$' >'^$ ^1.0.0'     : final-minor
      }
    }

    : snapshot
    :
    {
      : tilda
      :
      {
        $* '1.2.1-a.2.345' <'~$' >'~$ ~1.2.0'                  : patch
        $* '1.2.0-a.0.345' <'~$' >'~$ [1.2.0-a.0.1 1.2.0-a.1)' : minor
        $* '1.0.0-a.0.345' <'~$' >'~$ [1.0.0-a.0.1 1.0.0-a.1)' : major
      }

      : carrot
      :
      {
        $* '1.2.1-a.2.345' <'^$' >'^$ ^1.0.0'                  : patch
        $* '1.2.0-a.0.345' <'^$' >'^$ [1.2.0-a.0.1 1.2.0-a.1)' : minor
        $* '1.0.0-a.0.345' <'^$' >'^$ [1.0.0-a.0.1 1.0.0-a.1)' : major
      }
    }

    : invalid
    :
    {
      $* '1.2.3-'      <'~$' 2>'dependent version is earliest'                           == 1 : earliest-version
      $* '1.2.3-a.0.z' <'~$' 2>'invalid version: dependent version is latest snapshot' == 1 : latest-version
      $* '0+1'         <'~$' 2>'invalid version: dependent version is stub'            == 1 : stub-version
    }
  }
}