@@ -101,17 +101,16 @@ BC_FUZZER_C = $(BIN)/$(BC)_fuzzer_C
101
101
DC_FUZZER = $(BIN ) /$(DC ) _fuzzer_c
102
102
DC_FUZZER_C = $(BIN ) /$(DC ) _fuzzer_C
103
103
104
- BC_TEST_OUTPUTS = tests/bc_outputs
105
104
BC_FUZZ_OUTPUTS = tests/fuzzing/bc_outputs1 tests/fuzzing/bc_outputs2 tests/fuzzing/bc_outputs3
106
- DC_TEST_OUTPUTS = tests/dc_outputs
107
105
DC_FUZZ_OUTPUTS = tests/fuzzing/dc_outputs
108
106
109
107
LIB = libbcl
110
108
LIB_NAME = $(LIB ) .a
111
109
LIBBC = $(BIN ) /$(LIB_NAME )
112
110
BCL = bcl
113
- BCL_TEST = $(BIN ) /$(BCL )
114
- BCL_TEST_C = $(TESTSDIR ) /$(BCL ) .c
111
+
112
+ GENERATE_TESTS = %%GENERATE_TESTS%%
113
+ PROBLEMATIC_TESTS = %%PROBLEMATIC_TESTS%%
115
114
116
115
MANUALS = manuals
117
116
BC_MANPAGE_NAME = $(EXEC_PREFIX )$(BC )$(EXEC_SUFFIX ) .1
@@ -154,11 +153,11 @@ BC_ENABLE_EXTRA_MATH = %%EXTRA_MATH%%
154
153
BC_ENABLE_NLS = %%NLS%%
155
154
BC_EXCLUDE_EXTRA_MATH = %%EXCLUDE_EXTRA_MATH%%
156
155
157
- BC_ENABLE_AFL = %%FUZZ%%
158
- BC_ENABLE_OSSFUZZ = %%OSSFUZZ%%
159
- BC_ENABLE_MEMCHECK = %%MEMCHECK%%
156
+ BC_ENABLE_AFL = 0
157
+ BC_ENABLE_OSSFUZZ = 0
158
+ BC_ENABLE_MEMCHECK = 0
160
159
161
- LIB_FUZZING_ENGINE = %%LIB_FUZZING_ENGINE%%
160
+ LIB_FUZZING_ENGINE = 0
162
161
163
162
BC_DEFAULT_BANNER = %%BC_DEFAULT_BANNER%%
164
163
BC_DEFAULT_SIGINT_RESET = %%BC_DEFAULT_SIGINT_RESET%%
@@ -191,10 +190,6 @@ KARATSUBA = $(SCRIPTSDIR)/karatsuba.py
191
190
LOCALE_INSTALL = $(SCRIPTSDIR ) /locale_install.sh
192
191
LOCALE_UNINSTALL = $(SCRIPTSDIR ) /locale_uninstall.sh
193
192
194
- VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all
195
-
196
- TEST_STARS = ***********************************************************************
197
-
198
193
BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%%
199
194
200
195
BC_DEFS0 = -DBC_DEFAULT_BANNER=$(BC_DEFAULT_BANNER )
@@ -295,236 +290,10 @@ help:
295
290
@printf ' check alias for `make test`\n'
296
291
@printf ' clean removes all build files\n'
297
292
@printf ' clean_config removes all build files as well as the generated Makefile\n'
298
- @printf ' clean_tests removes all build files, the generated Makefile,\n'
299
- @printf ' and generated tests\n'
300
293
@printf ' install installs binaries to "%s%s"\n' " $( DESTDIR) " " $( BINDIR) "
301
294
@printf ' and (if enabled) manpages to "%s%s"\n' " $( DESTDIR) " " $( MAN1DIR) "
302
- @printf ' karatsuba runs the karatsuba script (requires Python 3)\n'
303
- @printf ' karatsuba_test runs the karatsuba script while running tests\n'
304
- @printf ' (requires Python 3)\n'
305
295
@printf ' uninstall uninstalls binaries from "%s%s"\n' " $( DESTDIR) " " $( BINDIR) "
306
296
@printf ' and (if enabled) manpages from "%s%s"\n' " $( DESTDIR) " " $( MAN1DIR) "
307
- @printf ' test runs the test suite\n'
308
- @printf ' test_bc runs the bc test suite, if bc has been built\n'
309
- @printf ' test_dc runs the dc test suite, if dc has been built\n'
310
- @printf ' time_test runs the test suite, displaying times for some things\n'
311
- @printf ' time_test_bc runs the bc test suite, displaying times for some things\n'
312
- @printf ' time_test_dc runs the dc test suite, displaying times for some things\n'
313
- @printf ' timeconst runs the test on the Linux timeconst.bc script,\n'
314
- @printf ' if it exists and bc has been built\n'
315
-
316
- run_all_tests : bc_all_tests timeconst_all_tests dc_all_tests
317
-
318
- run_all_tests_np : bc_all_tests_np timeconst_all_tests dc_all_tests_np
319
-
320
- bc_all_tests :
321
- %%BC_ALL_TESTS%%
322
-
323
- bc_all_tests_np :
324
- %%BC_ALL_TESTS_NP%%
325
-
326
- timeconst_all_tests :
327
- %%TIMECONST_ALL_TESTS%%
328
-
329
- dc_all_tests :
330
- %%DC_ALL_TESTS%%
331
-
332
- dc_all_tests_np :
333
- %%DC_ALL_TESTS_NP%%
334
-
335
- history_all_tests :
336
- %%HISTORY_TESTS%%
337
-
338
- check : test
339
-
340
- test : %% TESTS%%
341
-
342
- test_bc : test_bc_header test_bc_tests test_bc_scripts test_bc_errors test_bc_stdin test_bc_read test_bc_other
343
- @printf ' \nAll bc tests passed.\n\n$(TEST_STARS)\n'
344
-
345
- test_bc_tests :%% BC_TESTS%%
346
-
347
- test_bc_scripts :%% BC_SCRIPT_TESTS%%
348
-
349
- test_bc_stdin :
350
- @export BC_TEST_OUTPUT_DIR=" $( BUILDDIR) /tests" ; sh $(TESTSDIR ) /stdin.sh bc %%BC_TEST_EXEC%%
351
-
352
- test_bc_read :
353
- @export BC_TEST_OUTPUT_DIR=" $( BUILDDIR) /tests" ; sh $(TESTSDIR ) /read.sh bc %%BC_TEST_EXEC%%
354
-
355
- test_bc_errors : test_bc_error_lines%% BC_ERROR_TESTS%%
356
-
357
- test_bc_error_lines :
358
- @export BC_TEST_OUTPUT_DIR=" $( BUILDDIR) /tests" ; sh $(TESTSDIR ) /errors.sh bc %%BC_TEST_EXEC%%
359
-
360
- test_bc_other :
361
- @export BC_TEST_OUTPUT_DIR=" $( BUILDDIR) /tests" ; sh $(TESTSDIR ) /other.sh bc $(BC_ENABLE_EXTRA_MATH ) %%BC_TEST_EXEC%%
362
-
363
- test_bc_header :
364
- @printf ' $(TEST_STARS)\n\nRunning bc tests...\n\n'
365
-
366
- test_dc : test_dc_header test_dc_tests test_dc_scripts test_dc_errors test_dc_stdin test_dc_read test_dc_other
367
- @printf ' \nAll dc tests passed.\n\n$(TEST_STARS)\n'
368
-
369
- test_dc_tests :%% DC_TESTS%%
370
-
371
- test_dc_scripts :%% DC_SCRIPT_TESTS%%
372
-
373
- test_dc_stdin :
374
- @export BC_TEST_OUTPUT_DIR=" $( BUILDDIR) /tests" ; sh $(TESTSDIR ) /stdin.sh dc %%DC_TEST_EXEC%%
375
-
376
- test_dc_read :
377
- @export BC_TEST_OUTPUT_DIR=" $( BUILDDIR) /tests" ; sh $(TESTSDIR ) /read.sh dc %%DC_TEST_EXEC%%
378
-
379
- test_dc_errors : test_dc_error_lines%% DC_ERROR_TESTS%%
380
-
381
- test_dc_error_lines :
382
- @export BC_TEST_OUTPUT_DIR=" $( BUILDDIR) /tests" ; sh $(TESTSDIR ) /errors.sh dc %%DC_TEST_EXEC%%
383
-
384
- test_dc_other :
385
- @export BC_TEST_OUTPUT_DIR=" $( BUILDDIR) /tests" ; sh $(TESTSDIR ) /other.sh dc $(BC_ENABLE_EXTRA_MATH ) %%DC_TEST_EXEC%%
386
-
387
- test_dc_header :
388
- @printf ' $(TEST_STARS)\n\nRunning dc tests...\n\n'
389
-
390
- timeconst :
391
- %%TIMECONST%%
392
-
393
- test_history : test_history_header test_bc_history test_dc_history
394
- @printf ' \nAll history tests passed.\n\n$(TEST_STARS)\n'
395
-
396
- test_bc_history :%% BC_HISTORY_TEST_PREREQS%%
397
-
398
- test_bc_history_all : test_bc_history0 test_bc_history1 test_bc_history2 test_bc_history3 test_bc_history4 test_bc_history5 test_bc_history6 test_bc_history7 test_bc_history8 test_bc_history9 test_bc_history10 test_bc_history11 test_bc_history12 test_bc_history13 test_bc_history14 test_bc_history15 test_bc_history16 test_bc_history17 test_bc_history18 test_bc_history19 test_bc_history20 test_bc_history21
399
-
400
- test_bc_history_skip :
401
- @printf ' No bc history tests to run\n'
402
-
403
- test_bc_history0 :
404
- @sh $(TESTSDIR ) /history.sh bc 0 %%BC_TEST_EXEC%%
405
-
406
- test_bc_history1 :
407
- @sh $(TESTSDIR ) /history.sh bc 1 %%BC_TEST_EXEC%%
408
-
409
- test_bc_history2 :
410
- @sh $(TESTSDIR ) /history.sh bc 2 %%BC_TEST_EXEC%%
411
-
412
- test_bc_history3 :
413
- @sh $(TESTSDIR ) /history.sh bc 3 %%BC_TEST_EXEC%%
414
-
415
- test_bc_history4 :
416
- @sh $(TESTSDIR ) /history.sh bc 4 %%BC_TEST_EXEC%%
417
-
418
- test_bc_history5 :
419
- @sh $(TESTSDIR ) /history.sh bc 5 %%BC_TEST_EXEC%%
420
-
421
- test_bc_history6 :
422
- @sh $(TESTSDIR ) /history.sh bc 6 %%BC_TEST_EXEC%%
423
-
424
- test_bc_history7 :
425
- @sh $(TESTSDIR ) /history.sh bc 7 %%BC_TEST_EXEC%%
426
-
427
- test_bc_history8 :
428
- @sh $(TESTSDIR ) /history.sh bc 8 %%BC_TEST_EXEC%%
429
-
430
- test_bc_history9 :
431
- @sh $(TESTSDIR ) /history.sh bc 9 %%BC_TEST_EXEC%%
432
-
433
- test_bc_history10 :
434
- @sh $(TESTSDIR ) /history.sh bc 10 %%BC_TEST_EXEC%%
435
-
436
- test_bc_history11 :
437
- @sh $(TESTSDIR ) /history.sh bc 11 %%BC_TEST_EXEC%%
438
-
439
- test_bc_history12 :
440
- @sh $(TESTSDIR ) /history.sh bc 12 %%BC_TEST_EXEC%%
441
-
442
- test_bc_history13 :
443
- @sh $(TESTSDIR ) /history.sh bc 13 %%BC_TEST_EXEC%%
444
-
445
- test_bc_history14 :
446
- @sh $(TESTSDIR ) /history.sh bc 14 %%BC_TEST_EXEC%%
447
-
448
- test_bc_history15 :
449
- @sh $(TESTSDIR ) /history.sh bc 15 %%BC_TEST_EXEC%%
450
-
451
- test_bc_history16 :
452
- @sh $(TESTSDIR ) /history.sh bc 16 %%BC_TEST_EXEC%%
453
-
454
- test_bc_history17 :
455
- @sh $(TESTSDIR ) /history.sh bc 17 %%BC_TEST_EXEC%%
456
-
457
- test_bc_history18 :
458
- @sh $(TESTSDIR ) /history.sh bc 18 %%BC_TEST_EXEC%%
459
-
460
- test_bc_history19 :
461
- @sh $(TESTSDIR ) /history.sh bc 19 %%BC_TEST_EXEC%%
462
-
463
- test_bc_history20 :
464
- @sh $(TESTSDIR ) /history.sh bc 20 %%BC_TEST_EXEC%%
465
-
466
- test_bc_history21 :
467
- @sh $(TESTSDIR ) /history.sh bc 21 %%BC_TEST_EXEC%%
468
-
469
- test_dc_history :%% DC_HISTORY_TEST_PREREQS%%
470
-
471
- test_dc_history_all : test_dc_history0 test_dc_history1 test_dc_history2 test_dc_history3 test_dc_history4 test_dc_history5 test_dc_history6 test_dc_history7 test_dc_history8 test_dc_history9 test_dc_history10
472
-
473
- test_dc_history_skip :
474
- @printf ' No dc history tests to run\n'
475
-
476
- test_dc_history0 :
477
- @sh $(TESTSDIR ) /history.sh dc 0 %%DC_TEST_EXEC%%
478
-
479
- test_dc_history1 :
480
- @sh $(TESTSDIR ) /history.sh dc 1 %%DC_TEST_EXEC%%
481
-
482
- test_dc_history2 :
483
- @sh $(TESTSDIR ) /history.sh dc 2 %%DC_TEST_EXEC%%
484
-
485
- test_dc_history3 :
486
- @sh $(TESTSDIR ) /history.sh dc 3 %%DC_TEST_EXEC%%
487
-
488
- test_dc_history4 :
489
- @sh $(TESTSDIR ) /history.sh dc 4 %%DC_TEST_EXEC%%
490
-
491
- test_dc_history5 :
492
- @sh $(TESTSDIR ) /history.sh dc 5 %%DC_TEST_EXEC%%
493
-
494
- test_dc_history6 :
495
- @sh $(TESTSDIR ) /history.sh dc 6 %%DC_TEST_EXEC%%
496
-
497
- test_dc_history7 :
498
- @sh $(TESTSDIR ) /history.sh dc 7 %%DC_TEST_EXEC%%
499
-
500
- test_dc_history8 :
501
- @sh $(TESTSDIR ) /history.sh dc 8 %%DC_TEST_EXEC%%
502
-
503
- test_dc_history9 :
504
- @sh $(TESTSDIR ) /history.sh dc 9 %%DC_TEST_EXEC%%
505
-
506
- test_dc_history10 :
507
- @sh $(TESTSDIR ) /history.sh dc 10 %%DC_TEST_EXEC%%
508
-
509
- test_history_header :
510
- @printf ' $(TEST_STARS)\n\nRunning history tests...\n\n'
511
-
512
- library_test : $(LIBBC )
513
- $(CC ) $(CFLAGS ) -lpthread $(BCL_TEST_C ) $(LIBBC ) -o $(BCL_TEST )
514
-
515
- test_library : library_test
516
- %%BCL_TEST_EXEC%%
517
-
518
- karatsuba :
519
- %%KARATSUBA%%
520
-
521
- karatsuba_test :
522
- %%KARATSUBA_TEST%%
523
-
524
- coverage_output :
525
- %%COVERAGE_OUTPUT%%
526
-
527
- coverage :%% COVERAGE_PREREQS%%
528
297
529
298
manpages :
530
299
$(MANPAGE ) bc
@@ -561,37 +330,25 @@ clean_config: clean clean_benchmarks
561
330
@$(RM ) -f compile_commands.json
562
331
@$(RM ) -f $(BCL_PC )
563
332
564
- clean_coverage :
565
- @printf ' Cleaning coverage files...\n'
566
- @$(RM ) -f * .gcov
567
- @$(RM ) -f * .html * .css
568
- @$(RM ) -f * .gcda * .gcno
569
- @$(RM ) -f * .profraw
570
- @$(RM ) -f $(GCDA ) $(GCNO )
571
- @$(RM ) -f $(BC_GCDA ) $(BC_GCNO )
572
- @$(RM ) -f $(DC_GCDA ) $(DC_GCNO )
573
- @$(RM ) -f $(HISTORY_GCDA ) $(HISTORY_GCNO )
574
- @$(RM ) -f $(RAND_GCDA ) $(RAND_GCNO )
575
- @$(RM ) -f $(BC_LIB_GCDA ) $(BC_LIB_GCNO )
576
- @$(RM ) -f $(BC_LIB2_GCDA ) $(BC_LIB2_GCNO )
577
- @$(RM ) -f $(BC_HELP_GCDA ) $(BC_HELP_GCNO )
578
- @$(RM ) -f $(DC_HELP_GCDA ) $(DC_HELP_GCNO )
579
-
580
- clean_tests : clean clean_config clean_coverage
333
+ test :
334
+ @if [ $( BC_ENABLED) -ne 0 ]; then $(TESTSDIR ) /all.sh -n bc $(BC_ENABLE_EXTRA_MATH ) 1 $(GENERATE_TESTS ) $(PROBLEMATIC_TESTS ) $(BC_EXEC ) ; fi
335
+ @if [ $( DC_ENABLED) -ne 0 ]; then $(TESTSDIR ) /all.sh -n dc $(BC_ENABLE_EXTRA_MATH ) 1 $(GENERATE_TESTS ) $(PROBLEMATIC_TESTS ) $(DC_EXEC ) ; fi
336
+
337
+ clean_tests : clean clean_config
581
338
@printf ' Cleaning test files...\n'
582
339
@$(RM ) -fr $(BC_TEST_OUTPUTS ) $(DC_TEST_OUTPUTS )
583
340
@$(RM ) -fr $(BC_FUZZ_OUTPUTS ) $(DC_FUZZ_OUTPUTS )
584
- @$(RM ) -f $(TESTSDIR ) /bc/parse .txt $(TESTSDIR ) /bc/parse_results .txt
585
- @$(RM ) -f $(TESTSDIR ) /bc/print .txt $(TESTSDIR ) /bc/print_results .txt
341
+ @$(RM ) -f $(TESTSDIR ) /bc/parse_ * .txt $(TESTSDIR ) /bc/parse_ * _results .txt
342
+ @$(RM ) -f $(TESTSDIR ) /bc/print_ * .txt $(TESTSDIR ) /bc/print_ * _results .txt
586
343
@$(RM ) -f $(TESTSDIR ) /bc/bessel.txt $(TESTSDIR ) /bc/bessel_results.txt
587
344
@$(RM ) -f $(TESTSDIR ) /bc/strings2.txt $(TESTSDIR ) /bc/strings2_results.txt
588
345
@$(RM ) -f $(TESTSDIR ) /bc/scripts/bessel.txt
589
346
@$(RM ) -f $(TESTSDIR ) /bc/scripts/parse.txt
590
347
@$(RM ) -f $(TESTSDIR ) /bc/scripts/print.txt
591
- @$(RM ) -f $(TESTSDIR ) /bc/scripts/add .txt
592
- @$(RM ) -f $(TESTSDIR ) /bc/scripts/divide .txt
593
- @$(RM ) -f $(TESTSDIR ) /bc/scripts/multiply .txt
594
- @$(RM ) -f $(TESTSDIR ) /bc/scripts/subtract .txt
348
+ @$(RM ) -f $(TESTSDIR ) /bc/scripts/add_ * .txt
349
+ @$(RM ) -f $(TESTSDIR ) /bc/scripts/divide_ * .txt
350
+ @$(RM ) -f $(TESTSDIR ) /bc/scripts/multiply_ * .txt
351
+ @$(RM ) -f $(TESTSDIR ) /bc/scripts/subtract_ * .txt
595
352
@$(RM ) -f $(TESTSDIR ) /bc/scripts/strings2.txt
596
353
@$(RM ) -f $(TESTSDIR ) /dc/scripts/prime.txt
597
354
@$(RM ) -f .log_* .txt
0 commit comments