[DRE-commits] [jekyll] 04/06: Add original test files provided Gem
Youhei SASAKI
uwabami-guest at moszumanska.debian.org
Tue Jun 10 09:46:59 UTC 2014
This is an automated email from the git hooks/post-receive script.
uwabami-guest pushed a commit to branch master
in repository jekyll.
commit 19fd81868b3a06e8cb9431c7af5c88a9f9780c6d
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date: Tue Jun 10 17:26:54 2014 +0900
Add original test files provided Gem
In upstream repository, some test files are symbolic links.
But in Gem file, these file are not provided or same file as linked
file. This cause many test failures.
So, inorder to running test during build process, we keep original files
provided Gem, and create symbolic links before dh_auto_build.
Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>
---
debian/rules | 35 +++++++++++++----------------------
debian/test-sources/products.yml | 4 ++++
debian/test-sources/symlinked-file | 22 ++++++++++++++++++++++
debian/test-sources/um_hi.md | 6 ++++++
4 files changed, 45 insertions(+), 22 deletions(-)
diff --git a/debian/rules b/debian/rules
index 194dc4d..2016948 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,19 +11,17 @@
# If you need to specify the .gemspec (eg there is more than one)
#export DH_RUBY_GEMSPEC=gem.gemspec
-TMP = $(CURDIR)/debian/jekyll
-
%:
dh $@ --buildsystem=ruby --with ruby
-override_dh_auto_clean: recover_orig_files
+override_dh_auto_clean: recover_original_test_sources
dh_auto_clean
rm -fr $(CURDIR)/site/js
rm -fr $(CURDIR)/site/_includes/css/normalize.css
rm -fr $(CURDIR)/test/dest
rm -fr $(CURDIR)/.sass-cache
-override_dh_auto_build: create_symlinks_for_test
+override_dh_auto_build: prepare_test
dh_auto_build
mkdir -p $(CURDIR)/site/js
cp debian/missing-sources/*.js $(CURDIR)/site/js
@@ -32,31 +30,24 @@ override_dh_auto_build: create_symlinks_for_test
override_dh_installchangelogs:
dh_installchangelogs History.markdown
-create_symlinks_for_test:
+prepare_test:
( cd $(CURDIR)/test/source/_methods && \
- [ ! -f um_hi.md ] || mv um_hi.md $(CURDIR)/debian/um_hi.md && \
- ln -s ./site/generate.md um_hi.md )
+ rm -f um_hi.md && ln -s ./site/generate.md um_hi.md )
( cd $(CURDIR)/test/source/_data && \
- [ ! -f products.yml ] || mv products.yml $(CURDIR)/debian/products.yml && \
- ln -s ../products.yml products.yml )
- ( cd $(CURDIR)/test/source/_includes && \
- [ ! -L tmp ] || ln -s /tmp tmp )
+ rm -f products.yml && ln -s ../products.yml products.yml )
+ ( cd $(CURDIR)/test/source/_includes && rm -f tmp && ln -s /tmp tmp )
( cd $(CURDIR)/test/source/symlink-test && \
- [ ! -L _data ] || ln -s ../_data . && \
- [ ! -L symlinked-dir ] || ln -s ../css/ symlinked-dir && \
- [ ! -f symlinked-file ] || mv symlinked-file $(CURDIR)/debian/symlinked-file && \
- ln -s ../index.html symlinked-file )
+ rm -f _data && ln -s ../_data . && \
+ rm -f symlinked-dir && ln -s ../css symlinked-dir && \
+ rm -f symlinked-file && ln -s ../index.html symlinked-file )
-recover_orig_files:
+recover_original_test_sources:
( cd $(CURDIR)/test/source/_methods && \
- [ ! -L um_hi.md ] || rm um_hi.md && \
- [ ! -f $(CURDIR)/debian/um_hi.md ] || mv $(CURDIR)/debian/um_hi.md . )
+ rm -f um_hi.md && cp $(CURDIR)/debian/test-sources/um_hi.md . )
( cd $(CURDIR)/test/source/_data && \
- [ ! -L products.yml ] || rm products.yml && \
- [ ! -f $(CURDIR)/debian/products.yml ] || mv $(CURDIR)/debian/products.yml . )
+ rm -f products.yml && cp $(CURDIR)/debian/test-sources/products.yml . )
( cd $(CURDIR)/test/source/_includes && rm -f tmp )
( cd $(CURDIR)/test/source/symlink-test && \
rm -fr _data && \
rm -fr symlinked-dir && \
- [ ! -L symlinked-file ] || rm -f symlinked-file && \
- [ ! -f $(CURDIR)/debian/symlinked-file ] || mv $(CURDIR)/debian/symlinked-file . )
+ rm -fr symlinked-file && cp $(CURDIR)/debian/test-sources/symlinked-file . )
diff --git a/debian/test-sources/products.yml b/debian/test-sources/products.yml
new file mode 100644
index 0000000..21828a0
--- /dev/null
+++ b/debian/test-sources/products.yml
@@ -0,0 +1,4 @@
+- name: sugar
+ price: 5.3
+- name: salt
+ price: 2.5
diff --git a/debian/test-sources/symlinked-file b/debian/test-sources/symlinked-file
new file mode 100644
index 0000000..493fce7
--- /dev/null
+++ b/debian/test-sources/symlinked-file
@@ -0,0 +1,22 @@
+---
+layout: default
+title: Tom Preston-Werner
+---
+
+h1. Welcome to my site
+
+h2. Please read our {{ site.posts | size }} Posts
+
+<ul>
+ {% for post in site.posts %}
+ <li>{{ post.date }} <a href="{{ post.url }}">{{ post.title }}</a></li>
+ {% endfor %}
+</ul>
+
+{% assign first_post = site.posts.first %}
+<div id="first_post">
+ <h1>{{ first_post.title }}</h1>
+ <div>
+ {{ first_post.content }}
+ </div>
+</div>
diff --git a/debian/test-sources/um_hi.md b/debian/test-sources/um_hi.md
new file mode 100644
index 0000000..1cab376
--- /dev/null
+++ b/debian/test-sources/um_hi.md
@@ -0,0 +1,6 @@
+---
+title: "Site#generate"
+layout: default
+---
+
+Run your generators! {{ page.layout }}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/jekyll.git
More information about the Pkg-ruby-extras-commits
mailing list