summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/libxml/libxml2/runtest.patch
blob: c7a90cd3dc06b52cb98a012fdb0e0f4e16a05edb (plain)
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
From 6172ccd1e74bc181f5298f19e240234e12876abe Mon Sep 17 00:00:00 2001
From: Tony Tascioglu <tony.tascioglu@windriver.com>
Date: Tue, 11 May 2021 11:57:46 -0400
Subject: [PATCH] Add 'install-ptest' rule.

Print a standard result line for each test.

Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Upstream-Status: Pending

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com>
---
 Makefile.am   |   9 +++
 runsuite.c    |   1 +
 runtest.c     |   2 +
 runxmlconf.c  |   1 +
 testapi.c     | 122 ++++++++++++++++++++++++++-------------
 testchar.c    | 156 +++++++++++++++++++++++++++++++++++---------------
 testdict.c    |   1 +
 testlimits.c  |   1 +
 testrecurse.c |   2 +
 9 files changed, 210 insertions(+), 85 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 05d1671f..ae622745 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -198,6 +198,15 @@ runxmlconf_LDADD= $(LDADDS)
 #testOOM_DEPENDENCIES = $(DEPS)
 #testOOM_LDADD= $(LDADDS)
 
+install-ptest:
+	@(if [ -d .libs ] ; then cd .libs; fi; \
+	install $(check_PROGRAMS) $(DESTDIR))
+	cp -r $(srcdir)/test $(DESTDIR)
+	cp -r $(srcdir)/result $(DESTDIR)
+	cp -r $(srcdir)/python $(DESTDIR)
+	cp Makefile $(DESTDIR)
+	sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
+
 runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
           testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
 	[ -d test   ] || $(LN_S) $(srcdir)/test   .
diff --git a/runsuite.c b/runsuite.c
index d24b5ec3..f7ff2521 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -1147,6 +1147,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
 
     if (logfile != NULL)
         fclose(logfile);
+    printf("%s: runsuite\n\n", (ret == 0) ? "PASS" : "FAIL");
     return(ret);
 }
 #else /* !SCHEMAS */
diff --git a/runtest.c b/runtest.c
index ffa98d04..470f95cb 100644
--- a/runtest.c
+++ b/runtest.c
@@ -4508,6 +4508,7 @@ launchTests(testDescPtr tst) {
     xmlCharEncCloseFunc(ebcdicHandler);
     xmlCharEncCloseFunc(eucJpHandler);
 
+    printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
     return(err);
 }
 
@@ -4588,6 +4589,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
     xmlCleanupParser();
     xmlMemoryDump();
 
+    printf("%s: runtest\n\n", (ret == 0) ? "PASS" : "FAIL");
     return(ret);
 }
 
diff --git a/runxmlconf.c b/runxmlconf.c
index 70f61017..e882b3a1 100644
--- a/runxmlconf.c
+++ b/runxmlconf.c
@@ -595,6 +595,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
 
     if (logfile != NULL)
         fclose(logfile);
+    printf("%s: runxmlconf\n", (ret == 0) ? "PASS" : "FAIL");
     return(ret);
 }
 
diff --git a/testapi.c b/testapi.c
index ff8b470d..52b51d78 100644
--- a/testapi.c
+++ b/testapi.c
@@ -1246,49 +1246,91 @@ static int
 testlibxml2(void)
 {
     int test_ret = 0;
-
-    test_ret += test_HTMLparser();
-    test_ret += test_HTMLtree();
-    test_ret += test_SAX2();
-    test_ret += test_c14n();
-    test_ret += test_catalog();
-    test_ret += test_chvalid();
-    test_ret += test_debugXML();
-    test_ret += test_dict();
-    test_ret += test_encoding();
-    test_ret += test_entities();
-    test_ret += test_hash();
-    test_ret += test_list();
-    test_ret += test_nanoftp();
-    test_ret += test_nanohttp();
-    test_ret += test_parser();
-    test_ret += test_parserInternals();
-    test_ret += test_pattern();
-    test_ret += test_relaxng();
-    test_ret += test_schemasInternals();
-    test_ret += test_schematron();
-    test_ret += test_tree();
-    test_ret += test_uri();
-    test_ret += test_valid();
-    test_ret += test_xinclude();
-    test_ret += test_xmlIO();
-    test_ret += test_xmlautomata();
-    test_ret += test_xmlerror();
-    test_ret += test_xmlmodule();
-    test_ret += test_xmlreader();
-    test_ret += test_xmlregexp();
-    test_ret += test_xmlsave();
-    test_ret += test_xmlschemas();
-    test_ret += test_xmlschemastypes();
-    test_ret += test_xmlstring();
-    test_ret += test_xmlunicode();
-    test_ret += test_xmlwriter();
-    test_ret += test_xpath();
-    test_ret += test_xpathInternals();
-    test_ret += test_xpointer();
+    int ret = 0;
+
+    test_ret += (ret = test_HTMLparser());
+    printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_HTMLtree());
+    printf("%s: HTMLtree\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_SAX2());
+    printf("%s: SAX2\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_c14n());
+    printf("%s: c14n\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_catalog());
+    printf("%s: catalog\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_chvalid());
+    printf("%s: chvalid\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_debugXML());
+    printf("%s: debugXML\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_dict());
+    printf("%s: dict\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_encoding());
+    printf("%s: encoding\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_entities());
+    printf("%s: entities\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_hash());
+    printf("%s: hash\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_list());
+    printf("%s: list\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_nanoftp());
+    printf("%s: nanoftp\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_nanohttp());
+    printf("%s: nanohttp\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_parser());
+    printf("%s: parser\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_parserInternals());
+    printf("%s: parserInternals\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_pattern());
+    printf("%s: pattern\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_relaxng());
+    printf("%s: relaxng\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_schemasInternals());
+    printf("%s: schemasInternals\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_schematron());
+    printf("%s: schematron\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_tree());
+    printf("%s: tree\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_uri());
+    printf("%s: uri\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_valid());
+    printf("%s: valid\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xinclude());
+    printf("%s: xinclude\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlIO());
+    printf("%s: xmlIO\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlautomata());
+    printf("%s: xmlautomata\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlerror());
+    printf("%s: xmlerror\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlmodule());
+    printf("%s: xmlmodule\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlreader());
+    printf("%s: xmlreader\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlregexp());
+    printf("%s: xmlregexp\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlsave());
+    printf("%s: xmlsave\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlschemas());
+    printf("%s: xmlschemas\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlschemastypes());
+    printf("%s: xmlschemastypes\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlstring());
+    printf("%s: xmlstring\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlunicode());
+    printf("%s: xmlunicode\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xmlwriter());
+    printf("%s: xmlwriter\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xpath());
+    printf("%s: xpath\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xpathInternals());
+    printf("%s: xpathInternals\n", (ret == 0) ? "PASS" : "FAIL");
+    test_ret += (ret = test_xpointer());
+    printf("%s: xpointer\n", (ret == 0) ? "PASS" : "FAIL");
 
     printf("Total: %d functions, %d tests, %d errors\n",
            function_tests, call_tests, test_ret);
+
+    printf("%s: testapi\n\n", (test_ret == 0) ? "PASS" : "FAIL");
     return(test_ret);
 }
 
diff --git a/testchar.c b/testchar.c
index 6866a175..7bce0132 100644
--- a/testchar.c
+++ b/testchar.c
@@ -23,7 +23,7 @@ static void errorHandler(void *unused, xmlErrorPtr err) {
 char document1[100] = "<doc>XXXX</doc>";
 char document2[100] = "<doc foo='XXXX'/>";
 
-static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
+static int testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
                   int len,  char *data, int forbid1, int forbid2) {
     int i;
     xmlDocPtr res;
@@ -37,33 +37,41 @@ static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
 	res = xmlReadMemory(document, len, "test", NULL, 0);
 
 	if ((i == forbid1) || (i == forbid2)) {
-	    if ((lastError == 0) || (res != NULL))
+	    if ((lastError == 0) || (res != NULL)) {
 	        fprintf(stderr,
 		    "Failed to detect invalid char for Byte 0x%02X: %c\n",
 		        i, i);
+		return(1);
+	    }
 	}
 
 	else if ((i == '<') || (i == '&')) {
-	    if ((lastError == 0) || (res != NULL))
+	    if ((lastError == 0) || (res != NULL)) {
 	        fprintf(stderr,
 		    "Failed to detect illegal char %c for Byte 0x%02X\n", i, i);
+		return(1);
+	    }
 	}
 	else if (((i < 0x20) || (i >= 0x80)) &&
 	    (i != 0x9) && (i != 0xA) && (i != 0xD)) {
-	    if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL))
+	    if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL)) {
 	        fprintf(stderr,
 		    "Failed to detect invalid char for Byte 0x%02X\n", i);
+		return(1);
+	    }
 	}
 	else if (res == NULL) {
 	    fprintf(stderr,
 		"Failed to parse valid char for Byte 0x%02X : %c\n", i, i);
+		return(1);
 	}
 	if (res != NULL)
 	    xmlFreeDoc(res);
     }
+    return(0);
 }
 
-static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
+static int testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
                   int len,  char *data) {
     int i, j;
     xmlDocPtr res;
@@ -80,10 +88,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
 
 	/* if first bit of first char is set, then second bit must too */
 	if ((i & 0x80) && ((i & 0x40) == 0)) {
-	    if ((lastError == 0) || (res != NULL))
+	    if ((lastError == 0) || (res != NULL)) {
 		fprintf(stderr,
 		"Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
 			i, j);
+		return(1);
+	    }
 	}
 
 	/*
@@ -91,10 +101,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
 	 * bits must be 10
 	 */
 	else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
-	    if ((lastError == 0) || (res != NULL))
+	    if ((lastError == 0) || (res != NULL)) {
 		fprintf(stderr,
 	    "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
 			i, j);
+		return(1);
+	    }
 	}
 
 	/*
@@ -102,10 +114,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
 	 * than 0x80, i.e. one of bits 5 to 1 of i must be set
 	 */
 	else if ((i & 0x80) && ((i & 0x1E) == 0)) {
-	    if ((lastError == 0) || (res != NULL))
+	    if ((lastError == 0) || (res != NULL)) {
 		fprintf(stderr,
 	    "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
 			i, j);
+		return(1);
+	    }
 	}
 
 	/*
@@ -113,10 +127,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
 	 * at least 3 bytes, but we give only 2 !
 	 */
 	else if ((i & 0xE0) == 0xE0) {
-	    if ((lastError == 0) || (res != NULL))
+	    if ((lastError == 0) || (res != NULL)) {
 		fprintf(stderr,
 	    "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
 			i, j);
+		return(1);
+	    }
 	}
 
 	/*
@@ -125,11 +141,13 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
 	else if ((lastError != 0) || (res == NULL)) {
 	    fprintf(stderr,
 		"Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j);
+	    return(1);
 	}
 	if (res != NULL)
 	    xmlFreeDoc(res);
     }
     }
+    return(0);
 }
 
 /**
@@ -141,9 +159,10 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
  * CDATA in text or in attribute values.
  */
 
-static void testDocumentRanges(void) {
+static int testDocumentRanges(void) {
     xmlParserCtxtPtr ctxt;
     char *data;
+    int test_ret = 0;
 
     /*
      * Set up a parsing context using the first document as
@@ -152,7 +171,7 @@ static void testDocumentRanges(void) {
     ctxt = xmlNewParserCtxt();
     if (ctxt == NULL) {
         fprintf(stderr, "Failed to allocate parser context\n");
-	return;
+	return(1);
     }
 
     printf("testing 1 byte char in document: 1");
@@ -163,7 +182,7 @@ static void testDocumentRanges(void) {
     data[2] = ' ';
     data[3] = ' ';
     /* test 1 byte injection at beginning of area */
-    testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
+    test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
                            data, -1, -1);
     printf(" 2");
     fflush(stdout);
@@ -172,7 +191,7 @@ static void testDocumentRanges(void) {
     data[2] = ' ';
     data[3] = ' ';
     /* test 1 byte injection at end of area */
-    testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
+    test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
                            data + 3, -1, -1);
 
     printf(" 3");
@@ -183,7 +202,7 @@ static void testDocumentRanges(void) {
     data[2] = ' ';
     data[3] = ' ';
     /* test 1 byte injection at beginning of area */
-    testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
+    test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
                            data, '\'', -1);
     printf(" 4");
     fflush(stdout);
@@ -192,7 +211,7 @@ static void testDocumentRanges(void) {
     data[2] = ' ';
     data[3] = ' ';
     /* test 1 byte injection at end of area */
-    testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
+    test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
                            data + 3, '\'', -1);
     printf(" done\n");
 
@@ -204,7 +223,7 @@ static void testDocumentRanges(void) {
     data[2] = ' ';
     data[3] = ' ';
     /* test 2 byte injection at beginning of area */
-    testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
+    test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
                            data);
     printf(" 2");
     fflush(stdout);
@@ -213,7 +232,7 @@ static void testDocumentRanges(void) {
     data[2] = ' ';
     data[3] = ' ';
     /* test 2 byte injection at end of area */
-    testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
+    test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
                            data + 2);
 
     printf(" 3");
@@ -224,7 +243,7 @@ static void testDocumentRanges(void) {
     data[2] = ' ';
     data[3] = ' ';
     /* test 2 byte injection at beginning of area */
-    testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
+    test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
                            data);
     printf(" 4");
     fflush(stdout);
@@ -233,14 +252,15 @@ static void testDocumentRanges(void) {
     data[2] = ' ';
     data[3] = ' ';
     /* test 2 byte injection at end of area */
-    testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
+    test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
                            data + 2);
     printf(" done\n");
 
     xmlFreeParserCtxt(ctxt);
+    return(test_ret);
 }
 
-static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
+static int testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
     int i = 0;
     int len, c;
 
@@ -255,19 +275,25 @@ static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
         c = xmlCurrentChar(ctxt, &len);
 	if ((i == 0) || (i >= 0x80)) {
 	    /* we must see an error there */
-	    if (lastError != XML_ERR_INVALID_CHAR)
+	    if (lastError != XML_ERR_INVALID_CHAR) {
 	        fprintf(stderr,
 		    "Failed to detect invalid char for Byte 0x%02X\n", i);
+		return(1);
+	    }
 	} else if (i == 0xD) {
-	    if ((c != 0xA) || (len != 1))
+	    if ((c != 0xA) || (len != 1)) {
 		fprintf(stderr, "Failed to convert char for Byte 0x%02X\n", i);
+		return(1);
+	    }
 	} else if ((c != i) || (len != 1)) {
 	    fprintf(stderr, "Failed to parse char for Byte 0x%02X\n", i);
+	    return(1);
 	}
     }
+    return(0);
 }
 
-static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
+static int testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
     int i, j;
     int len, c;
 
@@ -284,10 +310,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
 
 	    /* if first bit of first char is set, then second bit must too */
 	    if ((i & 0x80) && ((i & 0x40) == 0)) {
-		if (lastError != XML_ERR_INVALID_CHAR)
+		if (lastError != XML_ERR_INVALID_CHAR) {
 		    fprintf(stderr,
 		    "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
 		            i, j);
+		    return(1);
+		}
 	    }
 
 	    /*
@@ -295,10 +323,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
 	     * bits must be 10
 	     */
 	    else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
-		if (lastError != XML_ERR_INVALID_CHAR)
+		if (lastError != XML_ERR_INVALID_CHAR) {
 		    fprintf(stderr,
 		"Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
 		            i, j, c);
+		    return(1);
+		}
 	    }
 
 	    /*
@@ -306,10 +336,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
 	     * than 0x80, i.e. one of bits 5 to 1 of i must be set
 	     */
 	    else if ((i & 0x80) && ((i & 0x1E) == 0)) {
-		if (lastError != XML_ERR_INVALID_CHAR)
+		if (lastError != XML_ERR_INVALID_CHAR) {
 		    fprintf(stderr,
 		"Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
 		            i, j, c);
+		    return(1);
+		}
 	    }
 
 	    /*
@@ -317,10 +349,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
 	     * at least 3 bytes, but we give only 2 !
 	     */
 	    else if ((i & 0xE0) == 0xE0) {
-		if (lastError != XML_ERR_INVALID_CHAR)
+		if (lastError != XML_ERR_INVALID_CHAR) {
 		    fprintf(stderr,
 		"Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
 		            i, j);
+		    return(1);
+		}
 	    }
 
             /*
@@ -329,6 +363,7 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
 	    else if ((lastError != 0) || (len != 2)) {
 		fprintf(stderr,
 		    "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j);
+		return(1);
 	    }
 
             /*
@@ -338,12 +373,14 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
 		fprintf(stderr,
 	"Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n",
 	                i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c);
+		return(1);
 	    }
         }
     }
+    return(0);
 }
 
-static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
+static int testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
     int i, j, k, K;
     int len, c;
     unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
@@ -368,20 +405,24 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
 	 * at least 4 bytes, but we give only 3 !
 	 */
 	if ((i & 0xF0) == 0xF0) {
-	    if (lastError != XML_ERR_INVALID_CHAR)
+	    if (lastError != XML_ERR_INVALID_CHAR) {
 		fprintf(stderr,
 	"Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
 			i, j, K, data[3]);
+		return(1);
+	    }
 	}
 
         /*
 	 * The second and the third bytes must start with 10
 	 */
 	else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80)) {
-	    if (lastError != XML_ERR_INVALID_CHAR)
+	    if (lastError != XML_ERR_INVALID_CHAR) {
 		fprintf(stderr,
 	"Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
 			i, j, K);
+		return(1);
+	    }
 	}
 
 	/*
@@ -390,10 +431,12 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
 	 * the 6th byte of data[1] must be set
 	 */
 	else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) {
-	    if (lastError != XML_ERR_INVALID_CHAR)
+	    if (lastError != XML_ERR_INVALID_CHAR) {
 		fprintf(stderr,
 	    "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
 			i, j, K);
+		return(1);
+	    }
 	}
 
         /*
@@ -401,10 +444,12 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
 	 */
 	else if (((value > 0xD7FF) && (value <0xE000)) ||
 	         ((value > 0xFFFD) && (value <0x10000))) {
-	    if (lastError != XML_ERR_INVALID_CHAR)
+	    if (lastError != XML_ERR_INVALID_CHAR) {
 		fprintf(stderr,
 	"Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X\n",
 			value, i, j, K);
+		return(1);
+	    }
 	}
 
 	/*
@@ -414,6 +459,7 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
 	    fprintf(stderr,
 		"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
 		    i, j, K);
+	    return(1);
 	}
 
 	/*
@@ -423,13 +469,15 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
 	    fprintf(stderr,
     "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
 		i, j, data[2], value, c);
+	    return(1);
 	}
     }
     }
     }
+    return(0);
 }
 
-static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
+static int testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
     int i, j, k, K, l, L;
     int len, c;
     unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
@@ -458,10 +506,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
 	 * at least 5 bytes, but we give only 4 !
 	 */
 	if ((i & 0xF8) == 0xF8) {
-	    if (lastError != XML_ERR_INVALID_CHAR)
+	    if (lastError != XML_ERR_INVALID_CHAR) {
 		fprintf(stderr,
   "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
 			i, j, K, data[3]);
+		return(1);
+	    }
 	}
 
         /*
@@ -469,10 +519,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
 	 */
 	else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) ||
 	         ((L & 0xC0) != 0x80)) {
-	    if (lastError != XML_ERR_INVALID_CHAR)
+	    if (lastError != XML_ERR_INVALID_CHAR) {
 		fprintf(stderr,
 	"Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
 			i, j, K, L);
+		return(1);
+	    }
 	}
 
 	/*
@@ -481,10 +533,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
 	 * the 6 or 5th byte of j must be set
 	 */
 	else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) {
-	    if (lastError != XML_ERR_INVALID_CHAR)
+	    if (lastError != XML_ERR_INVALID_CHAR) {
 		fprintf(stderr,
 	"Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
 			i, j, K, L);
+		return(1);
+	    }
 	}
 
         /*
@@ -493,10 +547,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
 	else if (((value > 0xD7FF) && (value <0xE000)) ||
 	         ((value > 0xFFFD) && (value <0x10000)) ||
 		 (value > 0x10FFFF)) {
-	    if (lastError != XML_ERR_INVALID_CHAR)
+	    if (lastError != XML_ERR_INVALID_CHAR) {
 		fprintf(stderr,
 "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
 			value, i, j, K, L);
+		return(1);
+	    }
 	}
 
 	/*
@@ -506,6 +562,7 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
 	    fprintf(stderr,
 		"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
 		    i, j, K);
+	    return(1);
 	}
 
 	/*
@@ -515,11 +572,13 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
 	    fprintf(stderr,
     "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
 		i, j, data[2], value, c);
+	    return(1);
 	}
     }
     }
     }
     }
+    return(0);
 }
 
 /**
@@ -530,11 +589,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
  * cover the full range of UTF-8 chars accepted by XML-1.0
  */
 
-static void testCharRanges(void) {
+static int testCharRanges(void) {
     char data[5];
     xmlParserCtxtPtr ctxt;
     xmlParserInputBufferPtr buf;
     xmlParserInputPtr input;
+    int test_ret = 0;
 
     memset(data, 0, 5);
 
@@ -545,17 +605,19 @@ static void testCharRanges(void) {
     ctxt = xmlNewParserCtxt();
     if (ctxt == NULL) {
         fprintf(stderr, "Failed to allocate parser context\n");
-	return;
+	return(1);
     }
     buf = xmlParserInputBufferCreateStatic(data, sizeof(data),
                                            XML_CHAR_ENCODING_NONE);
     if (buf == NULL) {
         fprintf(stderr, "Failed to allocate input buffer\n");
+	test_ret = 1;
 	goto error;
     }
     input = xmlNewInputStream(ctxt);
     if (input == NULL) {
         xmlFreeParserInputBuffer(buf);
+	test_ret = 1;
 	goto error;
     }
     input->filename = NULL;
@@ -567,25 +629,28 @@ static void testCharRanges(void) {
 
     printf("testing char range: 1");
     fflush(stdout);
-    testCharRangeByte1(ctxt, data);
+    test_ret += testCharRangeByte1(ctxt, data);
     printf(" 2");
     fflush(stdout);
-    testCharRangeByte2(ctxt, data);
+    test_ret += testCharRangeByte2(ctxt, data);
     printf(" 3");
     fflush(stdout);
-    testCharRangeByte3(ctxt, data);
+    test_ret += testCharRangeByte3(ctxt, data);
     printf(" 4");
     fflush(stdout);
-    testCharRangeByte4(ctxt, data);
+    test_ret += testCharRangeByte4(ctxt, data);
     printf(" done\n");
     fflush(stdout);
 
 error:
     xmlFreeParserCtxt(ctxt);
+    return(test_ret);
 }
 
 int main(void) {
 
+    int ret = 0;
+
     /*
      * this initialize the library and check potential ABI mismatches
      * between the version it was compiled for and the actual shared
@@ -602,8 +667,9 @@ int main(void) {
     /*
      * Run the tests
      */
-    testCharRanges();
-    testDocumentRanges();
+    ret += testCharRanges();
+    ret += testDocumentRanges();
+    printf("%s: testchar\n\n", (ret == 0) ? "PASS" : "FAIL");
 
     /*
      * Cleanup function for the XML library.
diff --git a/testdict.c b/testdict.c
index 40bebd05..114b9347 100644
--- a/testdict.c
+++ b/testdict.c
@@ -440,5 +440,6 @@ int main(void)
     clean_strings();
     xmlCleanupParser();
     xmlMemoryDump();
+    printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL");
     return(ret);
 }
diff --git a/testlimits.c b/testlimits.c
index 059116a6..f0bee68d 100644
--- a/testlimits.c
+++ b/testlimits.c
@@ -1634,5 +1634,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
     xmlCleanupParser();
     xmlMemoryDump();
 
+    printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL");
     return(ret);
 }
diff --git a/testrecurse.c b/testrecurse.c
index 0cbe25a6..3ecadb40 100644
--- a/testrecurse.c
+++ b/testrecurse.c
@@ -892,6 +892,7 @@ launchTests(testDescPtr tst) {
 	    err++;
 	}
     }
+    printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
     return(err);
 }
 
@@ -961,5 +962,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
     xmlCleanupParser();
     xmlMemoryDump();
 
+    printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL");
     return(ret);
 }
-- 
2.25.1