From 07d4ff85e189da8b52214a744b1e5af9901dfdea Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 11 Jan 2018 14:36:09 -0200 Subject: Tests: modify platform detection --- spec/util/test_env.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index 9d9ae843..c5178e57 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua @@ -209,15 +209,18 @@ function test_env.set_args() if not test_env.TEST_TARGET_OS then title("OS CHECK") - if execute_bool("sw_vers") then - test_env.TEST_TARGET_OS = "osx" - if test_env.TRAVIS then - test_env.OPENSSL_DIRS = "OPENSSL_LIBDIR=/usr/local/opt/openssl/lib OPENSSL_INCDIR=/usr/local/opt/openssl/include" - end - elseif execute_output("uname -s") == "Linux" then - test_env.TEST_TARGET_OS = "linux" - else + if package.config:sub(1,1) == "\\" then test_env.TEST_TARGET_OS = "windows" + else + local system = execute_output("uname -s") + if system == "Linux" then + test_env.TEST_TARGET_OS = "linux" + elseif system == "Darwin" then + test_env.TEST_TARGET_OS = "osx" + if test_env.TRAVIS then + test_env.OPENSSL_DIRS = "OPENSSL_LIBDIR=/usr/local/opt/openssl/lib OPENSSL_INCDIR=/usr/local/opt/openssl/include" + end + end end end return true -- cgit v1.2.3-55-g6feb