THRIFT-3592 Add basic test client

This closes #830
diff --git a/test/lua/Makefile.am b/test/lua/Makefile.am
new file mode 100644
index 0000000..91de535
--- /dev/null
+++ b/test/lua/Makefile.am
@@ -0,0 +1,30 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+THRIFT = $(top_builddir)/compiler/cpp/thrift
+
+# Remove "MapType =" line to ignore some map bug for now
+stubs: ../ThriftTest.thrift $(THRIFT)
+	$(THRIFT) --gen lua $<
+	$(SED) -i 's/MapType =//g' gen-lua/ThriftTest_ttypes.lua
+
+precross: stubs
+
+clean-local:
+	$(RM) -r gen-lua
diff --git a/test/lua/test_basic_client.lua b/test/lua/test_basic_client.lua
index e7571f9..5e0966f 100644
--- a/test/lua/test_basic_client.lua
+++ b/test/lua/test_basic_client.lua
@@ -17,6 +17,8 @@
 
 
 require('TSocket')
+require('TBufferedTransport')
+require('TFramedTransport')
 require('TBinaryProtocol')
 require('ThriftTest_ThriftTest')
 require('liblualongnumber')
@@ -25,28 +27,56 @@
 
 function teardown()
   if client then
-    -- Shuts down the server
-    client:testVoid()
-
     -- close the connection
     client:close()
   end
 end
 
+function parseArgs(rawArgs)
+  local opt = {
+    protocol='binary',
+    transport='buffered',
+    port='9090',
+  }
+  for i, str in pairs(rawArgs) do
+    if i > 0 then
+      k, v = string.match(str, '--(%w+)=(%w+)')
+      assert(opt[k] ~= nil, 'Unknown argument')
+      opt[k] = v
+    end
+  end
+  return opt
+end
+
 function assertEqual(val1, val2, msg)
   assert(val1 == val2, msg)
 end
 
-function testBasicClient()
+function testBasicClient(rawArgs)
+  local opt = parseArgs(rawArgs)
   local socket = TSocket:new{
-    port = 9090
+    port = tonumber(opt.port)
   }
   assert(socket, 'Failed to create client socket')
   socket:setTimeout(5000)
 
-  local protocol = TBinaryProtocol:new{
+  local transports = {
+    buffered = TBufferedTransport,
+    framed = TFramedTransport,
+  }
+  assert(transports[opt.transport] ~= nil)
+  local transport = transports[opt.transport]:new{
     trans = socket
   }
+
+  local protocols = {
+    binary = TBinaryProtocol,
+    -- compact = TCompactProtocol,
+  }
+  assert(protocols[opt.protocol] ~= nil)
+  local protocol = protocols[opt.protocol]:new{
+    trans = transport
+  }
   assert(protocol, 'Failed to create binary protocol')
 
   client = ThriftTestClient:new{
@@ -62,6 +92,10 @@
   assertEqual(client:testString('lala'),  'lala',  'Failed testString')
   assertEqual(client:testString('wahoo'), 'wahoo', 'Failed testString')
 
+  -- Bool
+  assertEqual(client:testBool(true), true, 'Failed testBool true')
+  -- assertEqual(client:testBool(false), false, 'Failed testBool false')
+
   -- Byte
   assertEqual(client:testByte(0x01), 1,    'Failed testByte 1')
   assertEqual(client:testByte(0x40), 64,   'Failed testByte 2')
@@ -130,9 +164,8 @@
   -- TODO fix client struct equality
   --assertEqual(client:testStruct(a), a, 'Failed testStruct')
 
-  -- Call the void function and end the test (handler stops server)
-  client:testVoid()
+  -- TODO add list map set exception etc etc
 end
 
-testBasicClient()
-teardown()
\ No newline at end of file
+testBasicClient(arg)
+teardown()
diff --git a/test/lua/test_basic_server.lua b/test/lua/test_basic_server.lua
index 96a1ae9..fb8f074 100644
--- a/test/lua/test_basic_server.lua
+++ b/test/lua/test_basic_server.lua
@@ -28,7 +28,6 @@
 
 -- Stops the server
 function TestHandler:testVoid()
-  self.__server:stop()
 end
 
 function TestHandler:testString(str)