Fix the build of test_app_server on 64bit

So many Jamfiles to search through...runs also, but there
are lots of graphical glitches

Change-Id: Ibf9e64566a5b8c5742792ac9b1b0f9ccc6693c8d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1753
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
CodeforEvolution 2019-08-27 22:56:47 -05:00 committed by waddlesplash
parent 1761cb8e6f
commit 9e54316c52
63 changed files with 193 additions and 151 deletions

View File

@ -22,7 +22,7 @@ rule TargetLibstdc++ asPath
# Returns the c++-standard-library for the target.
# Invoking with <asPath> = true will return the full library path.
if $(TARGET_PLATFORM) = haiku {
if $(TARGET_PLATFORM) = haiku || $(TARGET_PLATFORM) = libbe_test {
if $(TARGET_PACKAGING_ARCH) = x86_gcc2 {
# the libstdc++.so for our legacy compiler (needs to be built)
return libstdc++.r4.so ;
@ -35,13 +35,8 @@ rule TargetLibstdc++ asPath
return [
BuildFeatureAttribute gcc_syslibs : libstdc++.so : $(flags)
] ;
} else {
if $(TARGET_PLATFORM) = libbe_test {
# Use the existing host library
return stdc++.r4 ;
}
# TODO: return libstdc++.so for non-Haiku target platform if needed
}
# TODO: return libstdc++.so for non-Haiku target platform if needed
}

View File

@ -11,7 +11,7 @@ Application CharacterMap :
UnicodeBlocks.cpp
UnicodeBlockView.cpp
: be [ TargetLibsupc++ ] localestub
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] localestub
: CharacterMap.rdef
;

View File

@ -6,7 +6,7 @@ UsePrivateHeaders shared ;
Application Magnify :
Magnify.cpp
: be game localestub [ TargetLibsupc++ ] tracker translation
: be game localestub [ TargetLibstdc++ ] [ TargetLibsupc++ ] tracker translation
: Magnify.rdef
;

View File

@ -5,9 +5,9 @@ AddSubDirSupportedPlatforms libbe_test ;
UsePrivateHeaders app interface shared ;
Application Workspaces :
Workspaces.cpp
: be shared localestub [ TargetLibsupc++ ]
: Workspaces.rdef
Workspaces.cpp
: be shared localestub [ TargetLibstdc++ ] [ TargetLibsupc++ ]
: Workspaces.rdef
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -123,7 +123,7 @@ StdBinCommands
settype.cpp
spybmessage.cpp
urlwrapper.cpp
: be [ TargetLibsupc++ ] : $(haiku-utils_rsrc) ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] : $(haiku-utils_rsrc) ;
# standard commands that need libbe.so, libsupc++.so, and libshared.a
StdBinCommands

View File

@ -63,11 +63,11 @@ UsePrivateHeaders storage mime ;
SharedLibrary libbe_test.so :
:
<libbe!$(HAIKU_PACKAGING_ARCH)>app_kit.o
<libbe!$(HAIKU_PACKAGING_ARCH)>interface_kit.o
<libbe!$(HAIKU_PACKAGING_ARCH)>locale_kit.o
<libbe!$(HAIKU_PACKAGING_ARCH)>storage_kit.o
<libbe!$(HAIKU_PACKAGING_ARCH)>support_kit.o
<libbe!$(TARGET_PACKAGING_ARCH)>app_kit.o
<libbe!$(TARGET_PACKAGING_ARCH)>interface_kit.o
<libbe!$(TARGET_PACKAGING_ARCH)>locale_kit.o
<libbe!$(TARGET_PACKAGING_ARCH)>storage_kit.o
<libbe!$(TARGET_PACKAGING_ARCH)>support_kit.o
[ MultiArchDefaultGristFiles libstorage_kit_mime.a ]
@ -77,7 +77,8 @@ SharedLibrary libbe_test.so :
[ TargetLibstdc++ ]
[ BuildFeatureAttribute icu : libraries ]
[ BuildFeatureAttribute zlib : library ]
;
[ BuildFeatureAttribute zstd : library ]
;
SEARCH_SOURCE += [ FDirName $(SUBDIR) interface ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) interface textview_support ] ;

View File

@ -37,7 +37,7 @@ if $(TARGET_PLATFORM) = haiku {
SharedLibrary libgame.so :
DirectWindow.cpp
WindowScreen.cpp
: be
: be [ TargetLibstdc++ ]
;
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_LIB_DIR) : libgame.so

View File

@ -18,7 +18,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
:
be
[ MultiArchDefaultGristFiles libiconv.a ]
[ TargetLibsupc++ ] localestub ;
[ TargetLibstdc++ ] [ TargetLibsupc++ ] localestub ;
}
}

View File

@ -24,7 +24,7 @@ Preference FileTypes :
PreferredAppMenu.cpp
StringView.cpp
: be tracker [ TargetLibsupc++ ] localestub
: be tracker [ TargetLibstdc++ ] [ TargetLibsupc++ ] localestub
: FileTypes.rdef FileTypes.icons.rdef
;

View File

@ -17,7 +17,7 @@ Preference Screen :
ScreenSettings.cpp
ScreenWindow.cpp
Utility.cpp
: be [ TargetLibsupc++ ] localestub libaccelerantscommon.a
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] localestub libaccelerantscommon.a
: Screen.rdef
;

View File

@ -7,7 +7,7 @@ Application Chart :
ChartRender.cpp
ChartView.cpp
ChartWindow.cpp
: be game localestub [ TargetLibsupc++ ]
: be game localestub [ TargetLibstdc++ ] [ TargetLibsupc++ ]
: Chart.rdef
;

View File

@ -4,7 +4,7 @@ AddSubDirSupportedPlatforms libbe_test ;
SimpleTest DirectWindowStars
: Stars.cpp StarWindow.cpp
: game be [ TargetLibsupc++ ]
: game be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if ( $(TARGET_PLATFORM) = libbe_test ) {

View File

@ -5,7 +5,7 @@ SetSubDirSupportedPlatforms haiku libbe_test ;
SimpleTest LayoutTest1 :
LayoutTest1.cpp
:
be [ TargetLibsupc++ ]
be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -33,7 +33,7 @@ SimpleTest WidgetLayoutTest :
TextControlTest.cpp
TextViewTest.cpp
:
be [ TargetLibsupc++ ]
be [ TargetLibsupc++ ] [ TargetLibstdc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -122,7 +122,7 @@ BoxTest::ActivateTest(View* controls)
fBorderStyleRadioGroup->AddButton(button->GetRadioButton());
// default to no border
fBorderStyleRadioGroup->SelectButton(0L);
fBorderStyleRadioGroup->SelectButton((int32)0);
// spacing
group->AddChild(new VStrut(10));
@ -148,7 +148,7 @@ BoxTest::ActivateTest(View* controls)
fLabelRadioGroup->AddButton(button->GetRadioButton());
// default to no border
fLabelRadioGroup->SelectButton(0L);
fLabelRadioGroup->SelectButton((int32)0);
// spacing
group->AddChild(new VStrut(10));

View File

@ -78,7 +78,7 @@ ScrollBarTest::ActivateTest(View* controls)
fOrientationRadioGroup->AddButton(button->GetRadioButton());
// default to horizontal
fOrientationRadioGroup->SelectButton(0L);
fOrientationRadioGroup->SelectButton((int32)0);
// glue
vGroup->AddChild(new Glue());

View File

@ -206,7 +206,7 @@ SliderTest::ActivateTest(View* controls)
fOrientationRadioGroup->AddButton(button->GetRadioButton());
// default to horizontal
fOrientationRadioGroup->SelectButton(0L);
fOrientationRadioGroup->SelectButton((int32)0);
// the radio button group for selecting the thumb style
@ -228,7 +228,7 @@ SliderTest::ActivateTest(View* controls)
fThumbStyleRadioGroup->AddButton(button->GetRadioButton());
// default to block thumb
fThumbStyleRadioGroup->SelectButton(0L);
fThumbStyleRadioGroup->SelectButton((int32)0);
// spacing
group->AddChild(new VStrut(10));
@ -263,7 +263,7 @@ SliderTest::ActivateTest(View* controls)
fHashMarkLocationRadioGroup->AddButton(button->GetRadioButton());
// default to no hash marks
fHashMarkLocationRadioGroup->SelectButton(0L);
fHashMarkLocationRadioGroup->SelectButton((int32)0);
// spacing
group->AddChild(new VStrut(10));
@ -289,7 +289,7 @@ SliderTest::ActivateTest(View* controls)
fBarThicknessRadioGroup->AddButton(button->GetRadioButton());
// default to default thickness
fBarThicknessRadioGroup->SelectButton(1L);
fBarThicknessRadioGroup->SelectButton((int32)1);
// spacing
group->AddChild(new VStrut(10));
@ -316,7 +316,7 @@ SliderTest::ActivateTest(View* controls)
fLabelRadioGroup->AddButton(button->GetRadioButton());
// default to normal label
fLabelRadioGroup->SelectButton(1L);
fLabelRadioGroup->SelectButton((int32)1);
// spacing
group->AddChild(new VStrut(10));
@ -343,7 +343,7 @@ SliderTest::ActivateTest(View* controls)
fLimitLabelsRadioGroup->AddButton(button->GetRadioButton());
// default to no limit labels
fLimitLabelsRadioGroup->SelectButton(0L);
fLimitLabelsRadioGroup->SelectButton((int32)0);
// spacing
group->AddChild(new VStrut(10));

View File

@ -23,9 +23,9 @@ UseLibraryHeaders agg expat ;
SimpleTest PictureTest :
PictureTest.cpp
SVGViewView.cpp
: be translation
: be translation
[ BuildFeatureAttribute expat : library ]
[ TargetLibsupc++ ]
[ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -81,8 +81,10 @@ SharedLibrary libhwinterfaceimpl.so :
DWindowHWInterface.cpp
MultiLocker.cpp
# trace.c
: libhwinterface.so
# libraries
:
libhwinterface.so
[ TargetLibstdc++ ]
;
local decorator_src =
@ -187,6 +189,7 @@ SharedLibrary libtestappserver.so :
: be libpainter.a libagg.a libtextencoding.so shared libstackandtile.a
liblinprog.a libhwinterface.so libhwinterfaceimpl.so
[ BuildFeatureAttribute freetype : library ]
[ TargetLibstdc++ ]
;
Includes [ FGristFiles AppServer.cpp BitmapManager.cpp Canvas.cpp
@ -222,6 +225,9 @@ HaikuInstall install-test-apps : $(HAIKU_APP_TEST_LIB_DIR)
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : test_app_server
: tests!apps ;
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : run.sh
: tests!apps ;
} # if $(TARGET_PLATFORM) = libbe_test
SubInclude HAIKU_TOP src tests servers app archived_view ;

View File

@ -4,12 +4,17 @@ 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 "test_registrar", "test_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/libbe_test/(your architecture)/apps".
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".
You can use the "run.sh" script installed in the "generated/tests/libbe_test/(your architecture)/apps" 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".
NOTE: it is currently necessary to prefix the starting of test_app_server with
LD_PRELOAD="lib/libbe_test.so"
This is a bug that should be fixed (go for it :-), but supplying the library manually is a workaround for using test_app_server for now.
This is a bug that should be fixed (go for it :-),
but supplying the library manually is a workaround for using test_app_server for now.
Have fun!

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest ArchivedView :
main.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
: ArchivedView.rdef
;

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest AsyncDrawing :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
if ( $(TARGET_PLATFORM) = libbe_test ) {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : AsyncDrawing

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
Application AvoidFocus :
AvoidFocus.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -14,7 +14,7 @@ Application Benchmark :
Test.cpp
TestWindow.cpp
VerticalLineTest.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if ( $(TARGET_PLATFORM) = libbe_test ) {

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest BitmapBounds :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
if ( $(TARGET_PLATFORM) = libbe_test ) {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : BitmapBounds

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
Application BitmapDrawing :
main.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if ( $(TARGET_PLATFORM) = libbe_test ) {

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest ClipToPicture :
main.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if ( $(TARGET_PLATFORM) = libbe_test ) {

View File

@ -2,6 +2,6 @@ SubDir HAIKU_TOP src tests servers app code_to_name ;
SimpleTest code_to_name
: code_to_name.cpp
: be
: be [ TargetLibstdc++ ]
;

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest ClippingRegion :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
if ( $(TARGET_PLATFORM) = libbe_test ) {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : ClippingRegion

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest CopyBits :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
#if ( $(TARGET_PLATFORM) = libbe_test ) {
# HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : CopyBits

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
Application CursorTest :
CursorTest.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -8,7 +8,7 @@ UsePrivateHeaders interface ;
Application DesktopWindow :
DesktopWindow.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest DrawStringOffsets :
main.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if ( $(TARGET_PLATFORM) = libbe_test ) {

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
Application EventMask :
EventMask.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
Application FindView :
FindView.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if ( $(TARGET_PLATFORM) = libbe_test ) {

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest Following :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
if ( $(TARGET_PLATFORM) = libbe_test ) {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Following

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest FontSpacing :
main.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
:
;

View File

@ -10,7 +10,7 @@ SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src tests servers app harness ] ;
SimpleTest Gradients :
harness.cpp
main.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
: Gradients.rdef
;

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
Application HideAndShow :
HideAndShow.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -2,5 +2,5 @@ SubDir HAIKU_TOP src tests servers app idle_test ;
SimpleTest idle_test :
test.cpp
: be ;
: be [ TargetLibstdc++ ] ;

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest LaggingGetMouse :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
if ( $(TARGET_PLATFORM) = libbe_test ) {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : LaggingGetMouse

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
Application LockFocusTest :
LockFocusTest.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -8,7 +8,7 @@ UsePrivateHeaders interface ;
Application LookAndFeel :
LookAndFeel.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -7,6 +7,6 @@ UseHeaders [ FDirName os interface ] ;
Application MenuCrash :
MenuCrash.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;

View File

@ -61,7 +61,7 @@ RSRCS=
# naming scheme you need to specify the path to the library
# and it's name
# library: my_lib.a entry: my_lib.a or path/my_lib.a
LIBS= be game
LIBS= $(STDCPPLIBS) be game
# specify additional paths to directories following the standard
# libXXX.so or libXXX.a naming scheme. You can specify full paths

View File

@ -10,7 +10,7 @@ Application Playground :
ObjectView.cpp
ObjectWindow.cpp
States.cpp
: be [ TargetLibsupc++ ] localestub
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] localestub
: Playground.rdef
;

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest PulsedDrawing :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
if ( $(TARGET_PLATFORM) = libbe_test ) {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : PulsedDrawing

View File

@ -15,7 +15,7 @@ SimpleTest TestApp_Clock :
cl_view.cpp
cl_wind.cpp
clock.cpp
: be localestub [ TargetLibsupc++ ]
: be localestub [ TargetLibstdc++ ] [ TargetLibsupc++ ]
: Clock.rdef
;

View File

@ -4,5 +4,5 @@ AddSubDirSupportedPlatforms libbe_test ;
Application ResizeLimits :
ResizeLimits.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;

View File

@ -1,28 +0,0 @@
#!/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

28
src/tests/servers/app/run.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
if [ ! -f test_app_server ]; then
echo "You need to \"TARGET_PLATFORM=libbe_test jam -q install-test-apps\" first."
echo "Afterwards, make sure you head to the folder with the test_app_server and run the script installed there."
echo "If you need additional help, check in the \"NOTES\" file."
exit
fi
# launch registrar
run_test_registrar || exit
# launch app_server
test_app_server &
if [ "$#" -eq 0 ]; then
# no argument given, don't start any apps
exit
elif [ "$1" = "-o" ]; then
open .
shift
fi
sleep 1
for i in $@; do
$i &
done

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest ScrollBar :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
if ( $(TARGET_PLATFORM) = libbe_test ) {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : ScrollBar

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest Scrolling :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
#if ( $(TARGET_PLATFORM) = libbe_test ) {
# HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Scrolling

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest ShapeTest :
main.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if ( $(TARGET_PLATFORM) = libbe_test ) {

View File

@ -8,7 +8,7 @@ UsePrivateHeaders interface ;
Application StackTileTest :
main.cpp
: [ TargetLibstdc++ ] be
: [ TargetLibstdc++ ] [ TargetLibstdc++ ] be
;
if ( $(TARGET_PLATFORM) = libbe_test ) {

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest StatusBar :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
if ( $(TARGET_PLATFORM) = libbe_test ) {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : StatusBar

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest TextRendering :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
if ( $(TARGET_PLATFORM) = libbe_test ) {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : TextRendering

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
SimpleTest TextView :
main.cpp
: be [ TargetLibsupc++ ] ;
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ] ;
#if ( $(TARGET_PLATFORM) = libbe_test ) {
# HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : TextView

View File

@ -10,7 +10,7 @@ SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src tests servers app harness ] ;
SimpleTest Transformation :
harness.cpp
main.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
: Transformation.rdef
;

View File

@ -7,7 +7,7 @@ UseHeaders [ FDirName os interface ] ;
Application ViewState :
ViewState.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;
if $(TARGET_PLATFORM) = libbe_test {

View File

@ -7,6 +7,6 @@ UseHeaders [ FDirName os interface ] ;
Application ViewTransit :
ViewTransit.cpp
: be [ TargetLibsupc++ ]
: be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
;

View File

@ -6,8 +6,9 @@
class TestApp : public BApplication {
public:
TestApp(const char *signature)
: BApplication(signature)
TestApp(const char* signature)
:
BApplication(signature)
{
}
@ -15,18 +16,18 @@ public:
{
}
virtual void ArgvReceived(int32 argc, char **argv)
virtual void ArgvReceived(int32 argc, char** argv)
{
printf("TestApp::ArgvReceived(%ld)\n", argc);
printf("TestApp::ArgvReceived(%" B_PRId32 ")\n", argc);
BMessage *message = CurrentMessage();
message->PrintToStream();
BMessenger returnAddress(message->ReturnAddress());
printf("team: %ld\n", returnAddress.Team());
printf("team: %" B_PRId32 "\n", returnAddress.Team());
for (int32 i = 0; i < argc; i++)
printf("arg %ld: `%s'\n", i, argv[i]);
printf("arg %" B_PRId32 ": `%s'\n", i, argv[i]);
}
virtual void RefsReceived(BMessage *message)
virtual void RefsReceived(BMessage* message)
{
printf("TestApp::RefsReceived()\n");
message->PrintToStream();
@ -44,9 +45,10 @@ public:
int
main()
{
TestApp *app = new TestApp("application/x-vnd.OBOS-TestApp1");
TestApp* app = new TestApp("application/x-vnd.Haiku-TestApp1");
app->Run();
delete app;
return 0;
}

View File

@ -1,9 +1,10 @@
// RosterShell.cpp
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <strstream>
#include <vector>
#include <iostream>
@ -11,6 +12,9 @@
#include <Path.h>
#include <Roster.h>
using std::string;
using std::vector;
const char kShellUsage[] =
"Commands Parameters Description\n"
"---------------------------------------------------------------------------\n"
@ -29,13 +33,15 @@ const char kShellUsage[] =
class Shell {
public:
Shell()
: fTerminating(false)
:
fTerminating(false)
{
}
bool IsTerminating() const { return fTerminating; }
void DoCommand(vector<string> &cmdLine)
void
DoCommand(vector<string>& cmdLine)
{
if (cmdLine.size() > 0) {
string command = cmdLine[0];
@ -44,7 +50,7 @@ public:
else if (command == "exit" || command == "e")
CmdExit(cmdLine);
else if (command == "help" || command == "h")
Usage();
Usage(string(" "));
else if (command == "launch")
CmdLaunch(cmdLine);
else if (command == "list" || command == "l")
@ -58,43 +64,50 @@ public:
}
}
void Usage(string error = "")
void
Usage(string error)
{
if (error.length() > 0)
cout << error << endl;
cout << kShellUsage;
std::cout << error << std::endl;
std::cout << kShellUsage;
}
void CmdActivate(vector<string> &args)
void
CmdActivate(vector<string>& args)
{
BRoster roster;
// get a list of team IDs
BList teamList;
if (args.size() <= 1) {
printf("activate: requires exactly one argument\n");
return;
}
ParseTeamList(args, &teamList);
int32 count = teamList.CountItems();
if (count != 1) {
printf("activate: requires exactly one argument\n");
return;
}
// activate the team
team_id team = (team_id)(uintptr_t)teamList.ItemAt(0);
status_t error = roster.ActivateApp(team);
if (error != B_OK) {
printf("activate: failed to activate application %ld: %s\n",
team, strerror(error));
printf("activate: failed to activate application %" B_PRId32
": %s\n", team, strerror(error));
}
}
void CmdExit(vector<string> &)
void
CmdExit(vector<string>&)
{
fTerminating = true;
}
void CmdLaunch(vector<string> &args)
void
CmdLaunch(vector<string>& args)
{
// check args
if (args.size() != 2) {
@ -118,32 +131,37 @@ public:
team_id teamID;
error = roster.Launch(&ref, (const BMessage*)NULL, &teamID);
if (error == B_OK) {
printf("launched \"%s\", team id: %ld\n", program.c_str(), teamID);
printf("launched \"%s\", team id: %" B_PRId32 "\n", program.c_str(),
teamID);
} else {
printf("launch: Failed to launch \"%s\": %s\n",
program.c_str(), strerror(error));
}
}
static void ParseTeamList(vector<string> &args, BList *teamList)
static void
ParseTeamList(vector<string>& args, BList* teamList)
{
for (int32 i = 1; i < (int32)args.size(); i++) {
string arg = args[i];
team_id team = -1;
if (sscanf(arg.c_str(), "%ld", &team) > 0)
teamList->AddItem((void*)team);
if (sscanf(arg.c_str(), "%" B_PRId32, &team) > 0)
teamList->AddItem((void*)(addr_t)team);
}
}
void CmdList(vector<string> &args)
void
CmdList(vector<string>& args)
{
BRoster roster;
// get a list of team IDs
BList teamList;
if (args.size() > 1)
ParseTeamList(args, &teamList);
else
roster.GetAppList(&teamList);
// print an info for each team
int32 count = teamList.CountItems();
printf("%-8s%-40s\n", "team", "signature");
@ -153,37 +171,40 @@ public:
app_info info;
status_t error = roster.GetRunningAppInfo(team, &info);
if (error == B_OK)
printf("%-8ld%-40s\n", team, info.signature);
printf("%-8" B_PRId32 "%-40s\n", team, info.signature);
else {
printf("%-8ldfailed to get the app_info: %s\n", team,
printf("%-8" B_PRId32 "failed to get the app_info: %s\n", team,
strerror(error));
}
}
printf("\n");
}
void CmdListLong(vector<string> &args)
void
CmdListLong(vector<string>& args)
{
BRoster roster;
// get a list of team IDs
BList teamList;
if (args.size() > 1)
ParseTeamList(args, &teamList);
else
roster.GetAppList(&teamList);
// print an info for each team
int32 count = teamList.CountItems();
for (int32 i = 0; i < count; i++) {
team_id team = (team_id)(uintptr_t)teamList.ItemAt(i);
printf("team %8ld\n", team);
printf("team %8" B_PRId32 "\n", team);
printf("-------------\n");
app_info info;
status_t error = roster.GetRunningAppInfo(team, &info);
if (error == B_OK) {
printf("signature: %s\n", info.signature);
printf("thread: %ld\n", info.thread);
printf("port: %ld\n", info.port);
printf("flags: 0x%lx\n", info.flags);
printf("thread: %" B_PRId32 "\n", info.thread);
printf("port: %" B_PRId32 "\n", info.port);
printf("flags: 0x%" B_PRIx32 "\n", info.flags);
printf("file: %s\n", BPath(&info.ref).Path());
} else
printf("failed to get the app_info: %s\n", strerror(error));
@ -191,7 +212,8 @@ public:
}
}
void CmdQuit(vector<string> &args)
void
CmdQuit(vector<string>& args)
{
BRoster roster;
// get a list of team IDs
@ -200,12 +222,14 @@ public:
printf("quit: requires at least one argument\n");
return;
}
ParseTeamList(args, &teamList);
int32 count = teamList.CountItems();
if (count < 1) {
printf("quit: requires at least one argument\n");
return;
}
// send a B_QUIT_REQUESTED message to each team
for (int32 i = 0; i < count; i++) {
team_id team = (team_id)(uintptr_t)teamList.ItemAt(i);
@ -215,12 +239,12 @@ public:
error = messenger.SendMessage(B_QUIT_REQUESTED);
if (error != B_OK) {
printf("quit: failed to deliver the B_QUIT_REQUESTED "
"message to team %ld\n", team);
"message to team %" B_PRId32 "\n", team);
printf(" %s\n", strerror(error));
}
} else {
printf("quit: failed to create a messenger for team %ld\n",
team);
printf("quit: failed to create a messenger for team %" B_PRId32
"\n", team);
printf(" %s\n", strerror(error));
}
}
@ -233,11 +257,18 @@ private:
// read_line
bool
read_line(char *line, size_t size)
read_line(char* line, size_t size)
{
cout << "roster> ";
cout.flush();
return cin.getline(line, size);
std::cout << "roster> ";
std::cout.flush();
try {
std::cin.getline(line, size);
} catch (const std::exception &ex) {
return false;
}
return true;
}
// main
@ -245,11 +276,12 @@ int
main()
{
Shell shell;
// main input loop
char line[10240];
while (!shell.IsTerminating() && read_line(line, sizeof(line))) {
// parse args
istrstream in(line);
std::istringstream in(line);
vector<string> args;
string arg;
while (in >> arg)
@ -257,6 +289,7 @@ main()
// invoke command
shell.DoCommand(args);
}
return 0;
}