Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,22 @@ ROOT_ADD_TEST(test-vlazy COMMAND vlazy)
#--helloso------------------------------------------------------------------------------------
ROOT_GENERATE_DICTIONARY(G__Hello ${CMAKE_CURRENT_SOURCE_DIR}/Hello.h MODULE Hello DEPENDENCIES Gpad Graf Hist MathCore Matrix)
ROOT_LINKER_LIBRARY(Hello Hello.cxx G__Hello.cxx LIBRARIES Graf Gpad)
ROOT_SET_OUTPUT_DIRECTORIES(Hello)
set_target_properties(Hello PROPERTIES PREFIX "")

#--Aclockso------------------------------------------------------------------------------------
ROOT_GENERATE_DICTIONARY(G__Aclock ${CMAKE_CURRENT_SOURCE_DIR}/Aclock.h MODULE Aclock DEPENDENCIES Graf Gpad MathCore)
ROOT_LINKER_LIBRARY(Aclock Aclock.cxx G__Aclock.cxx LIBRARIES Graf Gpad)
ROOT_SET_OUTPUT_DIRECTORIES(Aclock)
set_target_properties(Aclock PROPERTIES PREFIX "")

#--tetris------------------------------------------------------------------------------------
if(TARGET Gui)
ROOT_GENERATE_DICTIONARY(G__Tetris ${CMAKE_CURRENT_SOURCE_DIR}/Tetris.h MODULE Tetris DEPENDENCIES Graf Gpad Gui MathCore)
ROOT_LINKER_LIBRARY(Tetris Tetris.cxx G__Tetris.cxx LIBRARIES Core Graf Gui MathCore)
ROOT_SET_OUTPUT_DIRECTORIES(Tetris)
set_target_properties(Tetris PROPERTIES PREFIX "")
endif()

#--bench------------------------------------------------------------------------------------
ROOT_GENERATE_DICTIONARY(G__TBench ${CMAKE_CURRENT_SOURCE_DIR}/TBench.h MODULE TBench LINKDEF benchLinkDef.h DEPENDENCIES MathCore Tree)
Expand Down
15 changes: 15 additions & 0 deletions test/Tetris.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@
#ifndef TETRIS_H
#define TETRIS_H

#ifdef __ROOTCLING__
#pragma link C++ class Tetris+;
#pragma link C++ class TetrisBox+;
#pragma link C++ class TetrisPiece+;
#pragma link C++ class CurrentPiece+;
#pragma link C++ class TetrisBoard+;
#pragma link C++ class NextPiecePad+;
#pragma link C++ class InfoPad+;
#pragma link C++ class NewGameButton+;
#pragma link C++ class QuitButton+;
#pragma link C++ class PauseButton+;
#pragma link C++ class KeyHandler+;
#pragma link C++ class UpdateLevelTimer+;
#endif

#include <TTimer.h>
#include <TCanvas.h>
#include <TGFrame.h>
Expand Down
81 changes: 24 additions & 57 deletions test/stressGUI.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
#include <TGSplitFrame.h>
#include <TGTextEditor.h>
#include <TRootHelpDialog.h>
#include <TGHtmlBrowser.h>
#include <HelpText.h>
#include <TSystemDirectory.h>
#include <TInterpreter.h>
Expand All @@ -90,6 +89,7 @@ Int_t gTestNum = 0;
Bool_t gOptionRef = kFALSE;
Bool_t gOptionKeep = kFALSE;
Bool_t gOptionFull = kFALSE;
Bool_t gOptionDebug = kFALSE;
char gLine[80];
Int_t sizes[100];
TString gTmpfilename;
Expand Down Expand Up @@ -177,7 +177,7 @@ void ProcessFrame(TGFrame *f, const char *title)
img->WriteImage(outfile);

if (!gOptionRef) {
if (!strstr(title, "Pack Frames") && !strstr(title, "HTML Browser")) {
if (!strstr(title, "Pack Frames")) {
gSystem->RedirectOutput(gTmpfilename.Data(), "w", &gRH);
TString macrofile = TString::Format("sgui_%02d.C", gTestNum);
((TGMainFrame *)f)->SaveSource(macrofile);
Expand Down Expand Up @@ -1997,45 +1997,6 @@ void testHelpDialog()
hd->CloseWindow();
}

////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
/// Test the ASImage palette editor.

void testPaletteEditor()
{
const char *fname = "galaxy.root";
TFile *gal = 0;
if (!gSystem->AccessPathName(fname)) {
gal = TFile::Open(fname);
} else {
gal = TFile::Open(Form("http://root.cern/files/%s",fname));
}
if (!gal) return;
TImage *img = (TImage*)gal->Get("n4254");
//img->Draw();

TASPaletteEditor *f = new TASPaletteEditor((TAttImage *)img, 80, 25);
ProcessFrame((TGMainFrame*)f, "Palette Editor");
f->CloseWindow();

delete img;
}

////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
/// Test the HTML Browser.

void testHtmlBrowser()
{
TGHtmlBrowser *b = new TGHtmlBrowser("https://bellenot.web.cern.ch/public/html_test/html_test.html");
ProcessFrame((TGMainFrame*)b, "HTML Browser 1");
b->Selected("https://bellenot.web.cern.ch/public/html_test/gallery/");
ProcessFrame((TGMainFrame*)b, "HTML Browser 2");
b->CloseWindow();
}

////////////////////////////////////////////////////////////////////////////////
// ROOT GUI tutorials
////////////////////////////////////////////////////////////////////////////////
Expand All @@ -2057,21 +2018,21 @@ const char *excluded[] = {
Int_t bexec(TString &dir, const char *macro)
{
#ifdef WIN32
return gSystem->Exec(TString::Format("set ROOT_HIST=0 & root.exe -q exec_macro.C(\\\"%s/%s\\\") >nul 2>&1", dir.Data(), macro));
return gSystem->Exec(TString::Format("set ROOT_HIST=0 & root.exe -l -q exec_macro.C(\\\"%s/%s\\\") >nul 2>&1", dir.Data(), macro));
#else
return gSystem->Exec(TString::Format("ROOT_HIST=0 root.exe -q exec_macro.C\\(\\\"%s/%s\\\"\\) >&/dev/null", dir.Data(), macro));
return gSystem->Exec(TString::Format("ROOT_HIST=0 root.exe -l -q exec_macro.C\\(\\\"%s/%s\\\"\\) >&/dev/null", dir.Data(), macro));
#endif
}

////////////////////////////////////////////////////////////////////////////////
/// Run the macros available in $ROOTSYS/tutorials/gui
/// Run the macros available in $ROOTSYS/tutorials/visualisation/gui

void run_tutorials()
{
gClient->HandleInput();
gSystem->Sleep(50);
gSystem->ProcessEvents();
TString dir = gRootSys + "/tutorials/gui";
TString dir = gRootSys + "/tutorials/visualisation/gui";
TString savdir = gSystem->WorkingDirectory();
TSystemDirectory sysdir(dir.Data(), dir.Data());
TList *files = sysdir.GetListOfFiles();
Expand All @@ -2083,12 +2044,12 @@ void run_tutorials()
bexec(dir, "hsimple.C");
gSystem->Unlink("hsimple_1.png");
}
dir += "/tree";
dir += "io/tree/";
reqfile = dir + "/cernstaff.root";
if (gSystem->AccessPathName(reqfile, kFileExists)) {
bexec(dir, "cernbuild.C");
bexec(dir, "tree500_cernbuild.C");
}
dir = gRootSys + "/tutorials/gui";
dir = gRootSys + "/tutorials/visualisation/gui";
Comment thread
bellenot marked this conversation as resolved.

if (files) {
TIter next(files);
Expand All @@ -2113,7 +2074,7 @@ void run_tutorials()
}
delete files;
}
dir = gRootSys + "/tutorials/image";
dir = gRootSys + "/tutorials/visualisation/image";
bexec(dir, "galaxy_image.C");
ProcessMacro("galaxy_image.C", "galaxy_image.C");

Expand Down Expand Up @@ -2155,7 +2116,7 @@ void guitest_playback()
printf("Guitest Playback..............................................");
gSystem->RedirectOutput(gTmpfilename.Data(), "w", &gRH);
TString savdir = gSystem->WorkingDirectory();
TString dir = gRootSys + "/tutorials/gui";
TString dir = gRootSys + "/tutorials/visualisation/gui";
gSystem->ChangeDirectory(dir.Data());

// first delete old files, if any
Expand Down Expand Up @@ -2230,7 +2191,7 @@ void dnd_playback()
#else
filename += "_x11.root";
#endif
TString dir = gRootSys + "/tutorials/gui";
TString dir = gRootSys + "/tutorials/visualisation/gui";
gSystem->ChangeDirectory(dir.Data());

TStopwatch sw;
Expand Down Expand Up @@ -2265,7 +2226,7 @@ void mditest_playback()
printf("MDI Test Playback.............................................");
gSystem->RedirectOutput(gTmpfilename.Data(), "w", &gRH);
TString savdir = gSystem->WorkingDirectory();
TString dir = gRootSys + "/tutorials/gui";
TString dir = gRootSys + "/tutorials/visualisation/gui";
gSystem->ChangeDirectory(dir.Data());

TStopwatch sw;
Expand Down Expand Up @@ -2300,7 +2261,7 @@ void graph_edit_playback()
printf("Graphic Editors Playback......................................");
gSystem->RedirectOutput(gTmpfilename.Data(), "w", &gRH);
TString savdir = gSystem->WorkingDirectory();
TString dir = gRootSys + "/tutorials/graphics";
TString dir = gRootSys + "/tutorials/visualisation/graphics";
gSystem->ChangeDirectory(dir.Data());

TStopwatch sw;
Expand Down Expand Up @@ -2335,7 +2296,7 @@ void fitpanel_playback()
printf("Fit Panel Playback ...........................................");
gSystem->RedirectOutput(gTmpfilename.Data(), "w", &gRH);
TString savdir = gSystem->WorkingDirectory();
TString dir = gRootSys + "/tutorials/fit";
TString dir = gRootSys + "/tutorials/math/fit";
gSystem->ChangeDirectory(dir.Data());

TStopwatch sw;
Expand Down Expand Up @@ -2416,7 +2377,7 @@ void stressGUI()
gBenchmark->Start("stressGUI");

if (!gOptionRef) {
std::cout << "* Running macros in $ROOTSYS/tutorials/gui - S T R E S S *" <<std::endl;
std::cout << "* Running macros in tutorials/visualisation/gui - S T R E S S *" <<std::endl;
std::cout << "**********************************************************************" <<std::endl;
}
run_tutorials();
Expand Down Expand Up @@ -2452,8 +2413,6 @@ void stressGUI()
testSplitFrame();
testControlBars();
testHelpDialog();
testPaletteEditor();
testHtmlBrowser();

if (!gOptionRef) {

Expand Down Expand Up @@ -2526,6 +2485,9 @@ void stressGUI()
fclose(sgref);
}
gSystem->Unlink(gTmpfilename.Data());
if (gOptionDebug) {
gClient->GetPicturePool()->Print();
}
#ifdef WIN32
gSystem->Exec("erase /q /s TxtEdit* >nul 2>&1");
gSystem->Exec("erase /q /s TxtView* >nul 2>&1");
Expand All @@ -2549,13 +2511,15 @@ int main(int argc, char *argv[])
gOptionRef = kFALSE;
gOptionKeep = kFALSE;
gOptionFull = kFALSE;
gOptionDebug = kFALSE;
gTmpfilename = "stress-gui";
FILE *f = gSystem->TempFileName(gTmpfilename);
fclose(f);
for (int i = 0; i < argc; i++) {
if (!strcmp(argv[i], "-ref")) gOptionRef = kTRUE;
if (!strcmp(argv[i], "-keep")) gOptionKeep = kTRUE;
if (!strcmp(argv[i], "-full")) gOptionFull = kTRUE;
if (!strcmp(argv[i], "-debug")) gOptionDebug = kTRUE;
if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "-?")) {
printf("Usage: stressGUI [-ref] [-keep] [-full] [-help] [-?] \n");
printf("Options:\n");
Expand All @@ -2565,6 +2529,9 @@ int main(int argc, char *argv[])
printf(" -keep: Keep the png files even for passed tests\n");
printf(" (by default the png files are deleted)\n");
printf("\n");
printf(" -debug: print debug information like for example\n");
printf(" picture refcount\n");
printf("\n");
printf(" -full: Full test: replay also recorder sessions\n");
printf(" (guitest, drag and drop, fitpanel, ...)\n");
printf("\n");
Expand Down
28 changes: 6 additions & 22 deletions tutorials/visualisation/gui/games.C
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,24 @@ void games()
Bool_t UNIX = strcmp(gSystem->GetName(), "Unix") == 0;
Int_t st1 = gSystem->Load("$(ROOTSYS)/test/Aclock");
if (st1 == -1) {
printf("===>The macro games will try to build the Aclock library\n");
if (UNIX)
gSystem->Exec("(cd $ROOTSYS/test; make Aclock)");
else
gSystem->Exec("(cd %ROOTSYS%\\test && nmake -f Makefile.win32 Aclock.dll)");

st1 = gSystem->Load("$(ROOTSYS)/test/Aclock");
printf("===>The $(ROOTSYS)/test/Aclock library failed to load\n");
}
Int_t st2 = gSystem->Load("$(ROOTSYS)/test/Hello");
if (st2 == -1) {
printf("===>The macro games will try to build the Hello library\n");
if (UNIX)
gSystem->Exec("(cd $ROOTSYS/test; make Hello)");
else
gSystem->Exec("(cd %ROOTSYS%\\test && nmake -f Makefile.win32 Hello.dll)");

st2 = gSystem->Load("$(ROOTSYS)/test/Hello");
printf("===>The $(ROOTSYS)/test/Hello library failed to load\n");
}
Int_t st3 = gSystem->Load("$(ROOTSYS)/test/Tetris");
if (st3 == -1) {
if (UNIX) {
printf("===>The macro games will try to build the Tetris library\n");
gSystem->Exec("(cd $ROOTSYS/test; make Tetris)");
} else {
gSystem->Exec("(cd %ROOTSYS%\\test && nmake -f Makefile.win32 Tetris.dll)");
}
st3 = gSystem->Load("$(ROOTSYS)/test/Tetris");
printf("===>The $(ROOTSYS)/test/Tetris library failed to load\n");
}
if (st1 || st2 || st3) {
printf("ERROR: one of the shared libs in $ROOTSYS/test didn't load properly\n");
printf("ERROR: at least one of the shared libs in $ROOTSYS/test didn't load properly\n");
return;
}
gROOT->ProcessLine("#define __RUN_GAMES__ 1");

gInterpreter->AddIncludePath("${ROOTSYS}/test");

// Add this for CLING not to complain
gROOT->ProcessLine("#include \"Hello.h\"");
gROOT->ProcessLine("#include \"Aclock.h\"");
Expand Down
Loading