Skip to content

Commit

Permalink
create qmake file to be exe
Browse files Browse the repository at this point in the history
  • Loading branch information
jurplel committed Nov 7, 2024
1 parent 154e14b commit a8bc0c6
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions action/tests/locateQtArchDir.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ import 'jest';
describe('locateQtArchDir integration tests', () => {
let tempDir: string;

const createDummyQMakeFile = (dir: string): void => {
if (process.platform === "win32") {
fs.writeFileSync(path.join(dir, 'qmake.exe'), '');
} else {
fs.writeFileSync(path.join(dir, 'qmake'), '');
}
}

beforeAll(() => {
tempDir = fs.mkdtempSync(path.join(__dirname, 'tempQtInstall_'));
});
Expand All @@ -25,12 +33,14 @@ describe('locateQtArchDir integration tests', () => {
const dirsToCreate = [
'6.4.2/gcc_64/bin',
'6.4.3/clang_64/bin',
'6.4.3/msvc2022_64/bin',
];

dirsToCreate.forEach((dir) => {
const fullPath = path.join(tempDir, dir);
fs.mkdirSync(fullPath, { recursive: true });
fs.writeFileSync(path.join(fullPath, 'qmake'), ''); // create a dummy qmake file
// create dummy qmake file
createDummyQMakeFile(fullPath);
});

const result = locateQtArchDir(tempDir);
Expand All @@ -46,7 +56,7 @@ describe('locateQtArchDir integration tests', () => {
dirsToCreate.forEach((dir) => {
const fullPath = path.join(tempDir, dir);
fs.mkdirSync(fullPath, { recursive: true });
fs.writeFileSync(path.join(fullPath, 'qmake'), '');
createDummyQMakeFile(fullPath);
});

const result = locateQtArchDir(tempDir);
Expand All @@ -62,7 +72,7 @@ describe('locateQtArchDir integration tests', () => {
dirsToCreate.forEach((dir) => {
const fullPath = path.join(tempDir, dir);
fs.mkdirSync(fullPath, { recursive: true });
fs.writeFileSync(path.join(fullPath, 'qmake'), '');
createDummyQMakeFile(fullPath);
});

const result = locateQtArchDir(tempDir);
Expand All @@ -78,7 +88,7 @@ describe('locateQtArchDir integration tests', () => {
dirsToCreate.forEach((dir) => {
const fullPath = path.join(tempDir, dir);
fs.mkdirSync(fullPath, { recursive: true });
fs.writeFileSync(path.join(fullPath, 'qmake'), '');
createDummyQMakeFile(fullPath);
});

const result = locateQtArchDir(tempDir);
Expand All @@ -101,7 +111,7 @@ describe('locateQtArchDir integration tests', () => {
dirsToCreate.forEach((dir) => {
const fullPath = path.join(tempDir, dir);
fs.mkdirSync(fullPath, { recursive: true });
fs.writeFileSync(path.join(fullPath, 'qmake'), '');
createDummyQMakeFile(fullPath);
});

const result = locateQtArchDir(tempDir);
Expand Down

0 comments on commit a8bc0c6

Please sign in to comment.