summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig155
1 files changed, 155 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index ce362ea..b555bd7 100644
--- a/build.zig
+++ b/build.zig
@@ -183,6 +183,14 @@ pub fn build(b: *std.Build) void {
183 .optimize = optimize, 183 .optimize = optimize,
184 }); 184 });
185 185
186 const code_point_t = b.addTest(.{
187 .name = "code_point",
188 .root_module = code_point,
189 .target = target,
190 .optimize = optimize,
191 });
192 const code_point_tr = b.addRunArtifact(code_point_t);
193
186 // Grapheme clusters 194 // Grapheme clusters
187 const grapheme_data = b.createModule(.{ 195 const grapheme_data = b.createModule(.{
188 .root_source_file = b.path("src/GraphemeData.zig"), 196 .root_source_file = b.path("src/GraphemeData.zig"),
@@ -191,6 +199,14 @@ pub fn build(b: *std.Build) void {
191 }); 199 });
192 grapheme_data.addAnonymousImport("gbp", .{ .root_source_file = gbp_gen_out }); 200 grapheme_data.addAnonymousImport("gbp", .{ .root_source_file = gbp_gen_out });
193 201
202 const grapheme_data_t = b.addTest(.{
203 .name = "grapheme_data",
204 .root_module = grapheme_data,
205 .target = target,
206 .optimize = optimize,
207 });
208 const grapheme_data_tr = b.addRunArtifact(grapheme_data_t);
209
194 const grapheme = b.addModule("grapheme", .{ 210 const grapheme = b.addModule("grapheme", .{
195 .root_source_file = b.path("src/grapheme.zig"), 211 .root_source_file = b.path("src/grapheme.zig"),
196 .target = target, 212 .target = target,
@@ -199,6 +215,14 @@ pub fn build(b: *std.Build) void {
199 grapheme.addImport("code_point", code_point); 215 grapheme.addImport("code_point", code_point);
200 grapheme.addImport("GraphemeData", grapheme_data); 216 grapheme.addImport("GraphemeData", grapheme_data);
201 217
218 const grapheme_t = b.addTest(.{
219 .name = "grapheme",
220 .root_module = grapheme,
221 .target = target,
222 .optimize = optimize,
223 });
224 const grapheme_tr = b.addRunArtifact(grapheme_t);
225
202 // ASCII utilities 226 // ASCII utilities
203 const ascii = b.addModule("ascii", .{ 227 const ascii = b.addModule("ascii", .{
204 .root_source_file = b.path("src/ascii.zig"), 228 .root_source_file = b.path("src/ascii.zig"),
@@ -206,6 +230,14 @@ pub fn build(b: *std.Build) void {
206 .optimize = optimize, 230 .optimize = optimize,
207 }); 231 });
208 232
233 const ascii_t = b.addTest(.{
234 .name = "ascii",
235 .root_module = ascii,
236 .target = target,
237 .optimize = optimize,
238 });
239 const ascii_tr = b.addRunArtifact(ascii_t);
240
209 // Fixed pitch font display width 241 // Fixed pitch font display width
210 const width_data = b.createModule(.{ 242 const width_data = b.createModule(.{
211 .root_source_file = b.path("src/WidthData.zig"), 243 .root_source_file = b.path("src/WidthData.zig"),
@@ -215,6 +247,14 @@ pub fn build(b: *std.Build) void {
215 width_data.addAnonymousImport("dwp", .{ .root_source_file = dwp_gen_out }); 247 width_data.addAnonymousImport("dwp", .{ .root_source_file = dwp_gen_out });
216 width_data.addImport("GraphemeData", grapheme_data); 248 width_data.addImport("GraphemeData", grapheme_data);
217 249
250 const width_data_t = b.addTest(.{
251 .name = "width_data",
252 .root_module = width_data,
253 .target = target,
254 .optimize = optimize,
255 });
256 const width_data_tr = b.addRunArtifact(width_data_t);
257
218 const display_width = b.addModule("DisplayWidth", .{ 258 const display_width = b.addModule("DisplayWidth", .{
219 .root_source_file = b.path("src/DisplayWidth.zig"), 259 .root_source_file = b.path("src/DisplayWidth.zig"),
220 .target = target, 260 .target = target,
@@ -226,6 +266,14 @@ pub fn build(b: *std.Build) void {
226 display_width.addImport("DisplayWidthData", width_data); 266 display_width.addImport("DisplayWidthData", width_data);
227 display_width.addOptions("options", options); // For testing 267 display_width.addOptions("options", options); // For testing
228 268
269 const display_width_t = b.addTest(.{
270 .name = "display_width",
271 .root_module = display_width,
272 .target = target,
273 .optimize = optimize,
274 });
275 const display_width_tr = b.addRunArtifact(display_width_t);
276
229 // Normalization 277 // Normalization
230 const ccc_data = b.createModule(.{ 278 const ccc_data = b.createModule(.{
231 .root_source_file = b.path("src/CombiningData.zig"), 279 .root_source_file = b.path("src/CombiningData.zig"),
@@ -234,6 +282,14 @@ pub fn build(b: *std.Build) void {
234 }); 282 });
235 ccc_data.addAnonymousImport("ccc", .{ .root_source_file = ccc_gen_out }); 283 ccc_data.addAnonymousImport("ccc", .{ .root_source_file = ccc_gen_out });
236 284
285 const ccc_data_t = b.addTest(.{
286 .name = "ccc_data",
287 .root_module = ccc_data,
288 .target = target,
289 .optimize = optimize,
290 });
291 const ccc_data_tr = b.addRunArtifact(ccc_data_t);
292
237 const canon_data = b.createModule(.{ 293 const canon_data = b.createModule(.{
238 .root_source_file = b.path("src/CanonData.zig"), 294 .root_source_file = b.path("src/CanonData.zig"),
239 .target = target, 295 .target = target,
@@ -241,6 +297,14 @@ pub fn build(b: *std.Build) void {
241 }); 297 });
242 canon_data.addAnonymousImport("canon", .{ .root_source_file = canon_gen_out }); 298 canon_data.addAnonymousImport("canon", .{ .root_source_file = canon_gen_out });
243 299
300 const canon_data_t = b.addTest(.{
301 .name = "canon_data",
302 .root_module = canon_data,
303 .target = target,
304 .optimize = optimize,
305 });
306 const canon_data_tr = b.addRunArtifact(canon_data_t);
307
244 const compat_data = b.createModule(.{ 308 const compat_data = b.createModule(.{
245 .root_source_file = b.path("src/CompatData.zig"), 309 .root_source_file = b.path("src/CompatData.zig"),
246 .target = target, 310 .target = target,
@@ -248,6 +312,14 @@ pub fn build(b: *std.Build) void {
248 }); 312 });
249 compat_data.addAnonymousImport("compat", .{ .root_source_file = compat_gen_out }); 313 compat_data.addAnonymousImport("compat", .{ .root_source_file = compat_gen_out });
250 314
315 const compat_data_t = b.addTest(.{
316 .name = "compat_data",
317 .root_module = compat_data,
318 .target = target,
319 .optimize = optimize,
320 });
321 const compat_data_tr = b.addRunArtifact(compat_data_t);
322
251 const hangul_data = b.createModule(.{ 323 const hangul_data = b.createModule(.{
252 .root_source_file = b.path("src/HangulData.zig"), 324 .root_source_file = b.path("src/HangulData.zig"),
253 .target = target, 325 .target = target,
@@ -255,6 +327,14 @@ pub fn build(b: *std.Build) void {
255 }); 327 });
256 hangul_data.addAnonymousImport("hangul", .{ .root_source_file = hangul_gen_out }); 328 hangul_data.addAnonymousImport("hangul", .{ .root_source_file = hangul_gen_out });
257 329
330 const hangul_data_t = b.addTest(.{
331 .name = "hangul_data",
332 .root_module = hangul_data,
333 .target = target,
334 .optimize = optimize,
335 });
336 const hangul_data_tr = b.addRunArtifact(hangul_data_t);
337
258 const normp_data = b.createModule(.{ 338 const normp_data = b.createModule(.{
259 .root_source_file = b.path("src/NormPropsData.zig"), 339 .root_source_file = b.path("src/NormPropsData.zig"),
260 .target = target, 340 .target = target,
@@ -262,6 +342,14 @@ pub fn build(b: *std.Build) void {
262 }); 342 });
263 normp_data.addAnonymousImport("normp", .{ .root_source_file = normp_gen_out }); 343 normp_data.addAnonymousImport("normp", .{ .root_source_file = normp_gen_out });
264 344
345 const normp_data_t = b.addTest(.{
346 .name = "normp_data",
347 .root_module = normp_data,
348 .target = target,
349 .optimize = optimize,
350 });
351 const normp_data_tr = b.addRunArtifact(normp_data_t);
352
265 const norm_data = b.createModule(.{ 353 const norm_data = b.createModule(.{
266 .root_source_file = b.path("src/NormData.zig"), 354 .root_source_file = b.path("src/NormData.zig"),
267 .target = target, 355 .target = target,
@@ -282,6 +370,14 @@ pub fn build(b: *std.Build) void {
282 norm.addImport("code_point", code_point); 370 norm.addImport("code_point", code_point);
283 norm.addImport("NormData", norm_data); 371 norm.addImport("NormData", norm_data);
284 372
373 const norm_data_t = b.addTest(.{
374 .name = "norm_data",
375 .root_module = norm_data,
376 .target = target,
377 .optimize = optimize,
378 });
379 const norm_data_tr = b.addRunArtifact(norm_data_t);
380
285 // General Category 381 // General Category
286 const gencat_data = b.addModule("GenCatData", .{ 382 const gencat_data = b.addModule("GenCatData", .{
287 .root_source_file = b.path("src/GenCatData.zig"), 383 .root_source_file = b.path("src/GenCatData.zig"),
@@ -290,6 +386,14 @@ pub fn build(b: *std.Build) void {
290 }); 386 });
291 gencat_data.addAnonymousImport("gencat", .{ .root_source_file = gencat_gen_out }); 387 gencat_data.addAnonymousImport("gencat", .{ .root_source_file = gencat_gen_out });
292 388
389 const gencat_data_t = b.addTest(.{
390 .name = "gencat_data",
391 .root_module = gencat_data,
392 .target = target,
393 .optimize = optimize,
394 });
395 const gencat_data_tr = b.addRunArtifact(gencat_data_t);
396
293 // Case folding 397 // Case folding
294 const fold_data = b.createModule(.{ 398 const fold_data = b.createModule(.{
295 .root_source_file = b.path("src/FoldData.zig"), 399 .root_source_file = b.path("src/FoldData.zig"),
@@ -307,6 +411,14 @@ pub fn build(b: *std.Build) void {
307 case_fold.addImport("FoldData", fold_data); 411 case_fold.addImport("FoldData", fold_data);
308 case_fold.addImport("Normalize", norm); 412 case_fold.addImport("Normalize", norm);
309 413
414 const case_fold_t = b.addTest(.{
415 .name = "case_fold",
416 .root_module = case_fold,
417 .target = target,
418 .optimize = optimize,
419 });
420 const case_fold_tr = b.addRunArtifact(case_fold_t);
421
310 // Letter case 422 // Letter case
311 const case_data = b.addModule("CaseData", .{ 423 const case_data = b.addModule("CaseData", .{
312 .root_source_file = b.path("src/CaseData.zig"), 424 .root_source_file = b.path("src/CaseData.zig"),
@@ -318,6 +430,14 @@ pub fn build(b: *std.Build) void {
318 case_data.addAnonymousImport("upper", .{ .root_source_file = upper_gen_out }); 430 case_data.addAnonymousImport("upper", .{ .root_source_file = upper_gen_out });
319 case_data.addAnonymousImport("lower", .{ .root_source_file = lower_gen_out }); 431 case_data.addAnonymousImport("lower", .{ .root_source_file = lower_gen_out });
320 432
433 const case_data_t = b.addTest(.{
434 .name = "case_data",
435 .root_module = case_data,
436 .target = target,
437 .optimize = optimize,
438 });
439 const case_data_tr = b.addRunArtifact(case_data_t);
440
321 // Scripts 441 // Scripts
322 const scripts_data = b.addModule("ScriptsData", .{ 442 const scripts_data = b.addModule("ScriptsData", .{
323 .root_source_file = b.path("src/ScriptsData.zig"), 443 .root_source_file = b.path("src/ScriptsData.zig"),
@@ -326,6 +446,14 @@ pub fn build(b: *std.Build) void {
326 }); 446 });
327 scripts_data.addAnonymousImport("scripts", .{ .root_source_file = scripts_gen_out }); 447 scripts_data.addAnonymousImport("scripts", .{ .root_source_file = scripts_gen_out });
328 448
449 const scripts_data_t = b.addTest(.{
450 .name = "scripts_data",
451 .root_module = scripts_data,
452 .target = target,
453 .optimize = optimize,
454 });
455 const scripts_data_tr = b.addRunArtifact(scripts_data_t);
456
329 // Properties 457 // Properties
330 const props_data = b.addModule("PropsData", .{ 458 const props_data = b.addModule("PropsData", .{
331 .root_source_file = b.path("src/PropsData.zig"), 459 .root_source_file = b.path("src/PropsData.zig"),
@@ -336,6 +464,14 @@ pub fn build(b: *std.Build) void {
336 props_data.addAnonymousImport("props", .{ .root_source_file = props_gen_out }); 464 props_data.addAnonymousImport("props", .{ .root_source_file = props_gen_out });
337 props_data.addAnonymousImport("numeric", .{ .root_source_file = num_gen_out }); 465 props_data.addAnonymousImport("numeric", .{ .root_source_file = num_gen_out });
338 466
467 const props_data_t = b.addTest(.{
468 .name = "props_data",
469 .root_module = props_data,
470 .target = target,
471 .optimize = optimize,
472 });
473 const props_data_tr = b.addRunArtifact(props_data_t);
474
339 // Unicode Tests 475 // Unicode Tests
340 const unicode_tests = b.addTest(.{ 476 const unicode_tests = b.addTest(.{
341 .root_source_file = b.path("src/unicode_tests.zig"), 477 .root_source_file = b.path("src/unicode_tests.zig"),
@@ -349,4 +485,23 @@ pub fn build(b: *std.Build) void {
349 485
350 const unicode_test_step = b.step("unicode-test", "Run Unicode tests"); 486 const unicode_test_step = b.step("unicode-test", "Run Unicode tests");
351 unicode_test_step.dependOn(&run_unicode_tests.step); 487 unicode_test_step.dependOn(&run_unicode_tests.step);
488
489 const test_step = b.step("test", "Run general tests");
490 test_step.dependOn(&code_point_tr.step);
491 test_step.dependOn(&grapheme_data_tr.step);
492 test_step.dependOn(&width_data_tr.step);
493 test_step.dependOn(&display_width_tr.step);
494 test_step.dependOn(&grapheme_tr.step);
495 test_step.dependOn(&ascii_tr.step);
496 test_step.dependOn(&ccc_data_tr.step);
497 test_step.dependOn(&canon_data_tr.step);
498 test_step.dependOn(&compat_data_tr.step);
499 test_step.dependOn(&hangul_data_tr.step);
500 test_step.dependOn(&normp_data_tr.step);
501 test_step.dependOn(&norm_data_tr.step);
502 test_step.dependOn(&gencat_data_tr.step);
503 test_step.dependOn(&case_fold_tr.step);
504 test_step.dependOn(&case_data_tr.step);
505 test_step.dependOn(&scripts_data_tr.step);
506 test_step.dependOn(&props_data_tr.step);
352} 507}