Skip to content

Commit

Permalink
THRIFT-3133 Allow "make cross" and "make precross" to run without bui…
Browse files Browse the repository at this point in the history
…lding all languages
  • Loading branch information
nsuke authored and bufferoverflow committed May 10, 2015
1 parent 72f8809 commit 03f0e18
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 10 deletions.
15 changes: 10 additions & 5 deletions Makefile.am
Expand Up @@ -43,8 +43,17 @@ precross-%: all
precross: all precross-test precross-lib

# TODO: generate --server and --client switches from "--with(out)-..." build flags


empty :=
space := $(empty) $(empty)
comma := ,

CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_JAVA@ @MAYBE_CSHARP@ @MAYBE_PYTHON@ @MAYBE_RUBY@ @MAYBE_HASKELL@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@
CROSS_LANGS_COMMA_SEPARATED = $(subst $(space),$(comma),$(CROSS_LANGS))

cross: precross
$(PYTHON) test/test.py -s
$(PYTHON) test/test.py -s --server $(CROSS_LANGS_COMMA_SEPARATED) --client $(CROSS_LANGS_COMMA_SEPARATED)

TIMES = 1 2 3
fail: precross
Expand Down Expand Up @@ -72,10 +81,6 @@ codespell_skip_files = \
rebar \
thrift

empty :=
space := $(empty) $(empty)
comma := ,

skipped_files = $(subst $(space),$(comma),$(codespell_skip_files))

style-local:
Expand Down
23 changes: 23 additions & 0 deletions configure.ac
Expand Up @@ -743,6 +743,29 @@ AC_CONFIG_FILES([
tutorial/rb/Makefile
])

if test "$have_cpp" = "yes" ; then MAYBE_CPP="cpp" ; else MAYBE_CPP="" ; fi
AC_SUBST([MAYBE_CPP])
if test "$have_c_glib" = "yes" ; then MAYBE_C_GLIB="c_glib" ; else MAYBE_C_GLIB="" ; fi
AC_SUBST([MAYBE_C_GLIB])
if test "$have_java" = "yes" ; then MAYBE_JAVA="java" ; else MAYBE_JAVA="" ; fi
AC_SUBST([MAYBE_JAVA])
if test "$have_csharp" = "yes" ; then MAYBE_CSHARP="csharp" ; else MAYBE_CSHARP="" ; fi
AC_SUBST([MAYBE_CSHARP])
if test "$have_python" = "yes" ; then MAYBE_PYTHON="python" ; else MAYBE_PYTHON="" ; fi
AC_SUBST([MAYBE_PYTHON])
if test "$have_ruby" = "yes" ; then MAYBE_RUBY="rb" ; else MAYBE_RUBY="" ; fi
AC_SUBST([MAYBE_RUBY])
if test "$have_haskell" = "yes" ; then MAYBE_HASKELL="haskell" ; else MAYBE_HASKELL="" ; fi
AC_SUBST([MAYBE_HASKELL])
if test "$have_perl" = "yes" ; then MAYBE_PERL="perl" ; else MAYBE_PERL="" ; fi
AC_SUBST([MAYBE_PERL])
if test "$have_php" = "yes" ; then MAYBE_PHP="php" ; else MAYBE_PHP="" ; fi
AC_SUBST([MAYBE_PHP])
if test "$have_go" = "yes" ; then MAYBE_GO="go" ; else MAYBE_GO="" ; fi
AC_SUBST([MAYBE_GO])
if test "$have_nodejs" = "yes" ; then MAYBE_NODEJS="nodejs" ; else MAYBE_NODEJS="" ; fi
AC_SUBST([MAYBE_NODEJS])

AC_OUTPUT


Expand Down
6 changes: 5 additions & 1 deletion lib/Makefile.am
Expand Up @@ -18,6 +18,7 @@
#

SUBDIRS =
PRECROSS_TARGET =

if WITH_CPP
SUBDIRS += cpp
Expand All @@ -29,10 +30,12 @@ endif

if WITH_MONO
SUBDIRS += csharp
PRECROSS_TARGET += precross-csharp
endif

if WITH_JAVA
SUBDIRS += java
PRECROSS_TARGET += precross-java
# JavaScript unit test depends on java
# so test only if java, ant & co is available
SUBDIRS += js/test
Expand Down Expand Up @@ -72,6 +75,7 @@ endif

if WITH_NODEJS
SUBDIRS += nodejs
PRECROSS_TARGET += precross-nodejs
endif

if WITH_LUA
Expand All @@ -94,4 +98,4 @@ EXTRA_DIST = \

precross-%:
$(MAKE) -C $* precross
precross: precross-nodejs precross-csharp precross-java
precross: $(PRECROSS_TARGET)
10 changes: 9 additions & 1 deletion test/Makefile.am
Expand Up @@ -18,31 +18,38 @@
#

SUBDIRS =
PRECROSS_TARGET =

if WITH_C_GLIB
SUBDIRS += c_glib
PRECROSS_TARGET += precross-c_glib
endif

if WITH_CPP
SUBDIRS += cpp
PRECROSS_TARGET += precross-cpp
endif

if WITH_PERL
SUBDIRS += perl
PRECROSS_TARGET += precross-perl
endif

if WITH_PHP
SUBDIRS += php
PRECROSS_TARGET += precross-php
endif

if WITH_PYTHON
SUBDIRS += py
PRECROSS_TARGET += precross-py
SUBDIRS += py.twisted
SUBDIRS += py.tornado
endif

if WITH_RUBY
SUBDIRS += rb
PRECROSS_TARGET += precross-rb
endif

if WITH_HASKELL
Expand All @@ -55,6 +62,7 @@ endif

if WITH_GO
SUBDIRS += go
PRECROSS_TARGET += precross-go
endif

if WITH_ERLANG
Expand Down Expand Up @@ -106,4 +114,4 @@ EXTRA_DIST = \

precross-%:
$(MAKE) -C $* precross
precross: precross-py precross-rb precross-c_glib precross-cpp precross-perl precross-php precross-go
precross: $(PRECROSS_TARGET)
6 changes: 3 additions & 3 deletions test/README.md
Expand Up @@ -13,9 +13,9 @@ The test can be executed by:
This starts the [test.py](test.py) script which does the real cross test with
different transports, protocols and languages.

Note that this requires basically everything to be built, otherwise test cases
for missing languages will fail. If you skip building some languages, or simply
need more control, read following section.
Note that this skips any language that is not built locally. It also skips
tests that are known to be failing. If you need more control over which tests
to run, read following section.

### B. Using test script directly

Expand Down

0 comments on commit 03f0e18

Please sign in to comment.