Almost-minimal filesystem based blog.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
1.5 KiB

17 years ago
16 years ago
17 years ago
17 years ago
16 years ago
17 years ago
16 years ago
17 years ago
16 years ago
16 years ago
17 years ago
17 years ago
16 years ago
17 years ago
16 years ago
17 years ago
  1. #!/usr/bin/perl
  2. =pod
  3. =head1 NAME
  4. validate.pl - W3C validate markup from Display.pm
  5. =head1 SYNOPSIS
  6. Given a working installation and configuration file:
  7. ./validate.pl
  8. =head1 DESCRIPTION
  9. These tests are aimed at a working installation with several files in place,
  10. and require Test::HTML::W3C as well as Test::Simple. For the time being, I'm
  11. using "valid W3C HTML" as a proxy for "not broken", and a number of larger
  12. pages as a proxy for their component features.
  13. =head1 SEE ALSO
  14. Test::HTML::W3C.
  15. =cut
  16. use strict;
  17. use warnings;
  18. use lib 'lib';
  19. use lib 'wala';
  20. use lib 'wala/lib';
  21. use Test::HTML::W3C 'show_detail';
  22. use Test::Simple tests => 4;
  23. use Display;
  24. # TESTS
  25. section ('configuration');
  26. our (%WalaConf, %DISPLAY_CONF);
  27. ok (do("conf.pl"), "configuration on conf.pl");
  28. # This will turn off stuff that breaks testing.
  29. $WalaConf{TestMode} = 1;
  30. my $d = Display->new(%DISPLAY_CONF);
  31. $d->walaconf(%WalaConf);
  32. $d->http_header(0);
  33. section ('starting markup validation');
  34. render('2006', '2006 validates.');
  35. render('2006/7', '2006/7 validates.');
  36. render('2007/7/14', '2007/7/14 validates.');
  37. render('all', 'all validates.');
  38. render('new', 'new validates.');
  39. # END OF TESTS
  40. # Utility routines.
  41. sub pause {
  42. my $time = shift;
  43. #print " pausing $time seconds\n";
  44. sleep $time;
  45. }
  46. sub section {
  47. my $msg = shift;
  48. print "\n-- $msg --\n\n";
  49. }
  50. sub render {
  51. my ($page, $msg) = @_;
  52. is_valid_markup (
  53. $d->display($page),
  54. $msg
  55. ) or diag_html();
  56. pause(1);
  57. }