[DRE-commits] [jekyll] 03/06: Add pre/post test hook: create symlink for test
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 a4b0461004154a9ff4e6c9ddd8beccaab45a65e2
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date: Tue Jun 10 16:31:21 2014 +0900
Add pre/post test hook: create symlink for test
Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>
---
debian/ruby-tests.rake | 4 ++--
debian/rules | 35 ++++++++++++++++++++++++++++++++---
2 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/debian/ruby-tests.rake b/debian/ruby-tests.rake
index f079b86..6a87f39 100644
--- a/debian/ruby-tests.rake
+++ b/debian/ruby-tests.rake
@@ -2,7 +2,7 @@
require 'rake/testtask'
task :default => :test
Rake::TestTask.new do |t|
- t.libs << 'test'
- t.test_files = FileList['test/**/test_*.rb'].select { |file| ! file =~ /tags|site|rdiscount|entry_filter|post/ }
+ t.libs << 'lib' << 'test'
+ t.test_files = FileList['test/test_*.rb']
t.verbose = true
end
diff --git a/debian/rules b/debian/rules
index 82c0ac5..194dc4d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,14 +16,14 @@ TMP = $(CURDIR)/debian/jekyll
%:
dh $@ --buildsystem=ruby --with ruby
-override_dh_auto_clean:
+override_dh_auto_clean: recover_orig_files
dh_auto_clean
- rm -fr $(CURDIR)/site/_includes/css/normalize.css
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:
+override_dh_auto_build: create_symlinks_for_test
dh_auto_build
mkdir -p $(CURDIR)/site/js
cp debian/missing-sources/*.js $(CURDIR)/site/js
@@ -31,3 +31,32 @@ override_dh_auto_build:
override_dh_installchangelogs:
dh_installchangelogs History.markdown
+
+create_symlinks_for_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 )
+ ( 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 )
+ ( 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 )
+
+recover_orig_files:
+ ( 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 . )
+ ( cd $(CURDIR)/test/source/_data && \
+ [ ! -L products.yml ] || rm products.yml && \
+ [ ! -f $(CURDIR)/debian/products.yml ] || mv $(CURDIR)/debian/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 . )
--
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