Browse Source

add unsupported check in process test

Laytan 10 months ago
parent
commit
64508e477b
2 changed files with 8 additions and 0 deletions
  1. 2 0
      core/os/os2/errors_linux.odin
  2. 6 0
      tests/core/os/os2/process.odin

+ 2 - 0
core/os/os2/errors_linux.odin

@@ -162,6 +162,8 @@ _get_platform_error :: proc(errno: linux.Errno) -> Error {
 		return .Invalid_File
 	case .ENOMEM:
 		return .Out_Of_Memory
+	case .ENOSYS:
+		return .Unsupported
 	}
 
 	return Platform_Error(i32(errno))

+ 6 - 0
tests/core/os/os2/process.odin

@@ -1,6 +1,7 @@
 package tests_core_os_os2
 
 import os "core:os/os2"
+import    "core:log"
 import    "core:testing"
 
 @(test)
@@ -11,6 +12,11 @@ test_process_exec :: proc(t: ^testing.T) {
 	defer delete(stdout)
 	defer delete(stderr)
 
+	if err == .Unsupported {
+		log.warn("process_exec unsupported")
+		return
+	}
+
 	testing.expect_value(t, state.exited,  true)
 	testing.expect_value(t, state.success, true)
 	testing.expect_value(t, err, nil)