From 4a3d06786b316f740dfdd4a7b41b751e9d155d66 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 29 Jul 2019 15:35:09 +0000 Subject: Enable testcases on Visual Studio builds. Disable some test-cases on Travis, which are known to fail. --- .travis.yml | 18 ++++++++++-------- tests/format.test | 5 +++-- tests/ioCmd.test | 3 ++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index b3bad96..6e85ec5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -154,7 +154,7 @@ matrix: - BUILD_DIR=win - CFGOPT="--host=i686-w64-mingw32 --enable-threads" script: &crosstest - - make all tcltest.exe + - make all tcltest # Include a high visibility marker that tests are skipped outright - > echo "`tput setaf 3`SKIPPED TEST: CROSS COMPILING`tput sgr0`" @@ -213,8 +213,7 @@ matrix: - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --enable-threads --enable-symbols" script: *crosstest # Test on Windows with MSVC native -# Doesn't run tests because not all tests work in this environment. TODO: either fix or disable those test-cases! - - name: "Windows/MSVC/Shared/no test" + - name: "Windows/MSVC/Shared" os: windows compiler: cl env: &vcenv @@ -225,23 +224,26 @@ matrix: - cd ${BUILD_DIR} install: [] script: - - cmd.exe /C 'vcvarsall.bat x64 && nmake -f makefile.vc all tcltest' - - name: "Windows/MSVC/Static/no test" + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=threads -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=threads -f makefile.vc test' + - name: "Windows/MSVC/Static" os: windows compiler: cl env: *vcenv before_install: *vcpreinst install: [] script: - - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static -f makefile.vc all tcltest' - - name: "Windows/MSVC/Debug/no test" + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static,msvcrt,threads -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static,msvcrt,threads -f test' + - name: "Windows/MSVC/Debug" os: windows compiler: cl env: *vcenv before_install: *vcpreinst install: [] script: - - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols,msvcrt,threads -f makefile.vc all tcltest' + - cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols,msvcrt,threads -f makefile.vc test' before_install: - cd ${BUILD_DIR} install: diff --git a/tests/format.test b/tests/format.test index 5797f2b..442580e 100644 --- a/tests/format.test +++ b/tests/format.test @@ -21,6 +21,7 @@ testConstraint longIs64bit [expr {int(0x8000000000000000) < 0}] testConstraint wideIs64bit \ [expr {(wide(0x80000000) > 0) && (wide(0x8000000000000000) < 0)}] testConstraint wideBiggerThanInt [expr {wide(0x80000000) != int(0x80000000)}] +testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] test format-1.1 {integer formatting} { format "%*d %d %d %d" 6 34 16923 -12 -1 @@ -251,13 +252,13 @@ test format-6.1 {floating-point zeroes} {eformat} { test format-6.2 {floating-point zeroes} {eformat} { format "%.4e %.4f %.4g" 0.0 0.0 0.0 0.0 } {0.0000e+00 0.0000 0} -test format-6.3 {floating-point zeroes} {eformat} { +test format-6.3 {floating-point zeroes} {eformat knownMsvcBug} { format "%#.4e %#.4f %#.4g" 0.0 0.0 0.0 0.0 } {0.0000e+00 0.0000 0.000} test format-6.4 {floating-point zeroes} {eformat} { format "%.0e %.0f %.0g" 0.0 0.0 0.0 0.0 } {0e+00 0 0} -test format-6.5 {floating-point zeroes} {eformat} { +test format-6.5 {floating-point zeroes} {eformat knownMsvcBug} { format "%#.0e %#.0f %#.0g" 0.0 0.0 0.0 0.0 } {0.e+00 0. 0.} test format-6.6 {floating-point zeroes} { diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 057a869..460299b 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -22,6 +22,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { testConstraint fcopy [llength [info commands fcopy]] testConstraint testchannel [llength [info commands testchannel]] testConstraint testthread [llength [info commands testthread]] +testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] #---------------------------------------------------------------------- @@ -754,7 +755,7 @@ test iocmd-21.19 {chan create, init failure -> no channel, no finalize} -match g rename foo {} set res } -result {{} {initialize rc* {read write}} 1 {*all required methods*} {}} -test iocmd-21.20 {Bug 88aef05cda} -setup { +test iocmd-21.20 {Bug 88aef05cda} -constraints knownMsvcBug -setup { proc foo {method chan args} { switch -- $method blocking { chan configure $chan -blocking [lindex $args 0] -- cgit v0.12