1#!/usr/bin/env python3
2
3import os
4
5lvgldirname = os.path.abspath('..')
6lvgldirname = os.path.basename(lvgldirname)
7lvgldirname = '"' + lvgldirname + '"'
8
9base_defines = '"-DLV_CONF_PATH=' + lvgldirname +'/tests/lv_test_conf.h -DLV_BUILD_TEST"'
10optimization = '"-O3 -g0"'
11
12
13def build(name, defines):
14  global base_defines, optimization
15
16  print("=============================")
17  print(name)
18  print("=============================")
19
20  d_all = base_defines[:-1] + " ";
21
22  for d in defines:
23    d_all += " -D" + d + "=" + str(defines[d])
24
25  d_all += '"'
26  cmd = "make -j8 BIN=test.bin LVGL_DIR_NAME=" + lvgldirname + " DEFINES=" + d_all + " OPTIMIZATION=" + optimization
27
28  print("---------------------------")
29  print("Clean")
30  print("---------------------------")
31  os.system("make clean LVGL_DIR_NAME=" + lvgldirname)
32  os.system("rm -f ./test.bin")
33  print("---------------------------")
34  print("Build")
35  print("---------------------------")
36  ret = os.system(cmd)
37  if(ret != 0):
38    print("BUILD ERROR! (error code  " + str(ret) + ")")
39    exit(1)
40
41  print("---------------------------")
42  print("Run")
43  print("---------------------------")
44  ret = os.system("./test.bin")
45  if(ret != 0):
46    print("RUN ERROR! (error code  " + str(ret) + ")")
47    exit(1)
48
49  print("---------------------------")
50  print("Finished")
51  print("---------------------------")
52
53
54minimal_monochrome = {
55  "LV_DPI":40,
56  "LV_MEM_SIZE":4*1024,
57  "LV_HOR_RES_MAX":128,
58  "LV_VER_RES_MAX":64,
59  "LV_COLOR_DEPTH":1,
60  "LV_USE_GROUP":0,
61  "LV_USE_ANIMATION":0,
62  "LV_ANTIALIAS":0,
63  "LV_GPU":0,
64  "LV_USE_FILESYSTEM":0,
65  "LV_USE_IMG_TRANSFORM":0,
66  "LV_USE_API_EXTENSION_V6":0,
67  "LV_USE_USER_DATA":0,
68  "LV_USE_USER_DATA_FREE":0,
69  "LV_USE_LOG":0,
70  "LV_USE_THEME_EMPTY":0,
71  "LV_USE_THEME_MATERIAL":0,
72  "LV_USE_THEME_MONO":1,
73  "LV_USE_THEME_TEMPLATE":0,
74  "LV_THEME_DEFAULT_INIT": "\\\"lv_theme_mono_init\\\"",
75  "LV_THEME_DEFAULT_COLOR_PRIMARY":      "\\\"LV_COLOR_RED\\\"",
76  "LV_THEME_DEFAULT_COLOR_SECONDARY":    "\\\"LV_COLOR_BLUE\\\"",
77  "LV_THEME_DEFAULT_FLAG"         :     "0",
78  "LV_THEME_DEFAULT_FONT_SMALL"    :     "\\\"&lv_font_unscii_8\\\"",
79  "LV_THEME_DEFAULT_FONT_NORMAL"   :     "\\\"&lv_font_unscii_8\\\"",
80  "LV_THEME_DEFAULT_FONT_SUBTITLE" :     "\\\"&lv_font_unscii_8\\\"",
81  "LV_THEME_DEFAULT_FONT_TITLE"    :     "\\\"&lv_font_unscii_8\\\"",
82  "LV_LOG_PRINTF":0,
83  "LV_USE_DEBUG":0,
84  "LV_USE_ASSERT_NULL":0,
85  "LV_USE_ASSERT_MEM":0,
86  "LV_USE_ASSERT_STR":0,
87  "LV_USE_ASSERT_OBJ":0,
88  "LV_USE_ASSERT_STYLE":0,
89  "LV_FONT_MONTSERRAT_12":0,
90  "LV_FONT_MONTSERRAT_16":0,
91  "LV_FONT_MONTSERRAT_22":0,
92  "LV_FONT_MONTSERRAT_28":0,
93  "LV_FONT_MONTSERRAT_12_SUBPX":0,
94  "LV_FONT_MONTSERRAT_28_COMPRESSED":0,
95  "LV_FONT_UNSCII_8":1,
96  "LV_USE_BIDI": 0,
97  "LV_USE_OBJ_REALIGN": 0,
98  "LV_USE_ARC":0,
99  "LV_USE_BAR":1,
100  "LV_USE_BTN":1,
101  "LV_USE_BTNM":0,
102  "LV_USE_CALENDAR":0,
103  "LV_USE_CANVAS":0,
104  "LV_USE_CHECKBOX":0,
105  "LV_USE_CHART":0,
106  "LV_USE_CONT":1,
107  "LV_USE_CPICKER":0,
108  "LV_USE_DROPDOWN":0,
109  "LV_USE_GAUGE":0,
110  "LV_USE_IMG":1,
111  "LV_USE_IMGBTN":0,
112  "LV_USE_KEYBOARD":0,
113  "LV_USE_LABEL":1,
114  "LV_USE_LED":0,
115  "LV_USE_LINE":0,
116  "LV_USE_LIST":0,
117  "LV_USE_LINEMETER":0,
118  "LV_USE_OBJMASK":0,
119  "LV_USE_MBOX":0,
120  "LV_USE_PAGE":0,
121  "LV_USE_SPINNER":0,
122  "LV_USE_ROLLER":0,
123  "LV_USE_SLIDER":0,
124  "LV_USE_SPINBOX":0,
125  "LV_USE_SWITCH":0,
126  "LV_USE_TEXTAREA":0,
127  "LV_USE_TABLE":0,
128  "LV_USE_TABVIEW":0,
129  "LV_USE_TILEVIEW":0,
130  "LV_USE_WIN":0
131}
132
133all_obj_minimal_features = {
134  "LV_DPI":60,
135  "LV_MEM_SIZE":12*1024,
136  "LV_HOR_RES_MAX":320,
137  "LV_VER_RES_MAX":240,
138  "LV_COLOR_DEPTH":8,
139  "LV_USE_GROUP":0,
140  "LV_USE_ANIMATION":0,
141  "LV_ANTIALIAS":0,
142  "LV_GPU":0,
143  "LV_USE_FILESYSTEM":0,
144  "LV_USE_IMG_TRANSFORM":0,
145  "LV_USE_API_EXTENSION_V6":0,
146  "LV_USE_USER_DATA":0,
147  "LV_USE_USER_DATA_FREE":0,
148  "LV_USE_LOG":0,
149  "LV_USE_THEME_MATERIAL":1,
150  "LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"",
151  "LV_THEME_DEFAULT_COLOR_PRIMARY":      "\\\"LV_COLOR_RED\\\"",
152  "LV_THEME_DEFAULT_COLOR_SECONDARY":    "\\\"LV_COLOR_BLUE\\\"",
153  "LV_THEME_DEFAULT_FLAG"         :     "\\\"LV_THEME_MATERIAL_FLAG_LIGHT\\\"",
154  "LV_THEME_DEFAULT_FONT_SMALL"    :     "\\\"&lv_font_montserrat_16\\\"",
155  "LV_THEME_DEFAULT_FONT_NORMAL"   :     "\\\"&lv_font_montserrat_16\\\"",
156  "LV_THEME_DEFAULT_FONT_SUBTITLE" :     "\\\"&lv_font_montserrat_16\\\"",
157  "LV_THEME_DEFAULT_FONT_TITLE"    :     "\\\"&lv_font_montserrat_16\\\"",
158  "LV_USE_DEBUG":0,
159  "LV_USE_ASSERT_NULL":0,
160  "LV_USE_ASSERT_MEM":0,
161  "LV_USE_ASSERT_STR":0,
162  "LV_USE_ASSERT_OBJ":0,
163  "LV_USE_ASSERT_STYLE":0,
164  "LV_FONT_MONTSERRAT_12":0,
165  "LV_FONT_MONTSERRAT_16":1,
166  "LV_FONT_MONTSERRAT_22":0,
167  "LV_FONT_MONTSERRAT_28":0,
168  "LV_FONT_MONTSERRAT_12_SUBPX":0,
169  "LV_FONT_MONTSERRAT_28_COMPRESSED":0,
170  "LV_FONT_UNSCII_8":0,
171  "LV_USE_BIDI": 0,
172  "LV_USE_OBJ_REALIGN": 0,
173  "LV_USE_EXT_CLICK_AREA":"LV_EXT_CLICK_AREA_TINY",
174  "LV_USE_ARC":1,
175  "LV_USE_BAR":1,
176  "LV_USE_BTN":1,
177  "LV_USE_BTNM":1,
178  "LV_USE_CALENDAR":1,
179  "LV_USE_CANVAS":1,
180  "LV_USE_CHECKBOX":1,
181  "LV_USE_CHART":1,
182  "LV_USE_CONT":1,
183  "LV_USE_CPICKER":1,
184  "LV_USE_DROPDOWN":1,
185  "LV_USE_GAUGE":1,
186  "LV_USE_IMG":1,
187  "LV_USE_IMGBTN":1,
188  "LV_USE_KEYBOARD":1,
189  "LV_USE_LABEL":1,
190  "LV_USE_LED":1,
191  "LV_USE_LINE":1,
192  "LV_USE_LIST":1,
193  "LV_USE_LINEMETER":1,
194  "LV_USE_OBJMASK":1,
195  "LV_USE_MBOX":1,
196  "LV_USE_PAGE":1,
197  "LV_USE_SPINNER":0, #Disabled beacsue needs anim
198  "LV_USE_ROLLER":1,
199  "LV_USE_SLIDER":1,
200  "LV_USE_SPINBOX":1,
201  "LV_USE_SWITCH":1,
202  "LV_USE_TEXTAREA":1,
203  "LV_USE_TABLE":1,
204  "LV_USE_TABVIEW":1,
205  "LV_USE_TILEVIEW":1,
206  "LV_USE_WIN":1
207}
208
209all_obj_all_features = {
210  "LV_DPI":100,
211  "LV_MEM_SIZE":32*1024,
212  "LV_HOR_RES_MAX":480,
213  "LV_VER_RES_MAX":320,
214  "LV_COLOR_DEPTH":32,
215  "LV_COLOR_SCREEN_TRANSP":1,
216  "LV_USE_GROUP":1,
217  "LV_USE_ANIMATION":1,
218  "LV_ANTIALIAS":1,
219  "LV_GPU":1,
220  "LV_USE_FILESYSTEM":1,
221  "LV_USE_IMG_TRANSFORM":1,
222  "LV_USE_API_EXTENSION_V6":1,
223  "LV_USE_USER_DATA":1,
224  "LV_USE_USER_DATA_FREE":0,
225  "LV_USE_LOG":1,
226  "LV_USE_THEME_MATERIAL":1,
227  "LV_USE_THEME_EMPTY":1,
228  "LV_USE_THEME_MONO":1,
229  "LV_USE_THEME_TEMPLATE":1,
230  "LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"",
231  "LV_THEME_DEFAULT_COLOR_PRIMARY":      "\\\"LV_COLOR_RED\\\"",
232  "LV_THEME_DEFAULT_COLOR_SECONDARY":    "\\\"LV_COLOR_BLUE\\\"",
233  "LV_THEME_DEFAULT_FLAG"         :     "\\\"LV_THEME_MATERIAL_FLAG_LIGHT\\\"",
234  "LV_THEME_DEFAULT_FONT_SMALL"    :     "\\\"&lv_font_montserrat_12\\\"",
235  "LV_THEME_DEFAULT_FONT_NORMAL"   :     "\\\"&lv_font_montserrat_16\\\"",
236  "LV_THEME_DEFAULT_FONT_SUBTITLE" :     "\\\"&lv_font_montserrat_22\\\"",
237  "LV_THEME_DEFAULT_FONT_TITLE"    :     "\\\"&lv_font_montserrat_28\\\"",
238  "LV_LOG_PRINTF":0,
239  "LV_USE_DEBUG":0,
240  "LV_USE_ASSERT_NULL":0,
241  "LV_USE_ASSERT_MEM":0,
242  "LV_USE_ASSERT_STR":0,
243  "LV_USE_ASSERT_OBJ":0,
244  "LV_USE_ASSERT_STYLE":0,
245  "LV_FONT_MONTSERRAT_12":1,
246  "LV_FONT_MONTSERRAT_16":1,
247  "LV_FONT_MONTSERRAT_22":1,
248  "LV_FONT_MONTSERRAT_28":1,
249  "LV_FONT_MONTSERRAT_12_SUBPX":1,
250  "LV_FONT_MONTSERRAT_28_COMPRESSED":1,
251  "LV_FONT_UNSCII_8":1,
252  "LV_USE_ARC":1,
253  "LV_USE_BAR":1,
254  "LV_USE_BTN":1,
255  "LV_USE_BTNM":1,
256  "LV_USE_CALENDAR":1,
257  "LV_USE_CANVAS":1,
258  "LV_USE_CHECKBOX":1,
259  "LV_USE_CHART":1,
260  "LV_USE_CONT":1,
261  "LV_USE_CPICKER":1,
262  "LV_USE_DROPDOWN":1,
263  "LV_USE_GAUGE":1,
264  "LV_USE_IMG":1,
265  "LV_USE_IMGBTN":1,
266  "LV_USE_KEYBOARD":1,
267  "LV_USE_LABEL":1,
268  "LV_USE_LED":1,
269  "LV_USE_LINE":1,
270  "LV_USE_LIST":1,
271  "LV_USE_LINEMETER":1,
272  "LV_USE_OBJMASK":1,
273  "LV_USE_MBOX":1,
274  "LV_USE_PAGE":1,
275  "LV_USE_SPINNER":1,
276  "LV_USE_ROLLER":1,
277  "LV_USE_SLIDER":1,
278  "LV_USE_SPINBOX":1,
279  "LV_USE_SWITCH":1,
280  "LV_USE_TEXTAREA":1,
281  "LV_USE_TABLE":1,
282  "LV_USE_TABVIEW":1,
283  "LV_USE_TILEVIEW":1,
284  "LV_USE_WIN":1
285}
286
287
288advanced_features = {
289  "LV_DPI":100,
290  "LV_MEM_SIZE":4*1024*1024,
291  "LV_MEM_CUSTOM":1,
292  "LV_HOR_RES_MAX":800,
293  "LV_VER_RES_MAX":480,
294  "LV_COLOR_DEPTH":32,
295  "LV_COLOR_16_SWAP":0,
296  "LV_COLOR_SCREEN_TRANSP":1,
297  "LV_USE_GROUP":1,
298  "LV_USE_ANIMATION":1,
299  "LV_ANTIALIAS":1,
300  "LV_GPU":1,
301  "LV_USE_FILESYSTEM":1,
302  "LV_USE_IMG_TRANSFORM":1,
303  "LV_USE_API_EXTENSION_V6":1,
304  "LV_USE_USER_DATA":1,
305  "LV_IMG_CACHE_DEF_SIZE":32,
306  "LV_USE_LOG":1,
307  "LV_USE_THEME_MATERIAL":1,
308  "LV_USE_THEME_EMPTY":1,
309  "LV_USE_THEME_TEMPLATE":1,
310  "LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"",
311  "LV_THEME_DEFAULT_COLOR_PRIMARY":      "\\\"LV_COLOR_RED\\\"",
312  "LV_THEME_DEFAULT_COLOR_SECONDARY":    "\\\"LV_COLOR_BLUE\\\"",
313  "LV_THEME_DEFAULT_FLAG"         :     "\\\"LV_THEME_MATERIAL_FLAG_LIGHT\\\"",
314  "LV_THEME_DEFAULT_FONT_SMALL"    :     "\\\"&lv_font_montserrat_12\\\"",
315  "LV_THEME_DEFAULT_FONT_NORMAL"   :     "\\\"&lv_font_montserrat_16\\\"",
316  "LV_THEME_DEFAULT_FONT_SUBTITLE" :     "\\\"&lv_font_montserrat_22\\\"",
317  "LV_THEME_DEFAULT_FONT_TITLE"    :     "\\\"&lv_font_montserrat_28\\\"",
318  "LV_LOG_PRINTF":1,
319  "LV_USE_DEBUG":1,
320  "LV_USE_ASSERT_NULL":1,
321  "LV_USE_ASSERT_MEM":1,
322  "LV_USE_ASSERT_STR":1,
323  "LV_USE_ASSERT_OBJ":1,
324  "LV_USE_ASSERT_STYLE":1,
325  "LV_FONT_MONTSERRAT_12":1,
326  "LV_FONT_MONTSERRAT_16":1,
327  "LV_FONT_MONTSERRAT_22":1,
328  "LV_FONT_MONTSERRAT_28":1,
329  "LV_FONT_MONTSERRAT_12_SUBPX":1,
330  "LV_FONT_MONTSERRAT_28_COMPRESSED":1,
331  "LV_FONT_UNSCII_8":1,
332  "LV_USE_BIDI": 1,
333  "LV_USE_REVERSE_ARABIC_PERSIAN_CHARS":1,
334  "LV_USE_OBJ_REALIGN": 1,
335  "LV_FONT_FMT_TXT_LARGE":1,
336  "LV_FONT_SUBPX_BGR":1,
337  "LV_USE_BIDI": 1,
338  "LV_USE_OBJ_REALIGN": 1,
339  "LV_USE_EXT_CLICK_AREA":"LV_EXT_CLICK_AREA_FULL",
340  "LV_USE_ARC":1,
341  "LV_USE_BAR":1,
342  "LV_USE_BTN":1,
343  "LV_USE_BTNM":1,
344  "LV_USE_CALENDAR":1,
345  "LV_USE_CANVAS":1,
346  "LV_USE_CHECKBOX":1,
347  "LV_USE_CHART":1,
348  "LV_USE_CONT":1,
349  "LV_USE_CPICKER":1,
350  "LV_USE_DROPDOWN":1,
351  "LV_USE_GAUGE":1,
352  "LV_USE_IMG":1,
353  "LV_USE_IMGBTN":1,
354  "LV_USE_KEYBOARD":1,
355  "LV_USE_LABEL":1,
356  "LV_USE_LED":1,
357  "LV_USE_LINE":1,
358  "LV_USE_LIST":1,
359  "LV_USE_LINEMETER":1,
360  "LV_USE_OBJMASK":1,
361  "LV_USE_MBOX":1,
362  "LV_USE_PAGE":1,
363  "LV_USE_SPINNER":1,
364  "LV_USE_ROLLER":1,
365  "LV_USE_SLIDER":1,
366  "LV_USE_SPINBOX":1,
367  "LV_USE_SWITCH":1,
368  "LV_USE_TEXTAREA":1,
369  "LV_USE_TABLE":1,
370  "LV_USE_TABVIEW":1,
371  "LV_USE_TILEVIEW":1,
372  "LV_USE_WIN":1
373}
374
375
376build("Minimal monochrome", minimal_monochrome)
377build("All objects, minimal features", all_obj_minimal_features)
378build("All objects, all common features", all_obj_all_features)
379build("All objects, with advanced features", advanced_features)
380
381
382
383
384