File: all.tcl

package info (click to toggle)
libyang 5.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 11,212 kB
  • sloc: ansic: 131,170; xml: 671; sh: 448; tcl: 325; makefile: 19
file content (35 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (2)
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
package require tcltest
package require Expect

# Save current terminal size, but only if we are in an environtment with a tty (i.g. may not be present in a CI)
set has_tty 0
if {![catch {exec stty size} stty_output]} {
    scan $stty_output "%d %d" orig_lines orig_columns
    set has_tty 1
}

if {$has_tty} {
    # setting some large terminal width
    stty columns 720
}

# Hook to determine if any of the tests failed.
# Sets a global variable exitCode to 1 if any test fails otherwise it is set to 0.
proc tcltest::cleanupTestsHook {} {
    variable numTests
    set ::exitCode [expr {$numTests(Failed) > 0}]
}

if {[info exists ::env(TESTS_DIR)]} {
    tcltest::configure -testdir "$env(TESTS_DIR)/interactive"
}

# run all interactive tests
tcltest::runAllTests

if {$has_tty} {
    # Restore original terminal size
    exec stty rows $orig_lines cols $orig_columns
}

exit $exitCode