-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.tcl
54 lines (45 loc) · 1.25 KB
/
build.tcl
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package require tin 1.0
tin import assert from tin
tin import tcltest
set version 0.9
set config ""
dict set config VERSION $version
dict set config VUTIL_VERSION 4.0
puts "Building from source files..."
tin bake src build $config
tin bake doc/template/version.tin doc/template/version.tex $config
source tests/build_examples.tcl
puts "Loading package from build folder..."
source build/ndlist.tcl
namespace import ndlist::*
# Source all test files
puts "Running all tests..."
source tests/vector_test.tcl
source tests/matrix_test.tcl
source tests/tensor_test.tcl
source tests/object_test.tcl
source tests/fileio_test.tcl
source tests/table_test.tcl
source tests/examples.tcl
# Check number of failed tests
set nFailed $::tcltest::numTests(Failed)
# Clean up and report on tests
cleanupTests
# If tests failed, return error
if {$nFailed > 0} {
error "$nFailed tests failed"
}
puts "Tests passed, installing..."
# Tests passed, copy build files to main folder and install
file copy -force {*}[glob -directory build *] [pwd]
exec tclsh install.tcl
# Verify installation
puts "Verifying installation..."
tin forget ndlist
tin clear
tin import ndlist -exact $version
# Build documentation
puts "Building documentation..."
cd doc
exec -ignorestderr pdflatex ndlist.tex
cd ..