aboutsummaryrefslogtreecommitdiff
path: root/profile_proc.tcl
blob: 0238d168316b3a1cc529515b99b600ea5f4d3fdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# (C) 2011 by Eugeniy Mikhailov, <evgmik@gmail.com>
# vim:set ft=tcl: \
exec tclsh "$0" "$@"

package require sqlite3
package require md5
package require json::write
source ./profiler.tcl
source ./GradeBook_lib.tcl

if { $argc < 2 } {	
	puts {Profile and test built-in library procs}
	puts {Usage:}
	puts "  $argv0 database_name ProcName \[arg1\] \[arg2\] \[arg3\] ..." 
	puts {}
	puts {Example:}
	puts [join [list {  } $argv0 tests/test_class.db UpdateGradesTableStatistic dummy1 dummy2] " "]
	exit
}

set dbfile [lindex $argv 0] 
set ProcName [lindex $argv 1] 
set arg_list [lrange $argv 2 end]

sqlite3 db $dbfile

$ProcName {*}$arg_list

global TimeProfilerMode
if { [info exists TimeProfilerMode] } {
	TimeProfilerDump description
 }

db close

# vim: ts=2 sw=2 foldmethod=indent: