7575#include < TGSplitFrame.h>
7676#include < TGTextEditor.h>
7777#include < TRootHelpDialog.h>
78- #include < TGHtmlBrowser.h>
7978#include < HelpText.h>
8079#include < TSystemDirectory.h>
8180#include < TInterpreter.h>
@@ -90,6 +89,7 @@ Int_t gTestNum = 0;
9089Bool_t gOptionRef = kFALSE ;
9190Bool_t gOptionKeep = kFALSE ;
9291Bool_t gOptionFull = kFALSE ;
92+ Bool_t gOptionDebug = kFALSE ;
9393char gLine [80 ];
9494Int_t sizes[100 ];
9595TString gTmpfilename ;
@@ -177,7 +177,7 @@ void ProcessFrame(TGFrame *f, const char *title)
177177 img->WriteImage (outfile);
178178
179179 if (!gOptionRef ) {
180- if (!strstr (title, " Pack Frames" ) && ! strstr (title, " HTML Browser " ) ) {
180+ if (!strstr (title, " Pack Frames" )) {
181181 gSystem ->RedirectOutput (gTmpfilename .Data (), " w" , &gRH );
182182 TString macrofile = TString::Format (" sgui_%02d.C" , gTestNum );
183183 ((TGMainFrame *)f)->SaveSource (macrofile);
@@ -1997,45 +1997,6 @@ void testHelpDialog()
19971997 hd->CloseWindow ();
19981998}
19991999
2000- // //////////////////////////////////////////////////////////////////////////////
2001-
2002- // //////////////////////////////////////////////////////////////////////////////
2003- // / Test the ASImage palette editor.
2004-
2005- void testPaletteEditor ()
2006- {
2007- const char *fname = " galaxy.root" ;
2008- TFile *gal = 0 ;
2009- if (!gSystem ->AccessPathName (fname)) {
2010- gal = TFile::Open (fname);
2011- } else {
2012- gal = TFile::Open (Form (" http://root.cern/files/%s" ,fname));
2013- }
2014- if (!gal) return ;
2015- TImage *img = (TImage*)gal->Get (" n4254" );
2016- // img->Draw();
2017-
2018- TASPaletteEditor *f = new TASPaletteEditor ((TAttImage *)img, 80 , 25 );
2019- ProcessFrame ((TGMainFrame*)f, " Palette Editor" );
2020- f->CloseWindow ();
2021-
2022- delete img;
2023- }
2024-
2025- // //////////////////////////////////////////////////////////////////////////////
2026-
2027- // //////////////////////////////////////////////////////////////////////////////
2028- // / Test the HTML Browser.
2029-
2030- void testHtmlBrowser ()
2031- {
2032- TGHtmlBrowser *b = new TGHtmlBrowser (" https://bellenot.web.cern.ch/public/html_test/html_test.html" );
2033- ProcessFrame ((TGMainFrame*)b, " HTML Browser 1" );
2034- b->Selected (" https://bellenot.web.cern.ch/public/html_test/gallery/" );
2035- ProcessFrame ((TGMainFrame*)b, " HTML Browser 2" );
2036- b->CloseWindow ();
2037- }
2038-
20392000// //////////////////////////////////////////////////////////////////////////////
20402001// ROOT GUI tutorials
20412002// //////////////////////////////////////////////////////////////////////////////
@@ -2057,21 +2018,21 @@ const char *excluded[] = {
20572018Int_t bexec (TString &dir, const char *macro)
20582019{
20592020#ifdef WIN32
2060- return gSystem ->Exec (TString::Format (" set ROOT_HIST=0 & root.exe -q exec_macro.C(\\\" %s/%s\\\" ) >nul 2>&1" , dir.Data (), macro));
2021+ return gSystem ->Exec (TString::Format (" set ROOT_HIST=0 & root.exe -l - q exec_macro.C(\\\" %s/%s\\\" ) >nul 2>&1" , dir.Data (), macro));
20612022#else
2062- return gSystem ->Exec (TString::Format (" ROOT_HIST=0 root.exe -q exec_macro.C\\ (\\\" %s/%s\\\"\\ ) >&/dev/null" , dir.Data (), macro));
2023+ return gSystem ->Exec (TString::Format (" ROOT_HIST=0 root.exe -l - q exec_macro.C\\ (\\\" %s/%s\\\"\\ ) >&/dev/null" , dir.Data (), macro));
20632024#endif
20642025}
20652026
20662027// //////////////////////////////////////////////////////////////////////////////
2067- // / Run the macros available in $ROOTSYS/tutorials/gui
2028+ // / Run the macros available in $ROOTSYS/tutorials/visualisation/ gui
20682029
20692030void run_tutorials ()
20702031{
20712032 gClient ->HandleInput ();
20722033 gSystem ->Sleep (50 );
20732034 gSystem ->ProcessEvents ();
2074- TString dir = gRootSys + " /tutorials/gui" ;
2035+ TString dir = gRootSys + " /tutorials/visualisation/ gui" ;
20752036 TString savdir = gSystem ->WorkingDirectory ();
20762037 TSystemDirectory sysdir (dir.Data (), dir.Data ());
20772038 TList *files = sysdir.GetListOfFiles ();
@@ -2083,12 +2044,12 @@ void run_tutorials()
20832044 bexec (dir, " hsimple.C" );
20842045 gSystem ->Unlink (" hsimple_1.png" );
20852046 }
2086- dir += " /tree" ;
2047+ dir += " io /tree/ " ;
20872048 reqfile = dir + " /cernstaff.root" ;
20882049 if (gSystem ->AccessPathName (reqfile, kFileExists )) {
2089- bexec (dir, " cernbuild .C" );
2050+ bexec (dir, " tree500_cernbuild .C" );
20902051 }
2091- dir = gRootSys + " /tutorials/gui" ;
2052+ dir = gRootSys + " /tutorials/visualisation/ gui" ;
20922053
20932054 if (files) {
20942055 TIter next (files);
@@ -2113,7 +2074,7 @@ void run_tutorials()
21132074 }
21142075 delete files;
21152076 }
2116- dir = gRootSys + " /tutorials/image" ;
2077+ dir = gRootSys + " /tutorials/visualisation/ image" ;
21172078 bexec (dir, " galaxy_image.C" );
21182079 ProcessMacro (" galaxy_image.C" , " galaxy_image.C" );
21192080
@@ -2155,7 +2116,7 @@ void guitest_playback()
21552116 printf (" Guitest Playback.............................................." );
21562117 gSystem ->RedirectOutput (gTmpfilename .Data (), " w" , &gRH );
21572118 TString savdir = gSystem ->WorkingDirectory ();
2158- TString dir = gRootSys + " /tutorials/gui" ;
2119+ TString dir = gRootSys + " /tutorials/visualisation/ gui" ;
21592120 gSystem ->ChangeDirectory (dir.Data ());
21602121
21612122 // first delete old files, if any
@@ -2230,7 +2191,7 @@ void dnd_playback()
22302191#else
22312192 filename += " _x11.root" ;
22322193#endif
2233- TString dir = gRootSys + " /tutorials/gui" ;
2194+ TString dir = gRootSys + " /tutorials/visualisation/ gui" ;
22342195 gSystem ->ChangeDirectory (dir.Data ());
22352196
22362197 TStopwatch sw;
@@ -2265,7 +2226,7 @@ void mditest_playback()
22652226 printf (" MDI Test Playback............................................." );
22662227 gSystem ->RedirectOutput (gTmpfilename .Data (), " w" , &gRH );
22672228 TString savdir = gSystem ->WorkingDirectory ();
2268- TString dir = gRootSys + " /tutorials/gui" ;
2229+ TString dir = gRootSys + " /tutorials/visualisation/ gui" ;
22692230 gSystem ->ChangeDirectory (dir.Data ());
22702231
22712232 TStopwatch sw;
@@ -2300,7 +2261,7 @@ void graph_edit_playback()
23002261 printf (" Graphic Editors Playback......................................" );
23012262 gSystem ->RedirectOutput (gTmpfilename .Data (), " w" , &gRH );
23022263 TString savdir = gSystem ->WorkingDirectory ();
2303- TString dir = gRootSys + " /tutorials/graphics" ;
2264+ TString dir = gRootSys + " /tutorials/visualisation/ graphics" ;
23042265 gSystem ->ChangeDirectory (dir.Data ());
23052266
23062267 TStopwatch sw;
@@ -2335,7 +2296,7 @@ void fitpanel_playback()
23352296 printf (" Fit Panel Playback ..........................................." );
23362297 gSystem ->RedirectOutput (gTmpfilename .Data (), " w" , &gRH );
23372298 TString savdir = gSystem ->WorkingDirectory ();
2338- TString dir = gRootSys + " /tutorials/fit" ;
2299+ TString dir = gRootSys + " /tutorials/math/ fit" ;
23392300 gSystem ->ChangeDirectory (dir.Data ());
23402301
23412302 TStopwatch sw;
@@ -2416,7 +2377,7 @@ void stressGUI()
24162377 gBenchmark ->Start (" stressGUI" );
24172378
24182379 if (!gOptionRef ) {
2419- std::cout << " * Running macros in $ROOTSYS/ tutorials/gui - S T R E S S *" <<std::endl;
2380+ std::cout << " * Running macros in tutorials/visualisation/ gui - S T R E S S *" <<std::endl;
24202381 std::cout << " **********************************************************************" <<std::endl;
24212382 }
24222383 run_tutorials ();
@@ -2452,8 +2413,6 @@ void stressGUI()
24522413 testSplitFrame ();
24532414 testControlBars ();
24542415 testHelpDialog ();
2455- testPaletteEditor ();
2456- testHtmlBrowser ();
24572416
24582417 if (!gOptionRef ) {
24592418
@@ -2526,6 +2485,9 @@ void stressGUI()
25262485 fclose (sgref);
25272486 }
25282487 gSystem ->Unlink (gTmpfilename .Data ());
2488+ if (gOptionDebug ) {
2489+ gClient ->GetPicturePool ()->Print ();
2490+ }
25292491#ifdef WIN32
25302492 gSystem ->Exec (" erase /q /s TxtEdit* >nul 2>&1" );
25312493 gSystem ->Exec (" erase /q /s TxtView* >nul 2>&1" );
@@ -2549,13 +2511,15 @@ int main(int argc, char *argv[])
25492511 gOptionRef = kFALSE ;
25502512 gOptionKeep = kFALSE ;
25512513 gOptionFull = kFALSE ;
2514+ gOptionDebug = kFALSE ;
25522515 gTmpfilename = " stress-gui" ;
25532516 FILE *f = gSystem ->TempFileName (gTmpfilename );
25542517 fclose (f);
25552518 for (int i = 0 ; i < argc; i++) {
25562519 if (!strcmp (argv[i], " -ref" )) gOptionRef = kTRUE ;
25572520 if (!strcmp (argv[i], " -keep" )) gOptionKeep = kTRUE ;
25582521 if (!strcmp (argv[i], " -full" )) gOptionFull = kTRUE ;
2522+ if (!strcmp (argv[i], " -debug" )) gOptionDebug = kTRUE ;
25592523 if (!strcmp (argv[i], " -help" ) || !strcmp (argv[i], " -?" )) {
25602524 printf (" Usage: stressGUI [-ref] [-keep] [-full] [-help] [-?] \n " );
25612525 printf (" Options:\n " );
@@ -2565,6 +2529,9 @@ int main(int argc, char *argv[])
25652529 printf (" -keep: Keep the png files even for passed tests\n " );
25662530 printf (" (by default the png files are deleted)\n " );
25672531 printf (" \n " );
2532+ printf (" -debug: print debug information like for example\n " );
2533+ printf (" picture refcount\n " );
2534+ printf (" \n " );
25682535 printf (" -full: Full test: replay also recorder sessions\n " );
25692536 printf (" (guitest, drag and drop, fitpanel, ...)\n " );
25702537 printf (" \n " );
0 commit comments