Okay, well I just committed the refactoring reusing THRIFT-892 which was
the original bug I was planning on using for refactoring to use
fw-template-erlang.  However rebar is the better choice as it widely
used.

Let me know if anyone has any issues.

-Anthony

On Mon, Jun 20, 2011 at 11:33:46AM -0700, Anthony Molinaro wrote:
> 
> On Mon, Jun 20, 2011 at 08:18:11PM +0200, Roger Meier wrote:
> > From my perspective test/ is the directory that keeps all IDL files for
> > UnitTests, which will be used across languages.
> > e.g. the ThriftTest.thrift is used by several unit tests
> 
> Okay, well I can use relative paths to get to those share .thrift files,
> but what about .thrift files for specific unit tests.  I assume keeping
> those in the lib/<lang>/test directory is fine.
> 
> > I think it's much easier to build all the tests when they are part of the
> > usual build procedure of a specific language.
> > It's probably a bit difficult to keep test under test/ in sync with the
> > build process of the library,
> > that's why a propose to put all the tests in lib/<lang>/test/ 
> 
> One thing here, in most cases the tests are run with 'make check' so its
> not always the case that 'make' will build the test code.  And I think it
> should stay like that, unless you are actually running 'make check' it
> a bit of overhead to compile more stuff when you don't want it.
> 
> >  The get a cross language test capability I suggest the following approach:
> > -  The language specific build procedures should create an executable with
> > the name TestClient  and TestServer
> > -  They should be placed under test/<lang>/ or a shell script with the same
> > name calls corresponding Client or Server
> > -  The test client and servers should have a unified set of arguments, so
> > that cross language tests could easily be automated, e.g. 
> > roger@slave:~/software/thrift/thrift-trunk$ ./test/cpp/TestServer -h
> > Allowed options:
> >   -h [ --help ]               produce help message
> >   --port arg (=9090)                    Port number to listen
> >   --domain-socket arg               Unix Domain Socket (e.g.
> > /tmp/ThriftTest.thrift)
> >   --server-type arg (=simple) type of server, "simple", "thread-pool",
> > "threaded", or "nonblocking"
> >   --transport arg (=buffered) transport: buffered, framed, http
> >   --protocol arg (=binary)        protocol: binary, json
> >   --ssl                                               Encrypted Transport
> > using SSL
> >   --processor-events                processor-events
> >   -n [ --workers ] arg (=4)        Number of thread pools workers. Only
> > valid for thread-pool server type
> > 
> > roger@slave:~/software/thrift/thrift-trunk$ ./test/cpp/TestClient -h
> > Allowed options:
> >   -h [ --help ]                                 produce help message
> >   --host arg (=localhost)           Host to connect
> >   --port arg (=9090)                    Port number to connect
> >   --domain-socket arg               Domain Socket (e.g.
> > /tmp/ThriftTest.thrift), instead of host and port
> >   --transport arg (=buffered) Transport: buffered, framed, http
> >   --protocol arg (=binary)         Protocol: binary, json
> >   --ssl                                                Encrypted Transport
> > using SSL
> >   -n [ --testloops ] arg (=1)      Number of Tests
> 
> This seems reasonable, because of the ordering of SUBDIRS in the top-level
> Makefile.am, the lib hierarchy is traversed first whn you make check.  So
> the code which the scripts in test/<lang>/ can then be run as the code
> they probably rely on will have been built.  I'll structure the erlang
> code in this manner when I move it, and maybe try to get to these scripts
> in test/<lang>
> 
> -Anthony
> 
> -- 
> ------------------------------------------------------------------------
> Anthony Molinaro                           <[email protected]>

-- 
------------------------------------------------------------------------
Anthony Molinaro                           <[email protected]>

Reply via email to