diff options
author | Nishant Gupta <nish.gupta01@gmail.com> | 2016-08-01 21:44:55 +0530 |
---|---|---|
committer | Nishant Gupta <nish.gupta01@gmail.com> | 2016-08-01 21:47:14 +0530 |
commit | 4fbfbcf4fbe3df388fa706a57ae222cce6e34fc7 (patch) | |
tree | d03a0cfc164cb655d55e23ee83f8990c5e916cfd | |
parent | 81b00c7695bd8dc43a682eaa4a280bce27aa6714 (diff) | |
download | swig-4fbfbcf4fbe3df388fa706a57ae222cce6e34fc7.tar.gz |
Test suite setup + silence builds + check-version
-rw-r--r-- | Examples/Makefile.in | 12 | ||||
-rw-r--r-- | Examples/test-suite/hhvm/Makefile.in | 74 | ||||
-rw-r--r-- | Examples/test-suite/hhvm/config.cmake | 4 | ||||
-rw-r--r-- | Makefile.in | 14 | ||||
-rw-r--r-- | configure.ac | 1 |
5 files changed, 94 insertions, 11 deletions
diff --git a/Examples/Makefile.in b/Examples/Makefile.in index a07136882..1d2193ffc 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -586,11 +586,11 @@ HHVM_SCRIPT = $(SRCDIR)$(RUNME).php hhvm: $(SRCDIR_SRCS) $(SWIG) -hhvm $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - @hphpize + @hphpize >/dev/null @mkdir build cd build && \ - cmake .. -DCMAKE_CXX_COMPILER='$(CXX)' && \ - $(MAKE) && \ + cmake .. -DCMAKE_CXX_COMPILER='$(CXX)' >/dev/null && \ + $(MAKE) >/dev/null && \ mv $(LIBPREFIX)$(TARGET)$(HHVM_SO) .. #$(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(HHVM_INCLUDE) #$(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(HHVM_SO) @@ -601,11 +601,11 @@ hhvm: $(SRCDIR_SRCS) hhvm_cpp: $(SRCDIR_SRCS) $(SWIG) -hhvm -cppext cxx -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - @hphpize + @hphpize >/dev/null @mkdir build cd build && \ - cmake .. -DCMAKE_CXX_COMPILER='$(CXX)' && \ - $(MAKE) && \ + cmake .. -DCMAKE_CXX_COMPILER='$(CXX)' >/dev/null && \ + $(MAKE) >/dev/null && \ mv $(LIBPREFIX)$(TARGET)$(HHVM_SO) .. #$(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(HHVM_INCLUDE) #$(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(HHVM_SO) diff --git a/Examples/test-suite/hhvm/Makefile.in b/Examples/test-suite/hhvm/Makefile.in new file mode 100644 index 000000000..6e60f416d --- /dev/null +++ b/Examples/test-suite/hhvm/Makefile.in @@ -0,0 +1,74 @@ +####################################################################### +# Makefile for hhvm test-suite +####################################################################### + +LANGUAGE = hhvm +SCRIPTSUFFIX = _runme.php + +srcdir = @srcdir@ +top_srcdir = ../@top_srcdir@ +top_builddir = ../@top_builddir@ +OBJEXT = @OBJEXT@ +SO = @SO@ + +include $(srcdir)/../common.mk + +# Overridden variables here +SRCDIR = ../$(srcdir)/ + +# Custom tests - tests with additional commandline options +prefix.cpptest: SWIGOPT += -prefix Project + +# write out tests without a _runme.php +missingcpptests: + for test in $(CPP_TEST_CASES) ; do test -f $${test}_runme.php || echo $${test}; done + +missingctests: + for test in $(C_TEST_CASES) ; do test -f $${test}_runme.php || echo $${test}; done + +missingtests: missingcpptests missingctests + +# Rules for the different types of tests +%.cpptest: + $(setup) + +(cd $* && $(swig_and_compile_cpp)) + +$(run_testcase) + +%.ctest: + $(setup) + +(cd $* && $(swig_and_compile_c)) + +$(run_testcase) + +%.multicpptest: + $(setup) + +(cd $* && $(swig_and_compile_multi_cpp)) + +$(run_testcase) + +# Makes a directory for the testcase if it does not exist +setup = \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test)" ; \ + else \ + echo "$(ACTION)ing $(LANGUAGE) testcase $*" ; \ + fi; \ + if [ ! -d $* ]; then \ + mkdir $* && \ + sed -e 's|$$testcase|$*|g;' $(srcdir)/config.cmake > $*/config.cmake; \ + fi; + +# Runs the testcase. Tries to run testcase_runme.php. +run_testcase = \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + $(MAKE) -f $*/$(top_builddir)/$(EXAMPLES)/Makefile HHVM_SCRIPT=$(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) RUNTOOL='$(RUNTOOL)' hhvm_run; \ + fi + +# Clean: remove testcase directories +%.clean: + @if [ -d $* ]; then \ + rm -rf $*; \ + fi + +clean: + rm -f ext_* *~ .~* example.php run-test CMakeLists.txt + rm -rf build + rm -f *.@OBJEXT@ *$(SO) diff --git a/Examples/test-suite/hhvm/config.cmake b/Examples/test-suite/hhvm/config.cmake new file mode 100644 index 000000000..021852e91 --- /dev/null +++ b/Examples/test-suite/hhvm/config.cmake @@ -0,0 +1,4 @@ +file(GLOB ext_SRC *.cxx *.cpp *.c) + +HHVM_EXTENSION($testcase ${ext_SRC}) +HHVM_SYSTEMLIB($testcase ../ext_$testcase.php) diff --git a/Makefile.in b/Makefile.in index c202d0b74..bb1315570 100644 --- a/Makefile.in +++ b/Makefile.in @@ -133,7 +133,7 @@ check-aliveness: @$(skip-go) || ./$(TARGET) -go -help @$(skip-d) || ./$(TARGET) -d -help @$(skip-javascript) || ./$(TARGET) -javascript -help - @$(skip-hhvm) || ./$(TARGET) -hhvm -help + @$(skip-hhvm) || ./$(TARGET) -hhvm -help check-ccache: test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) check) @@ -164,7 +164,8 @@ check-versions: \ check-r-version \ check-scilab-version \ check-go-version \ - check-d-version + check-d-version \ + check-hhvm-version # all examples check-%-version : @@ -291,7 +292,8 @@ check-test-suite: \ check-scilab-test-suite \ check-go-test-suite \ check-d-test-suite \ - check-javascript-test-suite + check-javascript-test-suite \ + check-hhvm-test-suite check-%-test-suite: @if test -z "$(skip-$*)"; then \ @@ -345,7 +347,8 @@ all-test-suite: \ all-scilab-test-suite \ all-go-test-suite \ all-d-test-suite \ - all-javascript-test-suite + all-javascript-test-suite \ + all-hhvm-test-suite all-%-test-suite: @$(MAKE) $(FLAGS) check-$*-test-suite ACTION=all @@ -375,7 +378,8 @@ broken-test-suite: \ broken-scilab-test-suite \ broken-go-test-suite \ broken-d-test-suite \ - broken-javascript-test-suite + broken-javascript-test-suite \ + broken-hhvm-test-suite broken-%-test-suite: @$(MAKE) $(FLAGS) check-$*-test-suite ACTION=broken diff --git a/configure.ac b/configure.ac index c5b39d8b8..bd8eba6dd 100644 --- a/configure.ac +++ b/configure.ac @@ -2984,6 +2984,7 @@ AC_CONFIG_FILES([ Examples/test-suite/csharp/Makefile Examples/test-suite/d/Makefile Examples/test-suite/guile/Makefile + Examples/test-suite/hhvm/Makefile Examples/test-suite/java/Makefile Examples/test-suite/javascript/Makefile Examples/test-suite/mzscheme/Makefile |