[Pkg-javascript-commits] [acorn] 02/08: Run testsuite by using sed

Bastien Roucariès rouca at moszumanska.debian.org
Fri Aug 18 13:42:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository acorn.

commit 2393a88b5bce549d0b1c6879b73a8856f2b8807b
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Fri Aug 18 15:25:27 2017 +0200

    Run testsuite by using sed
---
 debian/clean |  3 ++-
 debian/rules | 11 +++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/debian/clean b/debian/clean
index 3484daa..76f92a2 100644
--- a/debian/clean
+++ b/debian/clean
@@ -2,4 +2,5 @@ dist/
 debian/man/*.1
 *.min.js
 acorn.js
-index.js
\ No newline at end of file
+index.js
+debian/testsuite/*
\ No newline at end of file
diff --git a/debian/rules b/debian/rules
index 1e8a845..0cdc79a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,8 @@ TARGETS = $(subst src, dist, $(SOURCES))
 COMPILE_MODULES = compile-modules convert -f commonjs -I/usr/lib/nodejs/graceful-fs -I/usr/lib/nodejs/ast-types/lib
 SED_EXPR =  -e 's/$$.tokTypes/$$.types/g' -e 's/$$.tokContexts/$$.types/g' -e 's/new Parser/new $$$$state$$$$.Parser/g'
 
+TESTSUITEDIR=debian/testsuite
+
 %:
 	dh $@
 
@@ -29,13 +31,18 @@ override_dh_auto_build: dist $(TARGETS) $(MANPAGES)
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
 override_dh_auto_test:
-	@echo '**********************************************************'
+	# create a link in order to run acorn
+	mkdir -p $(TESTSUITEDIR)
+	ln -s ../../dist $(TESTSUITEDIR)/dist
+	cp  dist/bin/acorn $(TESTSUITEDIR)/binacorn
+	sed -i 's,require[(]"acorn"[)],require("./dist/index.js"),g' $(TESTSUITEDIR)/binacorn
+	@echo '*********************************************************'
 	@echo 'Run test suite                                           '
 	@echo '**********************************************************'
 	# basic smoke test
 	@echo Run bin acorn on itself
 	@echo '=========================================================='
-	dist/bin/acorn < dist/index.js
+	./$(TESTSUITEDIR)/binacorn < dist/index.js
 	@echo '=========================================================='
 	# TODO
 	# run package testsuite

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/acorn.git



More information about the Pkg-javascript-commits mailing list