xref: /aosp_15_r20/external/compiler-rt/make/test/test-util.mk (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robotinclude make/util.mk
2*7c3d14c8STreehugger Robot
3*7c3d14c8STreehugger Robotstreq_t0 = $(call streq,,)
4*7c3d14c8STreehugger Robot$(call AssertEqual,streq_t0,true)
5*7c3d14c8STreehugger Robotstreq_t1 = $(call streq,b,)
6*7c3d14c8STreehugger Robot$(call AssertEqual,streq_t1,)
7*7c3d14c8STreehugger Robotstreq_t2 = $(call streq,,b)
8*7c3d14c8STreehugger Robot$(call AssertEqual,streq_t2,)
9*7c3d14c8STreehugger Robotstreq_t3 = $(call streq,b,b)
10*7c3d14c8STreehugger Robot$(call AssertEqual,streq_t3,true)
11*7c3d14c8STreehugger Robotstreq_t4 = $(call streq,bb,b)
12*7c3d14c8STreehugger Robot$(call AssertEqual,streq_t4,)
13*7c3d14c8STreehugger Robotstreq_t5 = $(call streq,b,bb)
14*7c3d14c8STreehugger Robot$(call AssertEqual,streq_t5,)
15*7c3d14c8STreehugger Robotstreq_t6 = $(call streq,bb,bb)
16*7c3d14c8STreehugger Robot$(call AssertEqual,streq_t6,true)
17*7c3d14c8STreehugger Robot
18*7c3d14c8STreehugger Robotstrneq_t7 = $(call strneq,,)
19*7c3d14c8STreehugger Robot$(call AssertEqual,strneq_t7,)
20*7c3d14c8STreehugger Robotstrneq_t8 = $(call strneq,b,)
21*7c3d14c8STreehugger Robot$(call AssertEqual,strneq_t8,true)
22*7c3d14c8STreehugger Robotstrneq_t9 = $(call strneq,,b)
23*7c3d14c8STreehugger Robot$(call AssertEqual,strneq_t9,true)
24*7c3d14c8STreehugger Robotstrneq_t10 = $(call strneq,b,b)
25*7c3d14c8STreehugger Robot$(call AssertEqual,strneq_t10,)
26*7c3d14c8STreehugger Robotstrneq_t11 = $(call strneq,bb,b)
27*7c3d14c8STreehugger Robot$(call AssertEqual,strneq_t11,true)
28*7c3d14c8STreehugger Robotstrneq_t12 = $(call strneq,b,bb)
29*7c3d14c8STreehugger Robot$(call AssertEqual,strneq_t12,true)
30*7c3d14c8STreehugger Robotstrneq_t13 = $(call strneq,bb,bb)
31*7c3d14c8STreehugger Robot$(call AssertEqual,strneq_t13,)
32*7c3d14c8STreehugger Robot
33*7c3d14c8STreehugger Robotcontains_t0 = $(call contains,a b b c,a)
34*7c3d14c8STreehugger Robot$(call AssertEqual,contains_t0,true)
35*7c3d14c8STreehugger Robotcontains_t1 = $(call contains,a b b c,b)
36*7c3d14c8STreehugger Robot$(call AssertEqual,contains_t1,true)
37*7c3d14c8STreehugger Robotcontains_t2 = $(call contains,a b b c,c)
38*7c3d14c8STreehugger Robot$(call AssertEqual,contains_t2,true)
39*7c3d14c8STreehugger Robotcontains_t3 = $(call contains,a b b c,d)
40*7c3d14c8STreehugger Robot$(call AssertEqual,contains_t3,)
41*7c3d14c8STreehugger Robot
42*7c3d14c8STreehugger Robotisdefined_t0_defined_var := 0
43*7c3d14c8STreehugger Robotisdefined_t0 = $(call IsDefined,isdefined_t0_defined_var)
44*7c3d14c8STreehugger Robot$(call AssertEqual,isdefined_t0,true)
45*7c3d14c8STreehugger Robotisdefined_t1 = $(call IsDefined,isdefined_t1_never_defined_var)
46*7c3d14c8STreehugger Robot$(call AssertEqual,isdefined_t1,)
47*7c3d14c8STreehugger Robot
48*7c3d14c8STreehugger Robotvarordefault_t0_var := 1
49*7c3d14c8STreehugger Robotvarordefault_t0 = $(call VarOrDefault,varordefault_t0_var.opt,$(varordefault_t0_var))
50*7c3d14c8STreehugger Robot$(call AssertEqual,varordefault_t0,1)
51*7c3d14c8STreehugger Robotvarordefault_t1_var := 1
52*7c3d14c8STreehugger Robotvarordefault_t1_var.opt := 2
53*7c3d14c8STreehugger Robotvarordefault_t1 = $(call VarOrDefault,varordefault_t1_var.opt,$(varordefault_t1_var))
54*7c3d14c8STreehugger Robot$(call AssertEqual,varordefault_t1,2)
55*7c3d14c8STreehugger Robot
56*7c3d14c8STreehugger Robot$(call CopyVariable,copyvariable_t0_src,copyvariable_t0_dst)
57*7c3d14c8STreehugger Robotcopyvariable_t0 = $(call IsUndefined,copyvariable_t0_dst)
58*7c3d14c8STreehugger Robot$(call AssertEqual,copyvariable_t0,true)
59*7c3d14c8STreehugger Robotcopyvariable_t1_src = 1
60*7c3d14c8STreehugger Robot$(call CopyVariable,copyvariable_t1_src,copyvariable_t1)
61*7c3d14c8STreehugger Robot$(call AssertEqual,copyvariable_t1,1)
62*7c3d14c8STreehugger Robot
63*7c3d14c8STreehugger Robotall:
64*7c3d14c8STreehugger Robot	@true
65*7c3d14c8STreehugger Robot.PHONY: all
66*7c3d14c8STreehugger Robot
67