Javascript V8 test-cases always create cpp wrappers.

This commit is contained in:
Oliver Buchtala 2013-09-06 01:40:23 +03:00
commit 492d3010ff

View file

@ -10,38 +10,38 @@ top_builddir = @top_builddir@
SWIG = $(top_builddir)/preinst_swig SWIG = $(top_builddir)/preinst_swig
ifneq (, $(ENGINE)) ifneq (, $(ENGINE))
JSENGINE = $(ENGINE) JSENGINE = $(ENGINE)
else else
JSENGINE = "node" JSENGINE = "node"
endif endif
include $(srcdir)/../common.mk include $(srcdir)/../common.mk
SWIGOPT += -$(JSENGINE) SWIGOPT += -$(JSENGINE)
ifeq ("node",$(JSENGINE)) ifeq ("node",$(JSENGINE))
setup = \ setup = \
if [ ! -f $(srcdir)/$*/binding.gyp ]; then \ if [ ! -f $(srcdir)/$*/binding.gyp ]; then \
echo "Setting up nodejs addon..."; \ echo "Setting up nodejs addon..."; \
sh ./setup_test.sh $*; \ sh ./setup_test.sh $*; \
$(SWIG) -c++ -javascript -node -o $*/$*_wrap.cxx ../$*.i; \ $(SWIG) -c++ -javascript -node -o $*/$*_wrap.cxx ../$*.i; \
fi fi
nodejs_swig_and_compile = \ nodejs_swig_and_compile = \
if [ ! -f $(srcdir)/$*/build/Makefile ]; then \ if [ ! -f $(srcdir)/$*/build/Makefile ]; then \
echo "Configuring node add-on..."; \ echo "Configuring node add-on..."; \
node-gyp --directory $* configure; \ node-gyp --directory $* configure; \
fi; \ fi; \
echo "Building node add-on..."; \ echo "Building node add-on..."; \
node-gyp --directory $* build; \ node-gyp --directory $* build; \
run_testcase = \ run_testcase = \
if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \ if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \
node $(srcdir)/$*$(SCRIPTSUFFIX); \ node $(srcdir)/$*$(SCRIPTSUFFIX); \
fi fi
# Rules for the different types of tests
%.cpptest: %.cpptest:
$(setup) $(setup)
$(nodejs_swig_and_compile) $(nodejs_swig_and_compile)
@ -57,38 +57,43 @@ ifeq ("node",$(JSENGINE))
$(nodejs_swig_and_compile) $(nodejs_swig_and_compile)
$(run_testcase) $(run_testcase)
# Clean
%.clean: %.clean:
rm -rf $* rm -rf $*
else else
run_testcase = \ run_testcase = \
if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \ if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \
$(top_srcdir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \ $(top_srcdir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \
fi fi
# Rules for the different types of tests
%.cpptest: %.cpptest:
$(setup) $(setup)
+$(swig_and_compile_cpp) +$(swig_and_compile_cpp)
$(run_testcase) $(run_testcase)
%.ctest:
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest: %.multicpptest:
$(setup) $(setup)
+$(swig_and_compile_multi_cpp) +$(swig_and_compile_multi_cpp)
$(run_testcase) $(run_testcase)
# Clean
%.clean: %.clean:
rm $*_wrap.cxx rm $*_wrap.cxx
endif endif
ifeq (v8,$(ENGINE))
%.ctest:
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
endif
ifeq (jsc,$(ENGINE))
%.ctest:
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
endif
clean: clean: