Added test app for BMessenger tests.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@618 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2002-08-06 22:13:59 +00:00
parent 9342c27ad7
commit bf2c044d56
3 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,26 @@
// BMessengerTestApp1.cpp
#include <stdio.h>
#include <OS.h>
#include "CommonTestApp.h"
int
main()
{
// R5: doesn't set the error variable in case of success
#ifdef TEST_R5
status_t error = B_OK;
#else
status_t error = B_ERROR;
#endif
CommonTestApp app("application/x-vnd.obos-bmessenger-testapp1", &error);
init_connection();
report("error: %lx\n", error);
report("InitCheck(): %lx\n", app.InitCheck());
if (error == B_OK)
app.Run();
return 0;
}

View File

@ -0,0 +1,71 @@
SubDir OBOS_TOP src tests kits app bmessenger testapps ;
SubDirHdrs [ FDirName $(OBOS_TOP) src tests kits app common ] ;
local commonObjects = <src!tests!kits!app!common>CommonTestApp$(SUFOBJ) ;
rule SimpleBMessengerTestApp
{
# SimpleBMessengerTestApp <sources> : <resources> : <use objects> ;
local sources = $(1) ;
local resources = $(2) ;
local useObjects = $(3) ;
local name = $(sources[1]) ;
name = $(name:B) ;
SimpleBMessengerTestApp2 $(name) : $(sources) : $(resources)
: $(useObjects) ;
}
rule SimpleBMessengerTestApp2
{
# SimpleBMessengerTestApp <name> : <sources> : <resources> : <use objects> ;
local name = $(1) ;
local sources = $(2) ;
local resources = $(3) ;
local useObjects = $(4) ;
local r5name = $(name)_r5 ;
local useR5Objects ;
local object ;
for object in $(useObjects) {
useR5Objects += $(object:B=$(object:B)_r5) ;
}
if $(resources) {
AddResources $(name) : $(resources) ;
AddResources $(r5name) : $(resources) ;
}
CommonUnitTest $(name)
: $(sources)
: kits app
: <boot!home!config!lib>libopenbeos.so be stdc++.r4 $(useObjects)
: be stdc++.r4 $(useR5Objects)
: app support
;
}
rule CopyBMessengerTestApp
{
# CopyBMessengerTestApp <target> : <source> ;
local target = $(1) ;
local source = $(2) ;
local r5target = $(target)_r5 ;
local r5source = $(source)_r5 ;
MakeLocate $(target) : [ FDirName $(OBOS_TEST_DIR) kits app ] ;
MakeLocate $(r5target) : [ FDirName $(OBOS_TEST_DIR) kits app ] ;
File $(target) : $(source) ;
File $(r5target) : $(r5source) ;
local file ;
for file in $(target) $(r5target) {
MODE on $(file) = $(EXEMODE) ;
MimeSet $(file) ;
}
}
# BMessenger::BMessenger() test apps
#
local messengerTestApp1 = [ FGristFiles BMessengerTestApp1$(SUFOBJ) ] ;
SimpleBMessengerTestApp BMessengerTestApp1.cpp : BMessengerTestApp1.rsrc
: $(commonObjects) ;