Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit aa72ab1

Browse files
committed
[[ Benchmarks ]] Add 'folder' option to 'run'.
If the benchmark runner is called with 'run <folder>', then it will run all benchmarks below that folder rather than in the current directory.
1 parent e60514a commit aa72ab1

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

benchmarks/_benchmarkrunner.livecodescript

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ private command doRun pInfo
114114
local tScript, tCommand, tLog
115115
put pInfo["args"][2] into tScript
116116
put pInfo["args"][3] into tCommand
117-
if tScript is empty then
118-
runAllScripts pInfo
117+
if tScript is empty or there is a folder tScript then
118+
runAllScripts pInfo, tScript
119119
else if tCommand is empty then
120120
runSingleScript pInfo, tScript
121121
else
@@ -189,10 +189,9 @@ end invokeGetLibraryStack
189189

190190
-- Run all the benchmark scripts that can be found below the current
191191
-- directory
192-
private command runAllScripts pInfo
192+
private command runAllScripts pInfo, pFolder
193193
local tFile, tLog
194194
repeat for each element tFile in runGetBenchmarkFileNames()
195-
runBenchmarkScript pInfo, tFile
196195
runSingleScript pInfo, tFile
197196
put the result after tLog
198197
end repeat
@@ -243,13 +242,13 @@ end runSingleCommand
243242

244243
-- Get all livecode script files beneath the CWD, apart from
245244
-- filenames starting with "." or "_"
246-
private function runGetBenchmarkFileNames
245+
private function runGetBenchmarkFileNames pFolder
247246
local tFiles, tCount
248247

249248
put empty into tFiles
250249
put 0 into tCount
251250

252-
runGetBenchmarkFileNames_Recursive the defaultfolder, empty, tFiles, tCount
251+
runGetBenchmarkFileNames_Recursive the defaultfolder & slash & pFolder, empty, tFiles, tCount
253252

254253
return tFiles
255254
end runGetBenchmarkFileNames

0 commit comments

Comments
 (0)