Roger Meier | eaa61d8 | 2012-01-12 21:38:29 +0000 | [diff] [blame] | 1 | # Licensed to the Apache Software Foundation (ASF) under one |
| 2 | # or more contributor license agreements. See the NOTICE file |
| 3 | # distributed with this work for additional information |
| 4 | # regarding copyright ownership. The ASF licenses this file |
| 5 | # to you under the Apache License, Version 2.0 (the |
| 6 | # "License"); you may not use this file except in compliance |
| 7 | # with the License. You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, |
| 12 | # software distributed under the License is distributed on an |
| 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | # KIND, either express or implied. See the License for the |
| 15 | # specific language governing permissions and limitations |
| 16 | # under the License. |
| 17 | |
| 18 | |
| 19 | THRIFT = $(top_srcdir)/compiler/cpp/thrift |
| 20 | |
| 21 | stubs: ../ThriftTest.thrift |
| 22 | $(THRIFT) --gen js:node ../ThriftTest.thrift |
| 23 | |
| 24 | check: stubs |
Henrique | 4e1ef5b | 2013-05-11 01:24:59 +0200 | [diff] [blame] | 25 | @if which nodeunit &> /dev/null ; then \ |
Henrique | 99be027 | 2013-05-10 23:43:12 +0200 | [diff] [blame] | 26 | echo " Testing thrift/binary"; \ |
| 27 | NODE_PATH=../../lib/nodejs/lib:../../lib/nodejs/lib/thrift:$(NODE_PATH) nodeunit ../../lib/nodejs/test/binary.test.js; \ |
| 28 | fi |
Henrique | 4e1ef5b | 2013-05-11 01:24:59 +0200 | [diff] [blame] | 29 | @if which node &> /dev/null ; then \ |
| 30 | echo " Testing Client/Server"; \ |
Henrique Mendonça | 6afe053 | 2013-06-09 22:54:51 +0200 | [diff] [blame] | 31 | timeout -s14 5 $(MAKE) server & \ |
Henrique | 08c34ea | 2013-05-11 19:29:19 +0200 | [diff] [blame] | 32 | sleep 1; $(MAKE) client; sleep 2; \ |
henrique | aff2f78 | 2013-09-09 12:38:25 +0200 | [diff] [blame] | 33 | \ |
henrique | 2fdd916 | 2013-08-28 14:03:34 +0200 | [diff] [blame] | 34 | echo " Testing Multiplex Client/Server"; \ |
| 35 | sleep 4; timeout -s14 5 $(MAKE) mserver & \ |
| 36 | sleep 1; $(MAKE) mclient; sleep 2; \ |
henrique | aff2f78 | 2013-09-09 12:38:25 +0200 | [diff] [blame] | 37 | \ |
| 38 | echo " Testing Client/Server examples"; \ |
| 39 | sleep 4; timeout -s14 5 $(MAKE) -C ../../lib/nodejs/examples server & \ |
| 40 | sleep 1; $(MAKE) -C ../../lib/nodejs/examples client; sleep 2; \ |
henrique | 2fdd916 | 2013-08-28 14:03:34 +0200 | [diff] [blame] | 41 | fi |
| 42 | |
Roger Meier | eaa61d8 | 2012-01-12 21:38:29 +0000 | [diff] [blame] | 43 | clean-local: |
| 44 | $(RM) -r gen-nodejs |
| 45 | |
Henrique Mendonça | 27db434 | 2013-06-09 21:48:39 +0200 | [diff] [blame] | 46 | server: |
Roger Meier | 691ec00 | 2012-11-02 07:50:24 +0000 | [diff] [blame] | 47 | NODE_PATH=../../lib/nodejs/lib:../../lib/nodejs/lib/thrift:$(NODE_PATH) node server.js |
Roger Meier | eaa61d8 | 2012-01-12 21:38:29 +0000 | [diff] [blame] | 48 | |
Henrique Mendonça | 27db434 | 2013-06-09 21:48:39 +0200 | [diff] [blame] | 49 | client: |
Roger Meier | 691ec00 | 2012-11-02 07:50:24 +0000 | [diff] [blame] | 50 | NODE_PATH=../../lib/nodejs/lib:../../lib/nodejs/lib/thrift:$(NODE_PATH) node client.js |
henrique | 2fdd916 | 2013-08-28 14:03:34 +0200 | [diff] [blame] | 51 | |
| 52 | mserver: |
| 53 | NODE_PATH=../../lib/nodejs/lib:../../lib/nodejs/lib/thrift:$(NODE_PATH) node --harmony multiplex_server.js |
| 54 | |
| 55 | mclient: |
| 56 | NODE_PATH=../../lib/nodejs/lib:../../lib/nodejs/lib/thrift:$(NODE_PATH) node --harmony multiplex_client.js |