Permalink
Browse files

Fix the unit tests.

(Not like anyone ever runs them...)

`make check` will now backup config.xml and replace it with config.xml.check,
so that when running lb.exe we'll get a consistent config.xml file (as changes
to config.xml cause changes to the test output, which defeats the purpose of
testing the output...).

Once `make check` finishes, we replace config.xml with the original contents.

svn path=/trunk/lb/; revision=149186
1 parent f56b535 commit 7f37300a13e058e60c1ac79148911eeeb5b29f9c Jonathan Pryor committed Jan 7, 2010
View
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<config
+Author="Jonathan Pryor (jonpryor@vt.edu)"
+BlogDirectory="/home/test/blog"
+BlogFileName="index.html"
+BlogWebDirectory="http://www.example.com/Blog/"
+BlogImageBasedir="http://www.example.com"
+Copyright="Test Copyright Owner"
+Description="Test web log"
+ManagingEditor="test@example.com"
+Title="Test web log"
+RSSFileName="test"
+BlogTemplate="template"
+EntryTemplate="entry"
+InputEncoding="utf-8"
+OutputEncoding="utf-8"
+/>
View
@@ -21,15 +21,22 @@ push: b
$(REMOTE_DIRECTORY)
check-update:
- -rm -Rf test/out
+ -mv config.xml ._config.xml
+ cp config.xml.check config.xml
mono --debug lb.exe --blog-directory=`pwd`/test/in --prefix=test/out \
--blog-template=template.test --entry-template=entry.test \
--rss-filename=test
+ -rm config.xml
+ -mv ._config.xml config.xml
check:
-rm -Rf test/tmp
+ -mv config.xml ._config.xml
+ cp config.xml.check config.xml
mono --debug lb.exe --blog-directory=`pwd`/test/in --prefix=test/tmp \
--blog-template=template.test --entry-template=entry.test \
--rss-filename=test
diff -ru --exclude=\.svn test/out test/tmp
+ -rm config.xml
+ -mv ._config.xml config.xml
View
@@ -2,7 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en">
<head>
- <title>Jonathan Pryor's web log</title>
+ <title>Test web log</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css" title="default">
@import '../styles.css';
@@ -13,10 +13,10 @@ <h1>Lame Blog Test Template</h1>
<h2>Simple Substitutions:</h2>
<dl>
<dt>@BASEDIR@:</dt><dd></dd>
- <dt>@DESCRIPTION@:</dt><dd>Jonathan Pryor's web log</dd>
- <dt>@EDITOR@:</dt><dd>jonpryor@vt.edu</dd>
+ <dt>@DESCRIPTION@:</dt><dd>Test web log</dd>
+ <dt>@EDITOR@:</dt><dd>test@example.com</dd>
<dt>@RSSFILENAME@:</dt><dd>test</dd>
- <dt>@TITLE@:</dt><dd>Jonathan Pryor's web log</dd>
+ <dt>@TITLE@:</dt><dd>Test web log</dd>
</dl>
<h2>Complex Substitutions:</h2>
<h3>@BLOG_ENTRY_INDEX@:</h3>
@@ -30,18 +30,18 @@ <h3>@BLOG_ENTRY_INDEX@:</h3>
<h3>@BLOG_ENTRIES@:</h3>
<blockquote>
<p></p>
-<h2 id="entry-2005-07-20T02:48:00PM" name="">@ENTRY_CAPTION</h2>
+<h2 id="entry-2005-07-20T02:48:00PM" name="<a name="7-2f20-2f2005-2-3a48-3a00-PM"></a>">@ENTRY_CAPTION</h2>
<p>This is a test entry. This is only a test.</p>
<hr>
<p>Test Variables:</p>
<dl>
<dt>@BASEDIR@:</dt>
- <dd></dd>
+ <dd>http://www.example.com/Blog/</dd>
<dt>@COPYRIGHT@:</dt>
- <dd>Jonathan Pryor</dd>
+ <dd>Test Copyright Owner</dd>
<dt>@ENTRY_ANCHOR@:</dt>
- <dd></dd>
+ <dd><a name="7-2f20-2f2005-2-3a48-3a00-PM"></a></dd>
<dt>@ENTRY_CAPTION@:</dt>
<dd>This is a title</dd>
<dt>@ENTRY_CATEGORY@:</dt>
@@ -61,11 +61,11 @@ <h2 id="entry-2005-07-20T02:48:00PM" name="">@ENTRY_CAPTION</h2>
</dl>
<p></p>
-<h2 id="entry-foo-bar-2005-07-14T02:49:00PM" name="">@ENTRY_CAPTION</h2>
+<h2 id="entry-foo-bar-2005-07-14T02:49:00PM" name="<a name="7-2f14-2f2005-2-3a49-3a00-PM"></a>">@ENTRY_CAPTION</h2>
<p>@ENTRY_PATH@=archive/foo/bar/2005/</p>
<p>Testing...
This needs to work.
-@import '../syles.css'
+@import '../http://www.example.com/Blog/syles.css'
@BAD_TAG
email@foo.org email@bar.org
email2@foo.org \@ and \@ email@bar.org
@@ -86,11 +86,11 @@ <h2 id="entry-foo-bar-2005-07-14T02:49:00PM" name="">@ENTRY_CAPTION</h2>
<p>Test Variables:</p>
<dl>
<dt>@BASEDIR@:</dt>
- <dd></dd>
+ <dd>http://www.example.com/Blog/</dd>
<dt>@COPYRIGHT@:</dt>
- <dd>Jonathan Pryor</dd>
+ <dd>Test Copyright Owner</dd>
<dt>@ENTRY_ANCHOR@:</dt>
- <dd></dd>
+ <dd><a name="7-2f14-2f2005-2-3a49-3a00-PM"></a></dd>
<dt>@ENTRY_CAPTION@:</dt>
<dd>This is a Mono.Posix title</dd>
<dt>@ENTRY_CATEGORY@:</dt>
@@ -2,7 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en">
<head>
- <title>This is a title - Jonathan Pryor's web log</title>
+ <title>This is a title - Test web log</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css" title="default">
@import '../../../styles.css';
@@ -13,10 +13,10 @@ <h1>Lame Blog Test Template</h1>
<h2>Simple Substitutions:</h2>
<dl>
<dt>@BASEDIR@:</dt><dd>../../</dd>
- <dt>@DESCRIPTION@:</dt><dd>Jonathan Pryor's web log</dd>
- <dt>@EDITOR@:</dt><dd>jonpryor@vt.edu</dd>
+ <dt>@DESCRIPTION@:</dt><dd>Test web log</dd>
+ <dt>@EDITOR@:</dt><dd>test@example.com</dd>
<dt>@RSSFILENAME@:</dt><dd>test</dd>
- <dt>@TITLE@:</dt><dd>This is a title - Jonathan Pryor's web log</dd>
+ <dt>@TITLE@:</dt><dd>This is a title - Test web log</dd>
</dl>
<h2>Complex Substitutions:</h2>
<h3>@BLOG_ENTRY_INDEX@:</h3>
@@ -38,9 +38,9 @@ <h2 id="entry-2005-07-20T02:48:00PM" name="">@ENTRY_CAPTION</h2>
<p>Test Variables:</p>
<dl>
<dt>@BASEDIR@:</dt>
- <dd>../../</dd>
+ <dd>http://www.example.com/Blog/</dd>
<dt>@COPYRIGHT@:</dt>
- <dd>Jonathan Pryor</dd>
+ <dd>Test Copyright Owner</dd>
<dt>@ENTRY_ANCHOR@:</dt>
<dd></dd>
<dt>@ENTRY_CAPTION@:</dt>
@@ -2,7 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en">
<head>
- <title>This is a Mono.Posix title - Jonathan Pryor's web log</title>
+ <title>This is a Mono.Posix title - Test web log</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css" title="default">
@import '../../../../../styles.css';
@@ -13,10 +13,10 @@ <h1>Lame Blog Test Template</h1>
<h2>Simple Substitutions:</h2>
<dl>
<dt>@BASEDIR@:</dt><dd>../../../../</dd>
- <dt>@DESCRIPTION@:</dt><dd>Jonathan Pryor's web log</dd>
- <dt>@EDITOR@:</dt><dd>jonpryor@vt.edu</dd>
+ <dt>@DESCRIPTION@:</dt><dd>Test web log</dd>
+ <dt>@EDITOR@:</dt><dd>test@example.com</dd>
<dt>@RSSFILENAME@:</dt><dd>test</dd>
- <dt>@TITLE@:</dt><dd>This is a Mono.Posix title - Jonathan Pryor's web log</dd>
+ <dt>@TITLE@:</dt><dd>This is a Mono.Posix title - Test web log</dd>
</dl>
<h2>Complex Substitutions:</h2>
<h3>@BLOG_ENTRY_INDEX@:</h3>
@@ -35,7 +35,7 @@ <h2 id="entry-foo-bar-2005-07-14T02:49:00PM" name="">@ENTRY_CAPTION</h2>
<p>@ENTRY_PATH@=../../../../archive/foo/bar/2005/</p>
<p>Testing...
This needs to work.
-@import '../../../../../syles.css'
+@import '../http://www.example.com/Blog/syles.css'
@BAD_TAG
email@foo.org email@bar.org
email2@foo.org \@ and \@ email@bar.org
@@ -56,9 +56,9 @@ <h2 id="entry-foo-bar-2005-07-14T02:49:00PM" name="">@ENTRY_CAPTION</h2>
<p>Test Variables:</p>
<dl>
<dt>@BASEDIR@:</dt>
- <dd>../../../../</dd>
+ <dd>http://www.example.com/Blog/</dd>
<dt>@COPYRIGHT@:</dt>
- <dd>Jonathan Pryor</dd>
+ <dd>Test Copyright Owner</dd>
<dt>@ENTRY_ANCHOR@:</dt>
<dd></dd>
<dt>@ENTRY_CAPTION@:</dt>
@@ -2,7 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en">
<head>
- <title>This is a Mono.Posix title - Jonathan Pryor's web log</title>
+ <title>This is a Mono.Posix title - Test web log</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css" title="default">
@import '../../../../styles.css';
@@ -13,10 +13,10 @@ <h1>Lame Blog Test Template</h1>
<h2>Simple Substitutions:</h2>
<dl>
<dt>@BASEDIR@:</dt><dd>../../../</dd>
- <dt>@DESCRIPTION@:</dt><dd>Jonathan Pryor's web log</dd>
- <dt>@EDITOR@:</dt><dd>jonpryor@vt.edu</dd>
+ <dt>@DESCRIPTION@:</dt><dd>Test web log</dd>
+ <dt>@EDITOR@:</dt><dd>test@example.com</dd>
<dt>@RSSFILENAME@:</dt><dd>test</dd>
- <dt>@TITLE@:</dt><dd>This is a Mono.Posix title - Jonathan Pryor's web log</dd>
+ <dt>@TITLE@:</dt><dd>This is a Mono.Posix title - Test web log</dd>
</dl>
<h2>Complex Substitutions:</h2>
<h3>@BLOG_ENTRY_INDEX@:</h3>
@@ -34,7 +34,7 @@ <h2 id="entry-foo-bar-2005-07-14T02:49:00PM" name="">@ENTRY_CAPTION</h2>
<p>@ENTRY_PATH@=../../../archive/foo/bar/2005/</p>
<p>Testing...
This needs to work.
-@import '../../../../syles.css'
+@import '../http://www.example.com/Blog/syles.css'
@BAD_TAG
email@foo.org email@bar.org
email2@foo.org \@ and \@ email@bar.org
@@ -55,9 +55,9 @@ <h2 id="entry-foo-bar-2005-07-14T02:49:00PM" name="">@ENTRY_CAPTION</h2>
<p>Test Variables:</p>
<dl>
<dt>@BASEDIR@:</dt>
- <dd>../../../</dd>
+ <dd>http://www.example.com/Blog/</dd>
<dt>@COPYRIGHT@:</dt>
- <dd>Jonathan Pryor</dd>
+ <dd>Test Copyright Owner</dd>
<dt>@ENTRY_ANCHOR@:</dt>
<dd></dd>
<dt>@ENTRY_CAPTION@:</dt>
@@ -1,28 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by RSS.NET: http://rss-net.sf.net-->
<rss version="2.0">
<channel>
- <title>Jonathan Pryor's web log</title>
- <description>Jonathan Pryor's web log</description>
- <link>http://www.jprl.com/Blog/index.html</link>
- <copyright>Jonathan Pryor</copyright>
- <managingEditor>jonpryor@vt.edu</managingEditor>
- <pubDate>Wed, 20 Jul 2005 14:48:00 GMT</pubDate>
+ <title>Test web log</title>
+ <description>Test web log</description>
+ <link>http://www.example.com/Blog/index.html</link>
+ <copyright>Test Copyright Owner</copyright>
+ <managingEditor>test@example.com</managingEditor>
+ <pubDate>Wed, 20 Jul 2005 14:48:00 -0500</pubDate>
<docs>http://backend.userland.com/rss</docs>
<generator>lb#</generator>
<item>
<title>This is a Mono.Posix title</title>
- <description>&lt;p&gt;\@ENTRY_PATH\@=@ENTRY_PATH@&lt;/p&gt;
+ <description>&lt;p&gt;@ENTRY_PATH@=http://www.example.com/Blog/archive/foo/bar/2005/&lt;/p&gt;
&lt;p&gt;Testing...
This needs to work.
-@import '../@BASEDIR@syles.css'
+@import '../http://www.example.com/Blog/syles.css'
@BAD_TAG
email@foo.org email@bar.org
email2@foo.org \@ and \@ email@bar.org
email2@foo.org @ and @ email@bar.org
\escape at beginning:
escape at end\
-\@ESCAPE_AT_START\@
-\@ESCAPE_AT_START2\@
+@ESCAPE_AT_START@
+@ESCAPE_AT_START2@
@ESCAPE_AT_NL\
@ESCAPE_IN\MIDDLE@
@ESCAPE_IN\MIDDLE@@ANOTHER_ESCAPE@@HERE_TO@
@@ -31,10 +32,10 @@ escape at end\
@ESCAPE_\@EMBEDDED\@AT\@@
&lt;/p&gt;
</description>
- <link>http://www.jprl.com/Blog/archive/foo/bar/2005/Jul-14.html</link>
+ <link>http://www.example.com/Blog/archive/foo/bar/2005/Jul-14.html</link>
<author>Jonathan Pryor (jonpryor@vt.edu)</author>
- <guid isPermaLink="true">http://www.jprl.com/Blog/archive/foo/bar/2005/Jul-14.html</guid>
- <pubDate>Thu, 14 Jul 2005 18:49:00 GMT</pubDate>
+ <guid isPermaLink="true">http://www.example.com/Blog/archive/foo/bar/2005/Jul-14.html</guid>
+ <pubDate>Thu, 14 Jul 2005 18:49:00 -0500</pubDate>
</item>
</channel>
</rss>
@@ -2,7 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en">
<head>
- <title>This is a Mono.Posix title - Jonathan Pryor's web log</title>
+ <title>This is a Mono.Posix title - Test web log</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css" title="default">
@import '../../../styles.css';
@@ -13,10 +13,10 @@ <h1>Lame Blog Test Template</h1>
<h2>Simple Substitutions:</h2>
<dl>
<dt>@BASEDIR@:</dt><dd>../../</dd>
- <dt>@DESCRIPTION@:</dt><dd>Jonathan Pryor's web log</dd>
- <dt>@EDITOR@:</dt><dd>jonpryor@vt.edu</dd>
+ <dt>@DESCRIPTION@:</dt><dd>Test web log</dd>
+ <dt>@EDITOR@:</dt><dd>test@example.com</dd>
<dt>@RSSFILENAME@:</dt><dd>test</dd>
- <dt>@TITLE@:</dt><dd>This is a Mono.Posix title - Jonathan Pryor's web log</dd>
+ <dt>@TITLE@:</dt><dd>This is a Mono.Posix title - Test web log</dd>
</dl>
<h2>Complex Substitutions:</h2>
<h3>@BLOG_ENTRY_INDEX@:</h3>
@@ -34,7 +34,7 @@ <h2 id="entry-foo-bar-2005-07-14T02:49:00PM" name="">@ENTRY_CAPTION</h2>
<p>@ENTRY_PATH@=../../archive/foo/bar/2005/</p>
<p>Testing...
This needs to work.
-@import '../../../syles.css'
+@import '../http://www.example.com/Blog/syles.css'
@BAD_TAG
email@foo.org email@bar.org
email2@foo.org \@ and \@ email@bar.org
@@ -55,9 +55,9 @@ <h2 id="entry-foo-bar-2005-07-14T02:49:00PM" name="">@ENTRY_CAPTION</h2>
<p>Test Variables:</p>
<dl>
<dt>@BASEDIR@:</dt>
- <dd>../../</dd>
+ <dd>http://www.example.com/Blog/</dd>
<dt>@COPYRIGHT@:</dt>
- <dd>Jonathan Pryor</dd>
+ <dd>Test Copyright Owner</dd>
<dt>@ENTRY_ANCHOR@:</dt>
<dd></dd>
<dt>@ENTRY_CAPTION@:</dt>
@@ -1,28 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by RSS.NET: http://rss-net.sf.net-->
<rss version="2.0">
<channel>
- <title>Jonathan Pryor's web log</title>
- <description>Jonathan Pryor's web log</description>
- <link>http://www.jprl.com/Blog/index.html</link>
- <copyright>Jonathan Pryor</copyright>
- <managingEditor>jonpryor@vt.edu</managingEditor>
- <pubDate>Wed, 20 Jul 2005 14:48:00 GMT</pubDate>
+ <title>Test web log</title>
+ <description>Test web log</description>
+ <link>http://www.example.com/Blog/index.html</link>
+ <copyright>Test Copyright Owner</copyright>
+ <managingEditor>test@example.com</managingEditor>
+ <pubDate>Wed, 20 Jul 2005 14:48:00 -0500</pubDate>
<docs>http://backend.userland.com/rss</docs>
<generator>lb#</generator>
<item>
<title>This is a Mono.Posix title</title>
- <description>&lt;p&gt;\@ENTRY_PATH\@=@ENTRY_PATH@&lt;/p&gt;
+ <description>&lt;p&gt;@ENTRY_PATH@=http://www.example.com/Blog/archive/foo/bar/2005/&lt;/p&gt;
&lt;p&gt;Testing...
This needs to work.
-@import '../@BASEDIR@syles.css'
+@import '../http://www.example.com/Blog/syles.css'
@BAD_TAG
email@foo.org email@bar.org
email2@foo.org \@ and \@ email@bar.org
email2@foo.org @ and @ email@bar.org
\escape at beginning:
escape at end\
-\@ESCAPE_AT_START\@
-\@ESCAPE_AT_START2\@
+@ESCAPE_AT_START@
+@ESCAPE_AT_START2@
@ESCAPE_AT_NL\
@ESCAPE_IN\MIDDLE@
@ESCAPE_IN\MIDDLE@@ANOTHER_ESCAPE@@HERE_TO@
@@ -31,10 +32,10 @@ escape at end\
@ESCAPE_\@EMBEDDED\@AT\@@
&lt;/p&gt;
</description>
- <link>http://www.jprl.com/Blog/archive/foo/bar/2005/Jul-14.html</link>
+ <link>http://www.example.com/Blog/archive/foo/bar/2005/Jul-14.html</link>
<author>Jonathan Pryor (jonpryor@vt.edu)</author>
- <guid isPermaLink="true">http://www.jprl.com/Blog/archive/foo/bar/2005/Jul-14.html</guid>
- <pubDate>Thu, 14 Jul 2005 18:49:00 GMT</pubDate>
+ <guid isPermaLink="true">http://www.example.com/Blog/archive/foo/bar/2005/Jul-14.html</guid>
+ <pubDate>Thu, 14 Jul 2005 18:49:00 -0500</pubDate>
</item>
</channel>
</rss>
Oops, something went wrong.

0 comments on commit 7f37300

Please sign in to comment.