THRIFT-1091 integrate JavaScript Test into Testsuite via make check


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1082649 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 8538afa..3b4c8ba 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -33,6 +33,9 @@
 
 if WITH_JAVA
 SUBDIRS += java
+# JavaScript unit test depends on java
+# so test only if java, ant & co is available
+SUBDIRS += js/test
 endif
 
 if WITH_PYTHON
diff --git a/lib/js/test/Makefile.am b/lib/js/test/Makefile.am
new file mode 100755
index 0000000..14927c4
--- /dev/null
+++ b/lib/js/test/Makefile.am
@@ -0,0 +1,29 @@
+#
+# 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.
+#
+
+export CLASSPATH
+
+# Make sure this doesn't fail if ant is not configured.
+clean-local:
+	ANT=$(ANT) ; if test -z "$$ANT" ; then ANT=: ; fi ; \
+	$$ANT $(ANT_FLAGS) clean
+
+check-local: all
+	$(ANT) $(ANT_FLAGS) test
+
diff --git a/lib/js/test/build.xml b/lib/js/test/build.xml
index be4e7d5..ddf5df8 100644
--- a/lib/js/test/build.xml
+++ b/lib/js/test/build.xml
@@ -103,7 +103,7 @@
     <jar jarfile="${jar.file}" basedir="${build}"/>
   </target>
 
-  <target name="test" description="run the test server" depends="jstest">
+  <target name="testserver" description="run the test server" depends="jstest">
     <java classname="test.Httpd" fork="true"
       classpathref="test.classpath" failonerror="true">
       <arg value="../" />
@@ -119,7 +119,10 @@
     </exec>
   </target>
 
-  <target name="lint" description="code quality checks" depends="gjslint, jslint"/>
+  <!-- @TODO QUnit tests as part of the testsuite-->
+  <target name="test" description="run test suite" depends="init, generate, resolve, lint"/>
+
+  <target name="lint" description="code quality checks" depends="gjslint, jslint, generate"/>
 
   <target name="jslint">
     <!--