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.

78 lines
1.3 KiB

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 Test::HTML::W3C 'show_detail';
  20. use Test::Simple tests => 12;
  21. use Display qw(%WalaConf %DISPLAY_CONF);
  22. # TESTS
  23. section ('configuration');
  24. ok (do("conf.pl"), "configuration on conf.pl");
  25. # This will turn off stuff that breaks testing.
  26. $WalaConf{TestMode} = 1;
  27. section ('starting markup validation');
  28. render('2006', 'Year validates.');
  29. render('2006/7', 'Month validates.');
  30. render('2007/7/14', 'Day validates.');
  31. # END OF TESTS
  32. # Utility routines.
  33. sub pause {
  34. my $time = shift;
  35. #print " pausing $time seconds\n";
  36. sleep $time;
  37. }
  38. sub section {
  39. my $msg = shift;
  40. print "\n-- $msg --\n\n";
  41. }
  42. sub render {
  43. my $page = shift;
  44. my $msg = shift;
  45. is_valid_markup (
  46. Display::handle($page),
  47. $msg
  48. ) or diag_html();
  49. pause(1);
  50. }