Skip to content

Commit

Permalink
osx
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Dec 17, 2023
1 parent 013df08 commit 01c3ad9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ jobs:
run: make -j3 DMD=${{ startsWith(matrix.dc, 'ldc') && 'ldmd2' || 'dmd' }}
- name: Test
shell: bash
run: make -j3 DMD=${{ startsWith(matrix.dc, 'ldc') && 'ldmd2' || 'dmd' }} test
# /tmp is a symlink on Mac, and rdmd_test.d doesn't like it
run: ${{ startsWith(matrix.os, 'macos') && 'TMPDIR=$(cd /tmp && pwd -P)' || '' }} make -j3 DMD=${{ startsWith(matrix.dc, 'ldc') && 'ldmd2' || 'dmd' }} test
19 changes: 2 additions & 17 deletions rdmd_test.d
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void runTests(string rdmdApp, string compiler, string model)

res = execute(rdmdArgs ~ [forceSrc.baseName()]);
enforce(res.status == 0, res.output);
enforce(!res.output.canFind("compile_force_src"));
enforce(!res.output.canFind("compile_force_src"), res.output);
}

auto conflictDir = forceSrc.setExtension(".dir");
Expand Down Expand Up @@ -690,20 +690,5 @@ void runFallbackTest(string rdmdApp, string buildCompiler, string model)

auto res = execute(rdmdApp ~ [modelSwitch(model), "--force", "--chatty", "--eval=writeln(`Compiler found.`);"]);
enforce(res.status == 1, res.output);

bool didSpawnExecutable(string executable) {
return res.output.canFind(format(`spawn [%(%s%),`, executable.only));
}

auto spawned = didSpawnExecutable(localDMD);
version (OSX)
{
// weird stuff for GitHub Actions at least:
// * localDMD is absolute `/var/folders/3s/vfzpb5r51gs6y328rmlgzm7c0000gn/T/dmd`
// * rdmd tries to spawn `/private/var/folders/3s/vfzpb5r51gs6y328rmlgzm7c0000gn/T/dmd`
if (!spawned)
spawned = didSpawnExecutable("/private" ~ localDMD);
}

enforce(spawned, localDMD ~ " would not have been executed. Output:\n" ~ res.output);
enforce(res.output.canFind(format(`spawn [%(%s%),`, localDMD.only)), localDMD ~ " would not have been executed. Output:\n" ~ res.output);
}

0 comments on commit 01c3ad9

Please sign in to comment.