diff options
| -rw-r--r-- | .github/workflows/macos.yml | 6 | ||||
| -rw-r--r-- | github_test.sh | 12 | ||||
| -rw-r--r-- | source/core/unix/slang-unix-process.cpp | 17 | ||||
| -rw-r--r-- | tools/slang-test/options.cpp | 4 |
4 files changed, 37 insertions, 2 deletions
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 700d9f6a4..ba92715fc 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -30,4 +30,10 @@ jobs: CONFIGURATION=${{matrix.configuration}} ARCH=${{matrix.platform}} source ./github_macos_build.sh + - name: test + run: + CONFIGURATION=${{matrix.configuration}} + CC=${{matrix.compiler}} + ARCH=${{matrix.platform}} + source ./github_test.sh
\ No newline at end of file diff --git a/github_test.sh b/github_test.sh index f36a0b950..b18566f84 100644 --- a/github_test.sh +++ b/github_test.sh @@ -11,6 +11,16 @@ fi PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]') ARCHITECTURE=$(uname -p) +# Darwin is actually macosx (for paths etc) +if [ "${PLATFORM}" == "darwin" ]; then + PLATFORM="macosx" + + # Modern OSX is only 64 bit, so assume that + if [ "${ARCHITECTURE}" == "i386" ]; then + ARCHITECTURE="x64" + fi +fi + if [ "${ARCHITECTURE}" == "x86_64" ]; then ARCHITECTURE="x64" fi @@ -19,7 +29,7 @@ TARGET=${PLATFORM}-${ARCHITECTURE} OUTPUTDIR=bin/${TARGET}/${CONFIGURATION}/ -if [ "${ARCHITECTURE}" == "x64" ]; then +if [ "${ARCHITECTURE}" == "x64" -a "${PLATFORM}" != "macosx" ]; then LOCATION=$(curl -s https://api.github.com/repos/shader-slang/swiftshader/releases/latest \ | grep "tag_name" \ | awk '{print "https://github.com/shader-slang/swiftshader/releases/download/" substr($2, 2, length($2)-3) "/vk_swiftshader_linux_x64.zip"}') diff --git a/source/core/unix/slang-unix-process.cpp b/source/core/unix/slang-unix-process.cpp index 991d905d9..2275238d9 100644 --- a/source/core/unix/slang-unix-process.cpp +++ b/source/core/unix/slang-unix-process.cpp @@ -261,6 +261,12 @@ SlangResult UnixPipeStream::read(void* buffer, size_t length, size_t& outReadByt return SLANG_FAIL; } + // If there are no poll events, we are done + if (pollResult == 0) + { + return SLANG_OK; + } + // If there is data read that first if (pollInfo.revents & POLLIN) { @@ -281,7 +287,16 @@ SlangResult UnixPipeStream::read(void* buffer, size_t length, size_t& outReadByt } outReadBytes = size_t(count); - return SLANG_OK; + + // If no bytes were wanted, then there could still be bytes in the pipe + // before a HUP. So don't fall through to check for HUP. + // + // If some bytes *were* wanted and none were read, we can allow fall through to + // handle HUP. + if (length == 0 || count > 0) + { + return SLANG_OK; + } } if (pollInfo.revents & POLLHUP) diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp index 38ed902a8..11188d766 100644 --- a/tools/slang-test/options.cpp +++ b/tools/slang-test/options.cpp @@ -125,6 +125,10 @@ static bool _isSubCommand(const char* arg) } optionsOut->binDir = *argCursor++; } + else if (strcmp(arg, "-use-shared-library") == 0) + { + optionsOut->defaultSpawnType = SpawnType::UseSharedLibrary; + } else if (strcmp(arg, "-use-test-server") == 0) { optionsOut->defaultSpawnType = SpawnType::UseTestServer; |
