diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 64ca409d1..419e6f27a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/rdmd_test.d b/rdmd_test.d index cb7cd2f07..881569887 100755 --- a/rdmd_test.d +++ b/rdmd_test.d @@ -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"); @@ -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); }