diff options
Diffstat (limited to 'test/helpers.lua')
-rw-r--r-- | test/helpers.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/helpers.lua b/test/helpers.lua index 779d33e3b1..c2a708197f 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -190,6 +190,15 @@ module.uname = (function() end) end)() +function module.is_os(s) + if not (s == 'win' or s == 'mac' or s == 'unix') then + error('unknown platform: '..tostring(s)) + end + return ((s == 'win' and module.iswin()) + or (s == 'mac' and module.uname() == 'darwin') + or (s == 'unix')) +end + local function tmpdir_get() return os.getenv('TMPDIR') and os.getenv('TMPDIR') or os.getenv('TEMP') end |