Add a test for AppBroker(1)
This commit is contained in:
parent
f3c73f9b43
commit
640ed2a9ed
52
tests/Test.expected
Normal file
52
tests/Test.expected
Normal file
|
@ -0,0 +1,52 @@
|
|||
/* $Id$ */
|
||||
|
||||
|
||||
|
||||
#ifndef Test_Test_H
|
||||
# define Test_Test_H
|
||||
|
||||
# include <stdbool.h>
|
||||
|
||||
# include <stdint.h>
|
||||
# include <System/App.h>
|
||||
|
||||
|
||||
/* types */
|
||||
typedef bool BOOL;
|
||||
typedef Buffer * BUFFER;
|
||||
typedef double * DOUBLE;
|
||||
typedef float * FLOAT;
|
||||
typedef int16_t INT16;
|
||||
typedef int32_t INT32;
|
||||
typedef uint16_t UINT16;
|
||||
typedef uint32_t UINT32;
|
||||
typedef String const * STRING;
|
||||
typedef void VOID;
|
||||
typedef bool BOOL_IN;
|
||||
|
||||
typedef BUFFER BUFFER_IN;
|
||||
|
||||
typedef DOUBLE DOUBLE_IN;
|
||||
|
||||
typedef FLOAT FLOAT_IN;
|
||||
typedef INT32 INT32_IN;
|
||||
typedef UINT32 UINT32_IN;
|
||||
typedef STRING STRING_IN;
|
||||
typedef bool * BOOL_OUT;
|
||||
|
||||
typedef Buffer * BUFFER_OUT;
|
||||
typedef int32_t * INT32_OUT;
|
||||
typedef uint32_t * UINT32_OUT;
|
||||
typedef String ** STRING_OUT;
|
||||
typedef bool * BOOL_INOUT;
|
||||
|
||||
typedef Buffer * BUFFER_INOUT;
|
||||
typedef int32_t * INT32_INOUT;
|
||||
typedef uint32_t * UINT32_INOUT;
|
||||
typedef String ** STRING_INOUT;
|
||||
|
||||
|
||||
/* calls */
|
||||
void Test_Test(App * app, AppServerClient * client, int32 i32);
|
||||
|
||||
#endif /* !Test_Test_H */
|
|
@ -0,0 +1,6 @@
|
|||
#$Id$
|
||||
service=Test
|
||||
|
||||
[call::Test]
|
||||
#ret=void
|
||||
arg1=int32,i32
|
42
tests/appbroker.sh
Executable file
42
tests/appbroker.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
#$Id$
|
||||
#Copyright (c) 2016 Pierre Pronchery <khorben@defora.org>
|
||||
#This file is part of DeforaOS System libApp
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
#
|
||||
#This program is distributed in the hope that it will be useful,
|
||||
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
#GNU General Public License for more details.
|
||||
#
|
||||
#You should have received a copy of the GNU General Public License
|
||||
#along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
#variables
|
||||
DEVNULL="/dev/null"
|
||||
PROGNAME="appbroker.sh"
|
||||
#executables
|
||||
CMP="cmp"
|
||||
DEBUG="_debug"
|
||||
MKTEMP="mktemp"
|
||||
RM="rm -f"
|
||||
|
||||
|
||||
#functions
|
||||
#main
|
||||
tmpfile=$($MKTEMP)
|
||||
[ $? -eq 0 ] || exit 2
|
||||
interface="$1"
|
||||
expected="${interface%.interface}.expected"
|
||||
$OBJDIR../tools/AppBroker$EXEEXT -o "$tmpfile" "$interface"
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
$CMP -- "$tmpfile" "$expected" #> "$DEVNULL"
|
||||
ret=$?
|
||||
fi
|
||||
$RM -- "$tmpfile"
|
||||
exit $ret
|
|
@ -4,7 +4,7 @@ cflags_force=`pkg-config --cflags libSystem`
|
|||
cflags=-W -Wall -g -O2 -pedantic -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector-all
|
||||
ldflags_force=`pkg-config --libs libSystem` -lApp
|
||||
ldflags=-L$(OBJDIR)../src -Wl,-rpath,$(OBJDIR)../src -pie -Wl,-z,relro -Wl,-z,now -rdynamic
|
||||
dist=System/App.h,Makefile,Test.interface,pkgconfig.sh,tests.sh
|
||||
dist=System/App.h,appbroker.sh,Makefile,Test.expected,Test.interface,pkgconfig.sh,tests.sh
|
||||
|
||||
[Dummy.h]
|
||||
type=script
|
||||
|
@ -49,7 +49,7 @@ depends=../src/apptransport.h
|
|||
[tests.log]
|
||||
type=script
|
||||
script=./tests.sh
|
||||
depends=$(OBJDIR)appclient$(EXEEXT),$(OBJDIR)appmessage$(EXEEXT),$(OBJDIR)appserver$(EXEEXT),$(OBJDIR)includes$(EXEEXT),$(OBJDIR)lookup$(EXEEXT),pkgconfig.sh,tests.sh,$(OBJDIR)transport$(EXEEXT),../src/transport/tcp.c,../src/transport/udp.c
|
||||
depends=Test.expected,Test.interface,appbroker.sh,$(OBJDIR)appclient$(EXEEXT),$(OBJDIR)appmessage$(EXEEXT),$(OBJDIR)appserver$(EXEEXT),$(OBJDIR)includes$(EXEEXT),$(OBJDIR)lookup$(EXEEXT),pkgconfig.sh,tests.sh,$(OBJDIR)transport$(EXEEXT),../src/transport/tcp.c,../src/transport/udp.c
|
||||
|
||||
[transport]
|
||||
type=binary
|
||||
|
|
|
@ -117,6 +117,7 @@ while [ $# -ne 0 ]; do
|
|||
FAILED=
|
||||
echo "Performing tests:" 1>&2
|
||||
$DATE > "$target"
|
||||
_test "appbroker.sh" "Test" "Test.interface"
|
||||
APPINTERFACE_Test=Test.interface \
|
||||
_test "appclient" "appclient" -a "Test" -n tcp:localhost:4242
|
||||
_test "appmessage" "appmessage"
|
||||
|
|
Loading…
Reference in New Issue
Block a user