diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2013-12-05 09:27:30 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2013-12-05 09:27:30 -0500 |
commit | afa21f1e7e9f8c5b8032a8a71f66214ab85b0e5e (patch) | |
tree | 8db023735c87e94cd91abcabb4092dac15c411a6 /test_weight_calc.tcl | |
parent | f1e16fdd76c427ed5de1eb1ab7c856b81ca9fd0b (diff) | |
download | GradeBook-afa21f1e7e9f8c5b8032a8a71f66214ab85b0e5e.tar.gz GradeBook-afa21f1e7e9f8c5b8032a8a71f66214ab85b0e5e.zip |
added profiling and test file
Diffstat (limited to 'test_weight_calc.tcl')
-rwxr-xr-x | test_weight_calc.tcl | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test_weight_calc.tcl b/test_weight_calc.tcl new file mode 100755 index 0000000..793a56b --- /dev/null +++ b/test_weight_calc.tcl @@ -0,0 +1,47 @@ +#!/bin/sh +# (C) 2011 by Eugeniy Mikhailov, <evgmik@gmail.com> +# vim:set ft=tcl: \ +exec tclsh "$0" "$@" + +package require sqlite3 +package require md5 +source ./profiler.tcl +source ./GradeBook_lib.tcl + +if { $argc < 1 } { + puts {tests built in library functions} + puts {Usage:} + puts " $argv0 database_name" + puts {} + puts {Example:} + puts [concat " $argv0" { 2013_Spring_Phys742}] + exit +} + +set dbfile [lindex $argv 0] +sqlite3 db $dbfile + + set eval_str [concat BEGIN TRANSACTION] + set err [catch {db eval $eval_str } errStat] + if { $err } { + htmlErrorMsg $errStat + dbg "the following error happen: $errStat" msg_level_critical + } + +calculteWeightedTotals + + set eval_str [concat END TRANSACTION] + set err [catch {db eval $eval_str } errStat] + if { $err } { + htmlErrorMsg $errStat + dbg "the following error happen: $errStat" msg_level_critical + } + +global TimeProfilerMode +if { [info exists TimeProfilerMode] } { + TimeProfilerDump description + } + +db close + +# vim: ts=2 sw=2 foldmethod=indent: |