1 local cmds
= require('commands')
2 local getopt
= require('getopt')
3 local bin
= require('bin')
4 local utils
= require('utils')
5 local dumplib
= require('html_dumplib')
8 1. script run tracetest
11 usage
= "script run tracetest"
13 This script will load several traces files in ../traces/ folder and do
17 The following tracefiles will be loaded:
25 local TIMEOUT
= 2000 -- Shouldn't take longer than 2 seconds
26 local DEBUG
= true -- the debug flag
28 -- A debug printout-function
34 if type(args
) == "table" then
45 -- This is only meant to be used when errors occur
53 print("Example usage")
59 print( string.rep('--',20) )
60 print( string.rep('--',20) )
66 local function main(args
)
68 print( string.rep('--',20) )
69 print( string.rep('--',20) )
71 local cmdDataLoad
= 'data load %s';
72 local tracesEM
= "find '../traces/' -iname 'em*.pm3' -type f"
73 local tracesMOD
= "find '../traces/' -iname 'm*.pm3' -type f"
75 local write2File
= false
76 local outputTemplate
= os
.date("testtest_%Y-%m-%d_%H%M%S")
78 -- Arguments for the script
79 for o
, arg
in getopt
.getopt(args
, 'h') do
80 if o
== "h" then return help() end
83 core
.clearCommandBuffer()
87 -- Find a set of traces staring with EM
88 local p
= assert( io
.popen(tracesEM
))
89 for file
in p
:lines() do
90 table.insert(files
, file
)
94 -- Find a set of traces staring with MOD
95 p
= assert( io
.popen(tracesMOD
) )
96 for file
in p
:lines() do
97 table.insert(files
, file
)
101 local cmdLFSEARCH
= "lf search 1 u"
104 io
.write('Starting to test traces > ')
105 for _
,file
in pairs(files
) do
107 local x
= "data load "..file
112 core
.console(cmdLFSEARCH
)
114 core
.clearCommandBuffer()
116 if core
.ukbhit() then
117 print("aborted by user")
123 print( string.rep('--',20) )