Skip to content

Commit eec848a

Browse files
committed
Enable stressGUI tests with xvfb
If xvfb-run detected on the system, use it to run stressGUI test. First create ref file and then check that it match. Prinout log information when generating ref file in stressGUI - otherwise missing info if something went wrong
1 parent fdb25c3 commit eec848a

2 files changed

Lines changed: 32 additions & 15 deletions

File tree

test/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,21 @@ ROOT_ADD_TEST(test-stresshistogram-interpreted COMMAND ${root_exe} -b -q ${CMAKE
196196
#--stressGUI---------------------------------------------------------------------------------------
197197
if(asimage)
198198
ROOT_EXECUTABLE(stressGUI stressGUI.cxx LIBRARIES Gui Recorder GuiHtml ASImageGui)
199+
200+
find_program(XVFB_RUN_EXECUTABLE NAMES xvfb-run)
201+
202+
if(XVFB_RUN_EXECUTABLE)
203+
ROOT_ADD_TEST(test-stressgui-ref
204+
COMMAND ${XVFB_RUN_EXECUTABLE} -a -s "-ac -screen 0 1024x768x24" ./stressGUI -ref
205+
FIXTURES_SETUP fixtures-test-stressgui
206+
FAILREGEX "FAILED|Error in"
207+
LABELS longtest)
208+
ROOT_ADD_TEST(test-stressgui-xvfb
209+
COMMAND ${XVFB_RUN_EXECUTABLE} -a -s "-ac -screen 0 1024x768x24" ./stressGUI
210+
FIXTURES_REQUIRED fixtures-test-stressgui
211+
FAILREGEX "FAILED|Error in"
212+
LABELS longtest)
213+
endif()
199214
endif()
200215

201216
#--stressSpectrum----------------------------------------------------------------------------------

test/stressGUI.cxx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -132,25 +132,27 @@ Bool_t VerifySize(const char *filename, const char *title)
132132
success = kFALSE;
133133
else
134134
success = kTRUE;
135-
136-
snprintf(gLine,80,"Test %2d: %s", gTestNum, title);
137-
const Int_t nch = strlen(gLine);
138-
if (success) {
139-
std::cout << gLine;
140-
for (Int_t i = nch; i < 67; i++) std::cout << ".";
141-
std::cout << " OK" << std::endl;
142-
} else {
143-
std::cout << gLine;
144-
for (Int_t i = nch; i < 63; i++) std::cout << ".";
145-
std::cout << " FAILED" << std::endl;
146-
std::cout << " File Size = " << fsize << std::endl;
147-
std::cout << " Ref Size = " << sizes[gTestNum] << std::endl;
148-
}
149135
} else {
150136
fprintf(sgref, "%5d%10d\n", gTestNum, fsize);
151137
success = kTRUE;
152138
}
153-
if (!gOptionKeep && success) gSystem->Unlink(filename);
139+
140+
snprintf(gLine,80,"Test %2d: %s", gTestNum, title);
141+
const Int_t nch = strlen(gLine);
142+
if (success) {
143+
std::cout << gLine;
144+
for (Int_t i = nch; i < 67; i++) std::cout << ".";
145+
std::cout << (gOptionRef ? " REF" : " OK") << std::endl;
146+
} else {
147+
std::cout << gLine;
148+
for (Int_t i = nch; i < 63; i++) std::cout << ".";
149+
std::cout << " FAILED" << std::endl;
150+
std::cout << " File Size = " << fsize << std::endl;
151+
std::cout << " Ref Size = " << sizes[gTestNum] << std::endl;
152+
}
153+
154+
if (!gOptionKeep && success)
155+
gSystem->Unlink(filename);
154156
return success;
155157
}
156158

0 commit comments

Comments
 (0)