File: upstream-tests

package info (click to toggle)
givaro 4.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,112 kB
  • sloc: cpp: 29,827; makefile: 1,065; sh: 366; csh: 196
file content (190 lines) | stat: -rwxr-xr-x 8,235 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/make -f

CPPFLAGS = -std=gnu++11 -DNDEBUG -DSTD_RECINT_SIZE=8
LIBS = $(shell pkg-config givaro --libs)

TESTS = test-random    \
	test-ifactor   \
	test-ffarith   \
	test-ringarith \
	test-mod       \
	test-modsqroot \
	test-trunc     \
	test-poly       \
	test-crt       \
	test-geom      \
	test-integer   \
	test-conversion \
	test-ratrecon \
	test-modularmulprecomp \
	test-rmint_arith_addmul_mg   \
	test-rmint_arith_addmul      \
	test-ruint_arith_addmul      \
	test-rmint_arith_add_mg      \
	test-rmint_arith_add         \
	test-ruint_arith_add         \
	test-rint_arith_add          \
	test-rmint_arith_sub_mg      \
	test-rmint_arith_sub         \
	test-ruint_arith_sub         \
	test-rint_arith_sub          \
	test-rmint_arith_mul_mg      \
	test-rmint_arith_mul         \
	test-ruint_arith_mul         \
	test-rint_arith_mul          \
	test-rmint_arith_mod_mg      \
	test-rmint_arith_mod         \
	test-ruint_arith_div         \
	test-rint_arith_mod          \
	test-rmint_inv_div_mg        \
	test-rmint_inv_div           \
	test-rmint_constructors_mg   \
	test-rmint_constructors      \
	test-rmint_neg_mg            \
	test-rmint_neg               \
	test-rmint_comparisons_mg    \
	test-rmint_comparisons       \
	test-rmint_complex_mg        \
	test-rmint_complex           \
	test-recint_rand_mg          \
	test-recint_rand             \
	test-recint_exp_mg           \
	test-recint_exp              \
	test-recint_extra_mg         \
	test-recint_extra            \
	test-recint_convert_mg       \
	test-recint_convert          \
	test-recint_cast             \
	test-rmint_montgomery        \
	test-ruint_arazi             \
	test-ruint_comparisons       \
	test-ruint_complex           \
	test-ruint_constructors      \
	test-ruint_fiddling          \
	test-ruint_lmul              \
	test-ruint_operators         \
	test-ruint_shift             \
	test-ruint_square

test-random_SOURCES   = test-random.C
test-ifactor_SOURCES  = test-ifactor.C
test-ffarith_SOURCES  = test-ffarith.C
test-ringarith_SOURCES= test-ringarith.C
test-modularmulprecomp_SOURCES= test-modularmulprecomp.C
test-mod_SOURCES      = test-mod.C
test-modsqroot_SOURCES= test-modsqroot.C
test-trunc_SOURCES    = test-trunc.C
test-poly_SOURCES    = test-poly.C
test-crt_SOURCES      = test-crt.C
test-geom_SOURCES     = test-geom.C
test-integer_SOURCES  = test-integer.C
test-ratrecon_SOURCES = test-ratrecon.C
test-conversion_SOURCES = test-conversion.C

test-rmint_arith_addmul_mg_SOURCES   = test-rmint_arith.C
test-rmint_arith_addmul_SOURCES      = test-rmint_arith.C
test-ruint_arith_addmul_SOURCES      = test-ruint_arith.C
test-rmint_arith_add_mg_SOURCES      = test-rmint_arith.C
test-rmint_arith_add_SOURCES         = test-rmint_arith.C
test-ruint_arith_add_SOURCES         = test-ruint_arith.C
test-rint_arith_add_SOURCES          = test-rint_arith.C
test-rmint_arith_sub_mg_SOURCES      = test-rmint_arith.C
test-rmint_arith_sub_SOURCES         = test-rmint_arith.C
test-ruint_arith_sub_SOURCES         = test-ruint_arith.C
test-rint_arith_sub_SOURCES          = test-rint_arith.C
test-rmint_arith_mul_mg_SOURCES      = test-rmint_arith.C
test-rmint_arith_mul_SOURCES         = test-rmint_arith.C
test-ruint_arith_mul_SOURCES         = test-ruint_arith.C
test-rint_arith_mul_SOURCES          = test-rint_arith.C
test-rmint_arith_mod_mg_SOURCES      = test-rmint_arith.C
test-rmint_arith_mod_SOURCES         = test-rmint_arith.C
test-ruint_arith_div_SOURCES         = test-ruint_arith.C
test-rint_arith_mod_SOURCES          = test-rint_arith.C

test-rmint_inv_div_mg_SOURCES        = test-rmint_inv_div.C
test-rmint_inv_div_SOURCES           = test-rmint_inv_div.C
test-rmint_constructors_mg_SOURCES   = test-rmint_constructors.C
test-rmint_constructors_SOURCES      = test-rmint_constructors.C
test-rmint_neg_mg_SOURCES            = test-rmint_neg.C
test-rmint_neg_SOURCES               = test-rmint_neg.C
test-rmint_comparisons_mg_SOURCES    = test-rmint_comparisons.C
test-rmint_comparisons_SOURCES       = test-rmint_comparisons.C
test-rmint_complex_mg_SOURCES        = test-rmint_complex.C
test-rmint_complex_SOURCES           = test-rmint_complex.C
test-recint_rand_mg_SOURCES          = test-recint_rand.C
test-recint_rand_SOURCES             = test-recint_rand.C
test-recint_exp_mg_SOURCES           = test-recint_exp.C
test-recint_exp_SOURCES              = test-recint_exp.C
test-recint_extra_mg_SOURCES         = test-recint_extra.C
test-recint_extra_SOURCES            = test-recint_extra.C
test-recint_convert_mg_SOURCES       = test-recint_convert.C
test-recint_convert_SOURCES          = test-recint_convert.C

test-recint_cast_SOURCES         = test-recint_cast.C
test-rmint_montgomery_SOURCES    = test-rmint_montgomery.C
test-ruint_arazi_SOURCES         = test-ruint_arazi.C
test-ruint_comparisons_SOURCES   = test-ruint_comparisons.C
test-ruint_complex_SOURCES       = test-ruint_complex.C
test-ruint_constructors_SOURCES  = test-ruint_constructors.C
test-ruint_fiddling_SOURCES      = test-ruint_fiddling.C
test-ruint_lmul_SOURCES          = test-ruint_lmul.C
test-ruint_operators_SOURCES     = test-ruint_operators.C
test-ruint_shift_SOURCES         = test-ruint_shift.C
test-ruint_square_SOURCES        = test-ruint_square.C

test-rmint_arith_addmul_mg_CPPFLAGS  = -DMG_DEFAULT=MG_ACTIVE -DNOT_IN_PLACE -DRI_OP=addmul -DGMP_OP=mpz_addmul -DGMP_OPUI=mpz_addmul_ui
test-rmint_arith_addmul_CPPFLAGS     = -DNOT_IN_PLACE -DRI_OP=addmul -DGMP_OP=mpz_addmul -DGMP_OPUI=mpz_addmul_ui
test-ruint_arith_addmul_CPPFLAGS     = -DNOT_IN_PLACE -DRI_OP=addmul -DGMP_OP=mpz_addmul -DGMP_OPUI=mpz_addmul_ui
test-rmint_arith_add_mg_CPPFLAGS     = -DMG_DEFAULT=MG_ACTIVE -DRI_OP=add -DGMP_OP=mpz_add -DGMP_OPUI=mpz_add_ui
test-rmint_arith_add_CPPFLAGS        = -DRI_OP=add -DGMP_OP=mpz_add -DGMP_OPUI=mpz_add_ui
test-ruint_arith_add_CPPFLAGS        = -DRI_OP=add -DGMP_OP=mpz_add -DGMP_OPUI=mpz_add_ui
test-rint_arith_add_CPPFLAGS         = -DRI_OP=add -DGMP_OP=mpz_add -DGMP_OPUI=mpz_add_ui
test-rmint_arith_sub_mg_CPPFLAGS     = -DMG_DEFAULT=MG_ACTIVE -DRI_OP=sub -DGMP_OP=mpz_sub -DGMP_OPUI=mpz_sub_ui
test-rmint_arith_sub_CPPFLAGS        = -DRI_OP=sub -DGMP_OP=mpz_sub -DGMP_OPUI=mpz_sub_ui
test-ruint_arith_sub_CPPFLAGS        = -DRI_OP=sub -DGMP_OP=mpz_sub -DGMP_OPUI=mpz_sub_ui
test-rint_arith_sub_CPPFLAGS         = -DRI_OP=sub -DGMP_OP=mpz_sub -DGMP_OPUI=mpz_sub_ui
test-rmint_arith_mul_mg_CPPFLAGS     = -DMG_DEFAULT=MG_ACTIVE -DRI_OP=mul -DGMP_OP=mpz_mul -DGMP_OPUI=mpz_mul_ui
test-rmint_arith_mul_CPPFLAGS        = -DRI_OP=mul -DGMP_OP=mpz_mul -DGMP_OPUI=mpz_mul_ui
test-ruint_arith_mul_CPPFLAGS        = -DRI_OP=mul -DGMP_OP=mpz_mul -DGMP_OPUI=mpz_mul_ui
test-rint_arith_mul_CPPFLAGS         = -DRI_OP=mul -DGMP_OP=mpz_mul -DGMP_OPUI=mpz_mul_ui
test-rmint_arith_mod_mg_CPPFLAGS     = -DMG_DEFAULT=MG_ACTIVE -DRI_OP=mod -DGMP_OP=mpz_mod -DGMP_OPUI=mpz_mod_ui
test-rmint_arith_mod_CPPFLAGS        = -DRI_OP=mod -DGMP_OP=mpz_mod -DGMP_OPUI=mpz_mod_ui
test-ruint_arith_div_CPPFLAGS        = -DNOT_IN_PLACE -DRI_OP=div_q -DGMP_OP=mpz_fdiv_q -DGMP_OPUI=mpz_fdiv_q_ui
test-rint_arith_mod_CPPFLAGS         = -DARITH_MOD -DNOT_IN_PLACE -DRI_OP=div_r -DGMP_OP=mpz_tdiv_r

test-rmint_inv_div_mg_CPPFLAGS        = -DMG_DEFAULT=MG_ACTIVE
test-rmint_constructors_mg_CPPFLAGS   = -DMG_DEFAULT=MG_ACTIVE
test-rmint_neg_mg_CPPFLAGS            = -DMG_DEFAULT=MG_ACTIVE
test-rmint_comparisons_mg_CPPFLAGS    = -DMG_DEFAULT=MG_ACTIVE
test-rmint_complex_mg_CPPFLAGS        = -DMG_DEFAULT=MG_ACTIVE
test-recint_rand_mg_CPPFLAGS          = -DMG_DEFAULT=MG_ACTIVE
test-recint_exp_mg_CPPFLAGS           = -DMG_DEFAULT=MG_ACTIVE
test-recint_extra_mg_CPPFLAGS         = -DMG_DEFAULT=MG_ACTIVE
test-recint_convert_mg_CPPFLAGS       = -DMG_DEFAULT=MG_ACTIVE


all: $(TESTS)
	@PASS=0; \
	FAIL=0; \
	for TEST in $(TESTS); \
	do \
		./$$TEST > /dev/null ; \
		if [ $$? = 0 ]; \
		then \
		echo "PASS: $$TEST"; \
		PASS=$$(($$PASS+1)); \
	else \
		echo "FAIL: $$TEST"; \
		FAIL=$$(($$FAIL+1)); \
	fi; \
	done; \
	echo "========"; \
	echo "Summary:"; \
	echo "========"; \
	echo "PASS: $$PASS"; \
	echo "FAIL: $$FAIL"; \
	rm -f $(TESTS) *.o; \
	exit $$FAIL

$(TESTS):
	g++ $(CPPFLAGS) $($@_CPPFLAGS) tests/$($@_SOURCES) $(LIBS) -o $@