Skip to content

Commit

Permalink
Separation of benchmarks, now checks benchmark folder if no files found
Browse files Browse the repository at this point in the history
  • Loading branch information
DerelictDrone committed Aug 21, 2024
1 parent 1910545 commit 26c90f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
File renamed without changes.
10 changes: 8 additions & 2 deletions lua/wire/zvm/zvm_tests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@ ZVMTestSuite = {
}

local testDirectory = "wire/zvm/tests"
local benchmarkDirectory = testDirectory.."/benchmarks"

function ZVMTestSuite.CMDRun(_, _, _, names)
ZVMTestSuite.Warnings = 0
ZVMTestSuite.TestFiles = {}
local subdirectory = ""
for filename in string.gmatch(names, "[^,]+") do
local files = file.Find("lua/" .. testDirectory .. "/" .. filename .. ".lua", "GAME")
local files = file.Find("lua/" .. testDirectory .. "/" .. filename .. ".lua", "GAME")
if #files == 0 then
files = file.Find("lua/" .. benchmarkDirectory .. "/" .. filename .. ".lua", "GAME")
subdirectory = "/benchmarks/"
end
for _, i in ipairs(files) do
ZVMTestSuite.TestFiles[#ZVMTestSuite.TestFiles+1] = i
ZVMTestSuite.TestFiles[#ZVMTestSuite.TestFiles+1] = subdirectory..i
end
end
if #ZVMTestSuite.TestFiles == 0 and names ~= nil then
Expand Down

0 comments on commit 26c90f3

Please sign in to comment.