* Made the libbe_test environment basically working under Haiku - to actually
make it work, one would need to use versioning for all libbe symbols. This is worth an 8k price per file that links against libbe.so, so I didn't want to commit this as is. An alternative to this solution would be to write a separate application that is responsible for the app_server's window. Comments welcome. * Removed BeOS compatbility of the libbe_test stuff. * Renamed the libbe_test targets from *haiku* to *test*, ie. libbe_haiku.so is now called libbe_test.so, haiku_registrar is now test_registrar, etc. * This also removes BeOS compatibility from tracker/FSUtils.cpp (all BeOS compatibility should be removed, but I don't want to make Alexandre more work in his branch, and it's not urgent at all). * Replaced the former "run" scripts for the test environment with a single run script (see updated NOTES file). * Removed the libbe_test target from some applications - this was only to help developing them under BeOS, and is thus no longer necessary. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32521 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
bdee02b5b0
commit
2c69b5b6c0
@ -954,7 +954,7 @@ if $(TARGET_PLATFORM) = libbe_test {
|
||||
|
||||
# library name map
|
||||
TARGET_LIBRARY_NAME_MAP = LIBBE_LIBRARY_NAME_MAP ;
|
||||
LIBBE_LIBRARY_NAME_MAP_be = libbe_haiku.so ;
|
||||
LIBBE_LIBRARY_NAME_MAP_be = libbe_test.so ;
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@ rule UnitTestLib
|
||||
local lib = $(1) ;
|
||||
local sources = $(2) ;
|
||||
local libraries = $(3) ;
|
||||
|
||||
|
||||
# if TEST_DEBUG is defined, we turn on debugging
|
||||
if $(TEST_DEBUG) {
|
||||
DEBUG on $(lib) [ FGristFiles $(sources:S=$(SUFOBJ)) ] ?= 1 ;
|
||||
@ -21,7 +21,7 @@ rule UnitTestLib
|
||||
|
||||
# make the target depend on the installed libbe libraries
|
||||
Depends $(lib) :
|
||||
<tests!unittests>libbe_haiku.so <tests!unittests>libbeadapter.so ;
|
||||
<tests!unittests>libbe_test.so ;
|
||||
} else {
|
||||
ObjectDefines $(2) : TEST_R5 ;
|
||||
}
|
||||
@ -49,7 +49,7 @@ rule UnitTest
|
||||
|
||||
# make the target depend on the installed libbe libraries
|
||||
Depends $(target) :
|
||||
<tests!unittests>libbe_haiku.so <tests!unittests>libbeadapter.so ;
|
||||
<tests!unittests>libbe_test.so ;
|
||||
} else {
|
||||
ObjectDefines $(2) : TEST_R5 ;
|
||||
}
|
||||
@ -106,6 +106,6 @@ rule BuildPlatformTest
|
||||
relPath = $(SUBDIR_TOKENS[2-]) ;
|
||||
}
|
||||
MakeLocate $(target) : [ FDirName $(HAIKU_TEST_DIR) $(relPath) ] ;
|
||||
|
||||
|
||||
BuildPlatformMain $(target) : $(sources) ;
|
||||
}
|
||||
|
@ -18,13 +18,14 @@
|
||||
namespace BPrivate {
|
||||
|
||||
// names
|
||||
extern const char *kRegistrarSignature;
|
||||
extern const char *kRosterThreadName;
|
||||
extern const char *kRAppLooperPortName;
|
||||
extern const char* kRegistrarSignature;
|
||||
extern const char* kRosterThreadName;
|
||||
extern const char* kRAppLooperPortName;
|
||||
|
||||
extern const char *get_roster_port_name();
|
||||
extern const char* get_roster_port_name();
|
||||
|
||||
#define REGISTRAR_AUTHENTICATION_PORT_NAME "registrar: auth manager"
|
||||
|
||||
#define REGISTRAR_AUTHENTICATION_PORT_NAME "system:registrar:auth manager"
|
||||
|
||||
|
||||
// message constants
|
||||
@ -122,7 +123,7 @@ enum {
|
||||
B_REG_UPDATE_GROUP = 'rugr',
|
||||
};
|
||||
|
||||
// B_REG_MIME_SET_PARAM "which" constants
|
||||
// B_REG_MIME_SET_PARAM "which" constants
|
||||
enum {
|
||||
B_REG_MIME_APP_HINT = 'rgmh',
|
||||
B_REG_MIME_ATTR_INFO = 'rgma',
|
||||
|
@ -18,9 +18,14 @@
|
||||
// Server port names. The input port is the port which is used to receive
|
||||
// input messages from the Input Server. The other is the "main" port for
|
||||
// the server and is utilized mostly by BApplication objects.
|
||||
#define SERVER_PORT_NAME "haiku app_server"
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
# define SERVER_PORT_NAME "system:app_server"
|
||||
#else
|
||||
# define SERVER_PORT_NAME "haiku-test:app_server"
|
||||
#endif
|
||||
|
||||
#if TEST_MODE
|
||||
# define SERVER_INPUT_PORT "haiku input port"
|
||||
# define SERVER_INPUT_PORT "haiku-test:input port"
|
||||
#endif
|
||||
|
||||
#define AS_REQUEST_COLOR_KEY 0x00010000
|
||||
|
@ -16,9 +16,3 @@ Preference DriveSetup :
|
||||
: be libcolumnlistview.a libshared.a $(TARGET_LIBSUPC++)
|
||||
: DriveSetup.rdef
|
||||
;
|
||||
|
||||
if ( $(TARGET_PLATFORM) = libbe_test ) {
|
||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : DriveSetup
|
||||
: tests!apps ;
|
||||
}
|
||||
|
||||
|
@ -305,12 +305,3 @@ Application Icon-O-Matic :
|
||||
|
||||
: Icon-O-Matic.rdef
|
||||
;
|
||||
|
||||
|
||||
|
||||
# also install in app_server test environment
|
||||
if ( $(TARGET_PLATFORM) = libbe_test ) {
|
||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Icon-O-Matic
|
||||
: tests!apps ;
|
||||
}
|
||||
|
||||
|
@ -18,12 +18,7 @@ if $(RUN_WITHOUT_APP_SERVER) != 0 {
|
||||
}
|
||||
|
||||
UsePrivateHeaders [ FDirName kernel ] # For KMessage.h
|
||||
UsePrivateHeaders syslog_daemon ; # For syslog.cpp
|
||||
|
||||
local pngDump ;
|
||||
if $(TARGET_PLATFORM) != haiku {
|
||||
pngDump = libpng.so libz.so ;
|
||||
}
|
||||
#UsePrivateHeaders syslog_daemon ; # For syslog.cpp
|
||||
|
||||
# Build our libbe.so
|
||||
|
||||
@ -42,31 +37,16 @@ SharedLibrary libbe.so :
|
||||
libagg.a
|
||||
|
||||
libroot.so # make sure it links against our libroot.so
|
||||
$(pngDump) # For dumping the screen to PNG in the Interface Kit on R5
|
||||
$(TARGET_LIBSTDC++)
|
||||
;
|
||||
|
||||
# Build libbe_haiku.so
|
||||
# Build libbe_test.so
|
||||
|
||||
SetSupportedPlatformsForTarget libbe_haiku.so : libbe_test ;
|
||||
SetSupportedPlatformsForTarget libbe_test.so : libbe_test ;
|
||||
|
||||
if $(TARGET_PLATFORM) = libbe_test {
|
||||
local syslog = [ FGristFiles syslog.o ] ;
|
||||
# Remove _NO_INLINE_ASM from the defines for syslog.cpp. Otherwise we get
|
||||
# references to tls_get/set() etc. that don't exist under BeOS.
|
||||
TARGET_DEFINES on $(syslog)
|
||||
= [ on $(syslog) FFilter $(TARGET_DEFINES) : _NO_INLINE_ASM ] ;
|
||||
SetVersionScript libbe_test.so : libbe_test_versions ;
|
||||
|
||||
# We need to use our <syslog.h>, because the syslog() prototype differs
|
||||
# from the BeOS one.
|
||||
TARGET_DEFINES on $(syslog) += _SYS_LOG_H ;
|
||||
TARGET_C++FLAGS on $(syslog) = [ on $(syslog) return $(TARGET_C++FLAGS) ]
|
||||
-include [ FDirName $(HAIKU_TOP) headers posix syslog.h ] ;
|
||||
}
|
||||
|
||||
SharedLibrary libbe_haiku.so :
|
||||
KMessage.cpp
|
||||
syslog.cpp
|
||||
SharedLibrary libbe_test.so :
|
||||
:
|
||||
<libbe>app_kit.o
|
||||
<libbe>interface_kit.o
|
||||
@ -76,16 +56,14 @@ SharedLibrary libbe_haiku.so :
|
||||
libicon.a
|
||||
libagg.a
|
||||
|
||||
libbeadapter.so
|
||||
$(TARGET_NETWORK_LIBS)
|
||||
$(TARGET_LIBSTDC++)
|
||||
;
|
||||
|
||||
SEARCH on [ FGristFiles KMessage.cpp ]
|
||||
= [ FDirName $(HAIKU_TOP) src system kernel messaging ] ;
|
||||
|
||||
SEARCH on [ FGristFiles syslog.cpp ]
|
||||
= [ FDirName $(HAIKU_TOP) src system libroot posix ] ;
|
||||
#SEARCH on [ FGristFiles KMessage.cpp ]
|
||||
# = [ FDirName $(HAIKU_TOP) src system kernel messaging ] ;
|
||||
#
|
||||
#SEARCH on [ FGristFiles syslog.cpp ]
|
||||
# = [ FDirName $(HAIKU_TOP) src system libroot posix ] ;
|
||||
|
||||
|
||||
SubInclude HAIKU_TOP src kits app ;
|
||||
|
@ -1,11 +1,12 @@
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Copyright 2001-2009, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Ingo Weinhold (bonefish@users.sf.net)
|
||||
*/
|
||||
|
||||
|
||||
//! API classes - registrar interface.
|
||||
|
||||
|
||||
@ -16,18 +17,27 @@
|
||||
namespace BPrivate {
|
||||
|
||||
// names
|
||||
const char *kRegistrarSignature = "application/x-vnd.haiku-registrar";
|
||||
const char *kRosterThreadName = "_roster_thread_";
|
||||
const char *kRAppLooperPortName = "rAppLooperPort";
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
const char* kRegistrarSignature = "application/x-vnd.haiku-registrar";
|
||||
const char* kRAppLooperPortName = "rAppLooperPort";
|
||||
#else
|
||||
const char* kRegistrarSignature = "application/x-vnd.test-registrar";
|
||||
const char* kRAppLooperPortName = "haiku-test:rAppLooperPort";
|
||||
#endif
|
||||
const char* kRosterThreadName = "_roster_thread_";
|
||||
|
||||
|
||||
// get_roster_port_name
|
||||
/*! \brief Returns the name of the main request port of the registrar (roster).
|
||||
\return the name of the registrar request port.
|
||||
*/
|
||||
const char *
|
||||
const char*
|
||||
get_roster_port_name()
|
||||
{
|
||||
return "_haiku_roster_port_";
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
return "system:roster";
|
||||
#else
|
||||
return "haiku-test:roster";
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace BPrivate
|
||||
|
6
src/kits/libbe_test_versions
Normal file
6
src/kits/libbe_test_versions
Normal file
@ -0,0 +1,6 @@
|
||||
LIBBE_TEST_BASE {
|
||||
};
|
||||
LIBBE_TEST {
|
||||
global:
|
||||
*;
|
||||
};
|
@ -997,7 +997,12 @@ create_directory(const char* path, mode_t mode)
|
||||
// #pragma mark - symbol versions
|
||||
|
||||
|
||||
#if __GNUC__ == 2 // gcc 2
|
||||
#ifdef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
||||
|
||||
B_DEFINE_SYMBOL_VERSION("_GetStatFor__C10BDirectoryPCcP4stat",
|
||||
"GetStatFor__C10BDirectoryPCcP4stat@@LIBBE_TEST");
|
||||
|
||||
#elif __GNUC__ == 2 // gcc 2
|
||||
|
||||
// BeOS compatible GetStatFor()
|
||||
B_DEFINE_SYMBOL_VERSION("_GetStatFor__C10BDirectoryPCcP9stat_beos",
|
||||
|
@ -1130,7 +1130,12 @@ operator<(const entry_ref & a, const entry_ref & b)
|
||||
// #pragma mark - symbol versions
|
||||
|
||||
|
||||
#if __GNUC__ == 2 // gcc 2
|
||||
#ifdef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
||||
|
||||
B_DEFINE_SYMBOL_VERSION("_GetStat__C6BEntryP4stat",
|
||||
"GetStat__C6BEntryP4stat@@LIBBE_TEST");
|
||||
|
||||
#elif __GNUC__ == 2 // gcc 2
|
||||
|
||||
// BeOS compatible GetStat()
|
||||
B_DEFINE_SYMBOL_VERSION("_GetStat__C6BEntryP9stat_beos",
|
||||
|
@ -75,7 +75,7 @@ MergeObject <libbe>storage_kit.o :
|
||||
MutablePartition.cpp
|
||||
Partition.cpp
|
||||
PartitionDelegate.cpp
|
||||
PartitioningInfo.cpp
|
||||
PartitioningInfo.cpp
|
||||
PartitionParameterEditor.cpp
|
||||
PartitionReference.cpp
|
||||
|
||||
@ -89,12 +89,3 @@ MergeObject <libbe>storage_kit.o :
|
||||
SetStringJob.cpp
|
||||
UninitializeJob.cpp
|
||||
;
|
||||
|
||||
|
||||
# The adapter library we need (Storage Kit).
|
||||
#
|
||||
|
||||
SharedLibrary libbeadapter.so :
|
||||
LibBeAdapter.cpp
|
||||
;
|
||||
LinkAgainst libbeadapter.so : be : false ;
|
||||
|
@ -1,734 +0,0 @@
|
||||
// LibBeAdapter.cpp
|
||||
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <new>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <Directory.h>
|
||||
#include <Entry.h>
|
||||
#include <fs_attr.h>
|
||||
#include <fs_query.h>
|
||||
#include <Path.h>
|
||||
|
||||
#include <syscalls.h>
|
||||
|
||||
|
||||
mode_t __gUmask = 022;
|
||||
// this is the standard umask and is used by BFile
|
||||
|
||||
enum {
|
||||
FD_TYPE_UNKNOWN,
|
||||
FD_TYPE_DIR,
|
||||
FD_TYPE_ATTR_DIR,
|
||||
FD_TYPE_QUERY,
|
||||
};
|
||||
|
||||
static const int kFDTableSlotCount = 1024;
|
||||
static uint8 sFDTable[kFDTableSlotCount];
|
||||
|
||||
static struct InitDirFDTable {
|
||||
InitDirFDTable()
|
||||
{
|
||||
memset(sFDTable, FD_TYPE_UNKNOWN, sizeof(sFDTable));
|
||||
}
|
||||
} sInitDirFDTable;
|
||||
|
||||
// _kern_entry_ref_to_path
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_entry_ref_to_path(dev_t device, ino_t inode, const char *leaf,
|
||||
char *userPath, size_t pathLength)
|
||||
{
|
||||
// check buffer
|
||||
if (!userPath)
|
||||
return B_BAD_VALUE;
|
||||
// construct an entry_ref
|
||||
if (!leaf)
|
||||
leaf = ".";
|
||||
entry_ref ref(device, inode, leaf);
|
||||
// get the path
|
||||
BPath path;
|
||||
status_t error = path.SetTo(&ref);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
// copy the path into the buffer
|
||||
if (strlcpy(userPath, path.Path(), pathLength) >= pathLength)
|
||||
return B_BUFFER_OVERFLOW;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
// Syscall mapping between R5 and us
|
||||
|
||||
// private libroot.so functions
|
||||
|
||||
extern "C" status_t _kclosedir_(int fd);
|
||||
|
||||
extern "C" status_t _kclose_attr_dir_(int fd);
|
||||
|
||||
extern "C" status_t _kclose_query_(int fd);
|
||||
|
||||
extern "C" ssize_t _kreadlink_(int fd, const char *path, char *buffer,
|
||||
size_t bufferSize);
|
||||
|
||||
extern "C" status_t _krstat_(int fd, const char *path, struct stat *st,
|
||||
int16 unknown);
|
||||
|
||||
extern "C" status_t _kwstat_(int fd, const char *path, const struct stat *st,
|
||||
uint32 mask, uint16 unknown);
|
||||
|
||||
extern "C" status_t _kwfsstat_(dev_t device, const struct fs_info *info,
|
||||
long mask);
|
||||
|
||||
extern "C" status_t _klock_node_(int fd);
|
||||
|
||||
extern "C" status_t _kunlock_node_(int fd);
|
||||
|
||||
extern "C" status_t _kstart_watching_vnode_(dev_t device, ino_t node,
|
||||
uint32 flags, port_id port,
|
||||
int32 handlerToken);
|
||||
|
||||
extern "C" status_t _kstop_watching_vnode_(dev_t device, ino_t node,
|
||||
port_id port, int32 handlerToken);
|
||||
|
||||
|
||||
extern "C" status_t _kstop_notifying_(port_id port, int32 handlerToken);
|
||||
|
||||
extern "C" status_t _kget_safemode_option_(const char *parameter, char *buffer, size_t *_bufferSize);
|
||||
|
||||
|
||||
status_t
|
||||
_kern_write_fs_info(dev_t device, const struct fs_info *info, int mask)
|
||||
{
|
||||
return _kwfsstat_(device, info, mask);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
_kern_stop_notifying(port_id port, uint32 token)
|
||||
{
|
||||
return _kstop_notifying_(port, token);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
_kern_start_watching(dev_t device, ino_t node, uint32 flags,
|
||||
port_id port, uint32 token)
|
||||
{
|
||||
return _kstart_watching_vnode_(device, node, flags, port, token);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
_kern_stop_watching(dev_t device, ino_t node, port_id port, uint32 token)
|
||||
{
|
||||
return _kstop_watching_vnode_(device, node, port, token);
|
||||
}
|
||||
|
||||
// init_dir
|
||||
static
|
||||
status_t
|
||||
init_dir(BDirectory &dir, int fd)
|
||||
{
|
||||
// get a node_ref for the dir
|
||||
struct stat st;
|
||||
if (fstat(fd, &st) < 0)
|
||||
return errno;
|
||||
node_ref ref;
|
||||
ref.device = st.st_dev;
|
||||
ref.node = st.st_ino;
|
||||
// init the dir
|
||||
return dir.SetTo(&ref);
|
||||
}
|
||||
|
||||
// open_dir_hack
|
||||
static
|
||||
int
|
||||
open_dir_hack(const char *path)
|
||||
{
|
||||
DIR *dirHandle = opendir(path);
|
||||
if (!dirHandle)
|
||||
return errno;
|
||||
int dirFD = dirHandle->fd;
|
||||
if (dirFD < 0 || dirFD >= kFDTableSlotCount) {
|
||||
closedir(dirHandle);
|
||||
return B_ERROR;
|
||||
}
|
||||
free(dirHandle);
|
||||
sFDTable[dirFD] = FD_TYPE_DIR;
|
||||
return dirFD;
|
||||
}
|
||||
|
||||
// get_path
|
||||
static
|
||||
int
|
||||
get_path(int fd, const char *relPath, BPath &path)
|
||||
{
|
||||
if (fd < 0 || relPath && relPath[0] == '/')
|
||||
return path.SetTo(relPath);
|
||||
BDirectory dir;
|
||||
status_t error = init_dir(dir, fd);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
return path.SetTo(&dir, relPath);
|
||||
}
|
||||
|
||||
// _kern_open
|
||||
extern "C"
|
||||
int
|
||||
_kern_open(int fd, const char *path, int omode, int permissions)
|
||||
{
|
||||
status_t error;
|
||||
BPath fullPath;
|
||||
if (!path)
|
||||
path = ".";
|
||||
if (fd >= 0) {
|
||||
// construct the full path
|
||||
error = get_path(fd, path, fullPath);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
path = fullPath.Path();
|
||||
}
|
||||
// open the file
|
||||
int result = open(path, omode, permissions);
|
||||
if (result < 0)
|
||||
return errno;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// _kern_open_entry_ref
|
||||
extern "C"
|
||||
int
|
||||
_kern_open_entry_ref(dev_t device, ino_t inode, const char *name, int omode,
|
||||
int permissions)
|
||||
{
|
||||
BPath fullPath;
|
||||
node_ref ref;
|
||||
ref.device = device;
|
||||
ref.node = inode;
|
||||
// init the dir and get the path
|
||||
BDirectory dir;
|
||||
status_t error = dir.SetTo(&ref);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
error = fullPath.SetTo(&dir, name);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
// open the file
|
||||
int fd = open(fullPath.Path(), omode, permissions);
|
||||
if (fd < 0)
|
||||
return errno;
|
||||
return fd;
|
||||
}
|
||||
|
||||
// _kern_open_dir
|
||||
extern "C"
|
||||
int
|
||||
_kern_open_dir(int fd, const char *path)
|
||||
{
|
||||
status_t error;
|
||||
BPath fullPath;
|
||||
if (fd >= 0) {
|
||||
if (!path)
|
||||
return _kern_dup(fd);
|
||||
// construct the full path
|
||||
error = get_path(fd, path, fullPath);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
path = fullPath.Path();
|
||||
}
|
||||
// open the dir
|
||||
return open_dir_hack(path);
|
||||
}
|
||||
|
||||
// _kern_open_dir_entry_ref
|
||||
extern "C"
|
||||
int
|
||||
_kern_open_dir_entry_ref(dev_t device, ino_t inode, const char *path)
|
||||
{
|
||||
BPath fullPath;
|
||||
node_ref ref;
|
||||
ref.device = device;
|
||||
ref.node = inode;
|
||||
// init the dir and get the path
|
||||
BDirectory dir;
|
||||
status_t error = dir.SetTo(&ref);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
error = fullPath.SetTo(&dir, path);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
path = fullPath.Path();
|
||||
// open the dir
|
||||
return open_dir_hack(path);
|
||||
}
|
||||
|
||||
// _kern_open_parent_dir
|
||||
extern "C"
|
||||
int
|
||||
_kern_open_parent_dir(int fd, char *name, size_t pathLength)
|
||||
{
|
||||
if (fd < 0)
|
||||
return B_BAD_VALUE;
|
||||
// get the dir
|
||||
BDirectory dir;
|
||||
status_t error = init_dir(dir, fd);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
// get an entry
|
||||
BEntry entry;
|
||||
error = entry.SetTo(&dir, NULL);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
// copy back the path
|
||||
if (name) {
|
||||
char tmpName[B_FILE_NAME_LENGTH];
|
||||
error = entry.GetName(tmpName);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
if (strlcpy(name, tmpName, pathLength) >= pathLength)
|
||||
return B_BUFFER_OVERFLOW;
|
||||
}
|
||||
// get the parent dir path
|
||||
BPath path;
|
||||
error = path.SetTo(&dir, "..");
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
// open the dir
|
||||
return open_dir_hack(path.Path());
|
||||
}
|
||||
|
||||
// _kern_open_query
|
||||
extern "C"
|
||||
int
|
||||
_kern_open_query(dev_t device, const char *query, size_t queryLength, uint32 flags, port_id port,
|
||||
int32 token)
|
||||
{
|
||||
// check params
|
||||
if (!query || queryLength == 0 || device < 0)
|
||||
return B_BAD_VALUE;
|
||||
if (flags & B_LIVE_QUERY && port < 0)
|
||||
return B_BAD_VALUE;
|
||||
// open query
|
||||
DIR *dirHandle;
|
||||
if (flags & B_LIVE_QUERY)
|
||||
dirHandle = fs_open_live_query(device, query, flags, port, token);
|
||||
else
|
||||
dirHandle = fs_open_query(device, query, flags);
|
||||
if (!dirHandle)
|
||||
return errno;
|
||||
// get FD and return result
|
||||
int dirFD = dirHandle->fd;
|
||||
if (dirFD < 0 || dirFD >= kFDTableSlotCount) {
|
||||
fs_close_query(dirHandle);
|
||||
return B_ERROR;
|
||||
}
|
||||
free(dirHandle);
|
||||
sFDTable[dirFD] = FD_TYPE_QUERY;
|
||||
return dirFD;
|
||||
}
|
||||
|
||||
// _kern_create_dir
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_create_dir(int fd, const char *path, int perms)
|
||||
{
|
||||
if (!path)
|
||||
return B_BAD_VALUE;
|
||||
status_t error;
|
||||
BPath fullPath;
|
||||
if (fd >= 0) {
|
||||
// construct the full path
|
||||
error = get_path(fd, path, fullPath);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
path = fullPath.Path();
|
||||
}
|
||||
// create the dir
|
||||
return (mkdir(path, perms) < 0 ? errno : B_OK);
|
||||
}
|
||||
|
||||
// _kern_create_symlink
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_create_symlink(int fd, const char *path, const char *toPath, int mode)
|
||||
{
|
||||
(void)mode;
|
||||
if (!path)
|
||||
return B_BAD_VALUE;
|
||||
status_t error;
|
||||
BPath fullPath;
|
||||
if (fd >= 0) {
|
||||
// construct the full path
|
||||
error = get_path(fd, path, fullPath);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
path = fullPath.Path();
|
||||
}
|
||||
// create the symlink
|
||||
return (symlink(toPath, path) < 0 ? errno : B_OK);
|
||||
}
|
||||
|
||||
// _kern_close
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_close(int fd)
|
||||
{
|
||||
if (fd >= 0 && fd < kFDTableSlotCount && sFDTable[fd] != FD_TYPE_UNKNOWN) {
|
||||
status_t error;
|
||||
switch (sFDTable[fd]) {
|
||||
case FD_TYPE_DIR:
|
||||
error = _kclosedir_(fd);
|
||||
break;
|
||||
case FD_TYPE_ATTR_DIR:
|
||||
error = _kclose_attr_dir_(fd);
|
||||
break;
|
||||
case FD_TYPE_QUERY:
|
||||
error = _kclose_query_(fd);
|
||||
break;
|
||||
default:
|
||||
error = B_BAD_VALUE;
|
||||
break;
|
||||
}
|
||||
sFDTable[fd] = FD_TYPE_UNKNOWN;
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
} else if (close(fd) < 0)
|
||||
return errno;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
// _kern_dup
|
||||
extern "C"
|
||||
int
|
||||
_kern_dup(int fd)
|
||||
{
|
||||
int clonedFD = dup(fd);
|
||||
if (clonedFD < 0)
|
||||
return errno;
|
||||
if (fd >= 0 && fd < kFDTableSlotCount && sFDTable[fd] != FD_TYPE_UNKNOWN
|
||||
&& clonedFD >= 0 && clonedFD < kFDTableSlotCount) {
|
||||
sFDTable[clonedFD] = sFDTable[fd];
|
||||
}
|
||||
return clonedFD;
|
||||
}
|
||||
|
||||
// _kern_read
|
||||
extern "C"
|
||||
ssize_t
|
||||
_kern_read(int fd, off_t pos, void *buffer, size_t bufferSize)
|
||||
{
|
||||
if (!buffer)
|
||||
return B_BAD_VALUE;
|
||||
ssize_t result;
|
||||
if (pos == -1)
|
||||
result = read(fd, buffer, bufferSize);
|
||||
else
|
||||
result = read_pos(fd, pos, buffer, bufferSize);
|
||||
return (result < 0 ? errno : result);
|
||||
}
|
||||
|
||||
// _kern_write
|
||||
extern "C"
|
||||
ssize_t
|
||||
_kern_write(int fd, off_t pos, const void *buffer, size_t bufferSize)
|
||||
{
|
||||
if (!buffer)
|
||||
return B_BAD_VALUE;
|
||||
ssize_t result;
|
||||
if (pos == -1)
|
||||
result = write(fd, buffer, bufferSize);
|
||||
else
|
||||
result = write_pos(fd, pos, buffer, bufferSize);
|
||||
return (result < 0 ? errno : result);
|
||||
}
|
||||
|
||||
// _kern_seek
|
||||
extern "C"
|
||||
off_t
|
||||
_kern_seek(int fd, off_t pos, int seekType)
|
||||
{
|
||||
off_t result = lseek(fd, pos, seekType);
|
||||
return (result < 0 ? errno : result);
|
||||
}
|
||||
|
||||
// _kern_read_dir
|
||||
extern "C"
|
||||
ssize_t
|
||||
_kern_read_dir(int fd, struct dirent *buffer, size_t bufferSize,
|
||||
uint32 maxCount)
|
||||
{
|
||||
if (fd < 0 || !buffer)
|
||||
return B_BAD_VALUE;
|
||||
if (fd >= kFDTableSlotCount || sFDTable[fd] == FD_TYPE_UNKNOWN)
|
||||
return B_BAD_VALUE;
|
||||
if (maxCount < 1)
|
||||
return 0;
|
||||
char tmpBuffer[sizeof(struct dirent) + B_FILE_NAME_LENGTH];
|
||||
DIR *dirDir = (DIR*)tmpBuffer;
|
||||
dirDir->fd = fd;
|
||||
dirent *entry = NULL;
|
||||
switch (sFDTable[fd]) {
|
||||
case FD_TYPE_DIR:
|
||||
entry = readdir(dirDir);
|
||||
break;
|
||||
case FD_TYPE_ATTR_DIR:
|
||||
entry = fs_read_attr_dir(dirDir);
|
||||
break;
|
||||
case FD_TYPE_QUERY:
|
||||
entry = fs_read_query(dirDir);
|
||||
break;
|
||||
}
|
||||
if (!entry)
|
||||
return 0;
|
||||
// Don't trust entry->d_reclen.
|
||||
// Unlike stated in BeBook::BEntryList, the value is not the length
|
||||
// of the whole structure, but only of the name. Some FSs count
|
||||
// the terminating '\0', others don't.
|
||||
// So we calculate the size ourselves (including the '\0'):
|
||||
size_t entryLen = entry->d_name + strlen(entry->d_name) + 1
|
||||
- (char*)entry;
|
||||
if (bufferSize >= entryLen) {
|
||||
memcpy(buffer, entry, entryLen);
|
||||
return 1;
|
||||
} else // buffer too small
|
||||
return B_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
// _kern_rewind_dir
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_rewind_dir(int fd)
|
||||
{
|
||||
if (fd < 0 || fd >= kFDTableSlotCount || sFDTable[fd] == FD_TYPE_UNKNOWN)
|
||||
return B_BAD_VALUE;
|
||||
char tmpBuffer[sizeof(struct dirent) + B_FILE_NAME_LENGTH];
|
||||
DIR *dirDir = (DIR*)tmpBuffer;
|
||||
dirDir->fd = fd;
|
||||
switch (sFDTable[fd]) {
|
||||
case FD_TYPE_DIR:
|
||||
rewinddir(dirDir);
|
||||
break;
|
||||
case FD_TYPE_ATTR_DIR:
|
||||
fs_rewind_attr_dir(dirDir);
|
||||
break;
|
||||
case FD_TYPE_QUERY:
|
||||
return B_BAD_VALUE;
|
||||
break;
|
||||
}
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
// _kern_read_link
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_read_link(int fd, const char *path, char *buffer, size_t *_bufferSize)
|
||||
{
|
||||
ssize_t result = _kreadlink_(fd, path, buffer, *_bufferSize);
|
||||
if (result < 0)
|
||||
return result;
|
||||
|
||||
*_bufferSize = result;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
// _kern_remove_dir
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_remove_dir(int fd, const char *relPath)
|
||||
{
|
||||
BPath path;
|
||||
status_t error = get_path(fd, relPath, path);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
if (rmdir(path.Path()) < 0)
|
||||
return errno;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
// _kern_unlink
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_unlink(int fd, const char *relPath)
|
||||
{
|
||||
BPath path;
|
||||
status_t error = get_path(fd, relPath, path);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
if (unlink(path.Path()) < 0)
|
||||
return errno;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
// _kern_rename
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_rename(int oldDir, const char *oldRelPath, int newDir,
|
||||
const char *newRelPath)
|
||||
{
|
||||
// get old path
|
||||
BPath oldPath;
|
||||
status_t error = get_path(oldDir, oldRelPath, oldPath);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
// get new path
|
||||
BPath newPath;
|
||||
error = get_path(newDir, newRelPath, newPath);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
// rename
|
||||
if (rename(oldPath.Path(), newPath.Path()) < 0)
|
||||
return errno;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
// _kern_read_stat
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_read_stat(int fd, const char *path, bool traverseLink, struct stat *st,
|
||||
size_t statSize)
|
||||
{
|
||||
if (traverseLink)
|
||||
return B_ERROR; // unsupported
|
||||
return _krstat_(fd, path, st, 0);
|
||||
}
|
||||
|
||||
// _kern_write_stat
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_write_stat(int fd, const char *path, bool traverseLink,
|
||||
const struct stat *st, size_t statSize, int statMask)
|
||||
{
|
||||
if (traverseLink)
|
||||
return B_ERROR; // unsupported
|
||||
return _kwstat_(fd, path, st, statMask, 0);
|
||||
}
|
||||
|
||||
// _kern_lock_node
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_lock_node(int fd)
|
||||
{
|
||||
return _klock_node_(fd);
|
||||
}
|
||||
|
||||
// _kern_unlock_node
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_unlock_node(int fd)
|
||||
{
|
||||
return _kunlock_node_(fd);
|
||||
}
|
||||
|
||||
// _kern_fsync
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_fsync(int fd)
|
||||
{
|
||||
return (fsync(fd) < 0) ? errno : B_OK ;
|
||||
}
|
||||
|
||||
// _kern_open_attr_dir
|
||||
extern "C"
|
||||
int
|
||||
_kern_open_attr_dir(int fd, const char *path)
|
||||
{
|
||||
if (fd < 0 && !path)
|
||||
return B_BAD_VALUE;
|
||||
if (fd >= 0 && path)
|
||||
return B_ERROR; // unsupported
|
||||
DIR *dirHandle = (fd >= 0 ? fs_fopen_attr_dir(fd) : fs_open_attr_dir(path));
|
||||
if (!dirHandle)
|
||||
return errno;
|
||||
int dirFD = dirHandle->fd;
|
||||
if (dirFD < 0 || dirFD >= kFDTableSlotCount) {
|
||||
fs_close_attr_dir(dirHandle);
|
||||
return B_ERROR;
|
||||
}
|
||||
free(dirHandle);
|
||||
sFDTable[dirFD] = FD_TYPE_ATTR_DIR;
|
||||
return dirFD;
|
||||
}
|
||||
|
||||
// _kern_remove_attr
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_remove_attr(int fd, const char *name)
|
||||
{
|
||||
return fs_remove_attr(fd, name) == -1 ? errno : B_OK ;
|
||||
}
|
||||
|
||||
// _kern_rename_attr
|
||||
extern "C"
|
||||
status_t
|
||||
_kern_rename_attr(int fromFile, const char *fromName, int toFile,
|
||||
const char *toName)
|
||||
{
|
||||
status_t error = (fromName && toName ? B_OK : B_BAD_VALUE);
|
||||
// Figure out how much data there is
|
||||
attr_info info;
|
||||
if (error == B_OK) {
|
||||
if (fs_stat_attr(fromFile, fromName, &info) < 0)
|
||||
error = B_BAD_VALUE; // This is what R5::BNode returns...
|
||||
}
|
||||
// Alloc a buffer
|
||||
char *data = NULL;
|
||||
if (error == B_OK) {
|
||||
// alloc at least one byte
|
||||
data = new(nothrow) char[info.size >= 1 ? info.size : 1];
|
||||
if (data == NULL)
|
||||
error = B_NO_MEMORY;
|
||||
}
|
||||
// Read in the data
|
||||
if (error == B_OK) {
|
||||
ssize_t size = fs_read_attr(fromFile, fromName, info.type, 0, data,
|
||||
info.size);
|
||||
if (size != info.size) {
|
||||
if (size < 0)
|
||||
error = errno;
|
||||
else
|
||||
error = B_ERROR;
|
||||
}
|
||||
}
|
||||
// Write it to the new attribute
|
||||
if (error == B_OK) {
|
||||
ssize_t size = 0;
|
||||
if (info.size > 0)
|
||||
size = fs_write_attr(toFile, toName, info.type, 0, data, info.size);
|
||||
if (size != info.size) {
|
||||
if (size < 0)
|
||||
error = errno;
|
||||
else
|
||||
error = B_ERROR;
|
||||
}
|
||||
}
|
||||
// free the buffer
|
||||
if (data)
|
||||
delete[] data;
|
||||
// Remove the old attribute
|
||||
if (error == B_OK)
|
||||
error = _kern_remove_attr(fromFile, fromName);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
extern "C" status_t
|
||||
_kern_get_safemode_option(const char *parameter, char *buffer, size_t *_bufferSize)
|
||||
{
|
||||
return _kget_safemode_option_(parameter, buffer, _bufferSize);
|
||||
}
|
||||
|
@ -863,7 +863,12 @@ BNode::_GetStat(struct stat_beos *st) const
|
||||
// #pragma mark - symbol versions
|
||||
|
||||
|
||||
#if __GNUC__ == 2 // gcc 2
|
||||
#ifdef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
||||
|
||||
B_DEFINE_SYMBOL_VERSION("_GetStat__C5BNodeP4stat",
|
||||
"GetStat__C5BNodeP4stat@@LIBBE_TEST");
|
||||
|
||||
#elif __GNUC__ == 2 // gcc 2
|
||||
|
||||
// BeOS compatible GetStat()
|
||||
B_DEFINE_SYMBOL_VERSION("_GetStat__C5BNodeP9stat_beos",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008, Haiku Inc. All Rights Reserved.
|
||||
* Copyright 2002-2009, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@ -25,9 +25,7 @@
|
||||
#include <storage_support.h>
|
||||
#include <syscalls.h>
|
||||
|
||||
#ifndef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
||||
# include <fs_interface.h>
|
||||
#endif
|
||||
#include <fs_interface.h>
|
||||
|
||||
|
||||
/*!
|
||||
|
@ -545,7 +545,7 @@ InitCopy(uint32 moveMode, BObjectList<entry_ref> *srcList, thread_id thread,
|
||||
if (gStatusWindow)
|
||||
gStatusWindow->RemoveStatusItem(thread);
|
||||
|
||||
BAlert *alert = new BAlert("",
|
||||
BAlert *alert = new BAlert("",
|
||||
"You can't move or copy items to read-only volumes.",
|
||||
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||
alert->SetShortcut(0, B_ESCAPE);
|
||||
@ -1735,7 +1735,7 @@ PreFlightNameCheck(BObjectList<entry_ref> *srcList, const BDirectory *destDir,
|
||||
const char *verb = (moveMode == kMoveSelectionTo) ? "moving" : "copying";
|
||||
char replaceMsg[256];
|
||||
sprintf(replaceMsg, kReplaceManyStr, verb, verb);
|
||||
|
||||
|
||||
BAlert *alert = new BAlert("", replaceMsg,
|
||||
"Cancel", "Prompt", "Replace All");
|
||||
alert->SetShortcut(0, B_ESCAPE);
|
||||
@ -2950,21 +2950,12 @@ _TrackerLaunchAppWithDocuments(const entry_ref *appRef, const BMessage *refs, bo
|
||||
|
||||
extern "C" char** environ;
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
extern "C" status_t _kern_load_image(const char * const *flatArgs,
|
||||
size_t flatArgsSize, int32 argCount, int32 envCount, int32 priority,
|
||||
uint32 flags, port_id errorPort, uint32 errorToken);
|
||||
extern "C" status_t __flatten_process_args(const char * const *args,
|
||||
int32 argCount, const char * const *env, int32 envCount, char ***_flatArgs,
|
||||
size_t *_flatSize);
|
||||
#else
|
||||
extern "C"
|
||||
# if !B_BEOS_VERSION_DANO
|
||||
_IMPEXP_ROOT
|
||||
# endif
|
||||
status_t _kload_image_etc_(int argc, char **argv, char **envp,
|
||||
char *buf, int bufsize);
|
||||
#endif
|
||||
|
||||
|
||||
static status_t
|
||||
@ -2979,7 +2970,6 @@ LoaderErrorDetails(const entry_ref *app, BString &details)
|
||||
|
||||
char *argv[2] = { const_cast<char *>(path.Path()), 0};
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
port_id errorPort = create_port(1, "Tracker loader error");
|
||||
|
||||
// count environment variables
|
||||
@ -3062,11 +3052,6 @@ LoaderErrorDetails(const entry_ref *app, BString &details)
|
||||
details += detail;
|
||||
}
|
||||
|
||||
return B_OK;
|
||||
#else
|
||||
result = _kload_image_etc_(1, argv, environ, details.LockBuffer(1024), 1024);
|
||||
details.UnlockBuffer();
|
||||
#endif
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
@ -288,9 +288,13 @@ DesktopSettingsPrivate::_Load()
|
||||
status_t
|
||||
DesktopSettingsPrivate::Save(uint32 mask)
|
||||
{
|
||||
#if TEST_MODE
|
||||
return B_OK;
|
||||
#endif
|
||||
|
||||
BPath basePath;
|
||||
status_t status = _GetPath(basePath);
|
||||
if (status < B_OK)
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
if (mask & kWorkspacesSettings) {
|
||||
|
@ -40,7 +40,7 @@ SharedLibrary libhwinterface.so :
|
||||
RGBColor.cpp
|
||||
UpdateQueue.cpp
|
||||
|
||||
: libhaikuappserver.so be
|
||||
: libtestappserver.so
|
||||
;
|
||||
|
||||
|
||||
@ -56,10 +56,10 @@ SharedLibrary libhwinterfaceimpl.so :
|
||||
MultiLocker.cpp
|
||||
|
||||
# trace.c
|
||||
: be libhwinterface.so
|
||||
: libhwinterface.so
|
||||
;
|
||||
|
||||
SharedLibrary libhaikuappserver.so :
|
||||
SharedLibrary libtestappserver.so :
|
||||
Angle.cpp
|
||||
ClientMemoryAllocator.cpp
|
||||
CursorData.cpp
|
||||
@ -94,9 +94,9 @@ SharedLibrary libhaikuappserver.so :
|
||||
: be libpainter.a libtextencoding.so libfreetype.so libshared.a
|
||||
;
|
||||
|
||||
AddResources haiku_app_server : app_server.rdef ;
|
||||
AddResources test_app_server : app_server.rdef ;
|
||||
|
||||
Server haiku_app_server :
|
||||
Server test_app_server :
|
||||
# Misc. Sources
|
||||
Decorator.cpp
|
||||
ProfileMessageSupport.cpp
|
||||
@ -141,19 +141,19 @@ Server haiku_app_server :
|
||||
|
||||
# libraries
|
||||
:
|
||||
z libpng.so libhaikuappserver.so libpainter.a be
|
||||
z libtestappserver.so libpainter.a be
|
||||
libhwinterface.so libhwinterfaceimpl.so
|
||||
libagg.a libfreetype.so libtextencoding.so
|
||||
;
|
||||
|
||||
# install in the test dir
|
||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_LIB_DIR)
|
||||
: libpng.so libhaikuappserver.so libbe_haiku.so libbeadapter.so
|
||||
: libtestappserver.so libbe_test.so
|
||||
libhwinterface.so libhwinterfaceimpl.so libfreetype.so
|
||||
libtextencoding.so
|
||||
: tests!apps ;
|
||||
|
||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : haiku_app_server
|
||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : test_app_server
|
||||
: tests!apps ;
|
||||
|
||||
} # if $(TARGET_PLATFORM) = libbe_test
|
||||
|
@ -1,11 +1,11 @@
|
||||
For the tests to run properly on BeOS, you need to prepare a few things.
|
||||
For the test_app_server to run properly on Haiku, you need to prepare a few things.
|
||||
|
||||
There is a pseudo target "install-test-apps" which needs to be built like this:
|
||||
|
||||
$ TARGET_PLATFORM=libbe_test jam install-test-apps
|
||||
|
||||
This will build "haiku_registrar", "haiku_app_server", the needed libs and some test apps and install everything into "generated/tests/apps".
|
||||
This will build "test_registrar", "test_app_server", the needed libs and some test apps and install everything into "generated/tests/apps".
|
||||
|
||||
Each test app folder contains a script "run", which launches the Haiku app_server and a second later the test app which connects to it.
|
||||
You can use the "run" script in this folder to run the servers, as well as open the test app folder in Tracker (via the -o option), or launch specific test app(s) by specifying their name in the command line, for example "run WindowInvalidation".
|
||||
|
||||
Have fun!
|
||||
|
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/ArchivedView; then
|
||||
../../../../../generated/tests/apps/ArchivedView
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/AsyncDrawing; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/AsyncDrawing
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/Benchmark; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/Benchmark
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/BitmapBounds; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/BitmapBounds
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/BitmapDrawing; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/BitmapDrawing
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps//haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/ClippingRegion; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/ClippingRegion
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/CopyBits; then
|
||||
../../../../../generated/tests/apps/CopyBits
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps//haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/DrawAfterChildren; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/DrawAfterChildren
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/FindView; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/FindView
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/Following; then
|
||||
../../../../../generated/tests/apps/Following
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/LaggingGetMouse; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/LaggingGetMouse
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/Playground; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/Playground
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/ResizeLimits; then
|
||||
../../../../../generated/tests/apps/ResizeLimits
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
28
src/tests/servers/app/run
Executable file
28
src/tests/servers/app/run
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
BASE=../../../../generated/tests/libbe_test/x86/apps
|
||||
|
||||
if [ ! -f $BASE/test_app_server ]; then
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
exit
|
||||
fi
|
||||
|
||||
# launch registrar
|
||||
$BASE/run_test_registrar || exit
|
||||
|
||||
# launch app_server
|
||||
$BASE/test_app_server &
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
# no argument given, don't start any apps
|
||||
exit
|
||||
elif [ "$1" = "-o" ]; then
|
||||
open $BASE
|
||||
shift
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
|
||||
for i in $@; do
|
||||
$BASE/$i &
|
||||
done
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/ScrollBar; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/ScrollBar
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/Scrolling; then
|
||||
../../../../../generated/tests/apps/Scrolling
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/libbe_test/x86/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/libbe_test/x86/apps/StatusBar; then
|
||||
../../../../../generated/tests/libbe_test/x86/apps/StatusBar
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,24 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
#if test -f ../../../../../generated/tests/apps/MiniTerminal; then
|
||||
# ../../../../../generated/tests/apps/MiniTerminal &
|
||||
#else
|
||||
# echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
#fi
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/StressTest; then
|
||||
../../../../../generated/tests/apps/StressTest
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=libbe_test jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
../../../../../generated/tests/apps/run_haiku_registrar || exit
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/haiku_app_server; then
|
||||
../../../../../generated/tests/apps/haiku_app_server &
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
||||
sleep 1s
|
||||
|
||||
if test -f ../../../../../generated/tests/apps/TextView; then
|
||||
../../../../../generated/tests/apps/TextView
|
||||
else
|
||||
echo "You need to \"TARGET_PLATFORM=r5 jam install-test-apps\" first."
|
||||
fi
|
||||
|
@ -24,8 +24,8 @@ SimpleTest message_deliverer_test : message_deliverer_test.cpp : be ;
|
||||
|
||||
SetSubDirSupportedPlatforms libbe_test ;
|
||||
|
||||
SimpleTest run_haiku_registrar
|
||||
: run_haiku_registrar.cpp
|
||||
SimpleTest run_test_registrar
|
||||
: run_test_registrar.cpp
|
||||
: be
|
||||
;
|
||||
|
||||
@ -68,7 +68,7 @@ UsePrivateSystemHeaders ;
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src servers registrar ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src servers registrar mime ] ;
|
||||
|
||||
Server haiku_registrar
|
||||
Server test_registrar
|
||||
:
|
||||
AppInfoList.cpp
|
||||
AppInfoListMessagingTargetSet.cpp
|
||||
@ -120,8 +120,8 @@ Server haiku_registrar
|
||||
;
|
||||
|
||||
if $(TARGET_PLATFORM) = libbe_test {
|
||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : haiku_registrar
|
||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : test_registrar
|
||||
: tests!apps ;
|
||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : run_haiku_registrar
|
||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : run_test_registrar
|
||||
: tests!apps ;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Copyright 2005-2009, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
@ -33,10 +33,11 @@ main()
|
||||
|
||||
thread_info threadInfo;
|
||||
int32 threadCookie = 0;
|
||||
while (get_next_thread_info(teamInfo.team, &threadCookie, &threadInfo) == B_OK) {
|
||||
while (get_next_thread_info(teamInfo.team, &threadCookie, &threadInfo)
|
||||
== B_OK) {
|
||||
// search for the roster thread
|
||||
if (!strcmp(threadInfo.name, "_roster_thread_")) {
|
||||
port_id port = find_port("_haiku_roster_port_");
|
||||
port_id port = find_port("haiku-test:roster");
|
||||
port_info portInfo;
|
||||
if (get_port_info(port, &portInfo) == B_OK
|
||||
&& portInfo.team == teamInfo.team) {
|
||||
@ -52,7 +53,7 @@ main()
|
||||
BPath currentPath(".");
|
||||
|
||||
BQuery query;
|
||||
query.SetPredicate("name==haiku_registrar");
|
||||
query.SetPredicate("name==test_registrar");
|
||||
|
||||
// search on current volume only
|
||||
dev_t device = dev_for_path(".");
|
Loading…
Reference in New Issue
Block a user