Skip to content

Commit 3115757

Browse files
Fix ult execution: change dir after getting run path
Change-Id: If2b9d07809004bfb4edbc4b4c50762226a98d2e9
1 parent 5fbdad8 commit 3115757

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

unit_tests/main.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -271,18 +271,6 @@ int main(int argc, char **argv) {
271271
return -1;
272272
}
273273

274-
#ifdef WIN32
275-
#include <direct.h>
276-
if (_chdir(hardwarePrefix[productFamily])) {
277-
std::cout << "chdir into " << hardwarePrefix[productFamily] << " directory failed.\nThis might cause test failures." << std::endl;
278-
}
279-
#elif defined(__linux__)
280-
#include <unistd.h>
281-
if (chdir(hardwarePrefix[productFamily]) != 0) {
282-
std::cout << "chdir into " << hardwarePrefix[productFamily] << " directory failed.\nThis might cause test failures." << std::endl;
283-
}
284-
#endif
285-
286274
uint32_t threadsPerEu = 7;
287275
PLATFORM platform;
288276
auto hardwareInfo = hardwareInfoTable[productFamily];
@@ -333,6 +321,18 @@ int main(int argc, char **argv) {
333321
nClFiles.append(clFiles);
334322
clFiles = nClFiles;
335323

324+
#ifdef WIN32
325+
#include <direct.h>
326+
if (_chdir(hardwarePrefix[productFamily])) {
327+
std::cout << "chdir into " << hardwarePrefix[productFamily] << " directory failed.\nThis might cause test failures." << std::endl;
328+
}
329+
#elif defined(__linux__)
330+
#include <unistd.h>
331+
if (chdir(hardwarePrefix[productFamily]) != 0) {
332+
std::cout << "chdir into " << hardwarePrefix[productFamily] << " directory failed.\nThis might cause test failures." << std::endl;
333+
}
334+
#endif
335+
336336
auto pDevices = new const HardwareInfo *[numDevices];
337337
for (decltype(numDevices) i = 0; i < numDevices; ++i) {
338338
pDevices[i] = &device;

0 commit comments

Comments
 (0)