diff --git a/Dockerfile.centos7 b/Dockerfile.centos7 index ad1e620b..d8d8deeb 100644 --- a/Dockerfile.centos7 +++ b/Dockerfile.centos7 @@ -11,7 +11,7 @@ RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo \ RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo \ && sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo \ && sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo \ - && yum install -y devtoolset-8 wget cmake3 make eigen3-devel tcl-devel tcl-tclreadline-devel swig3 bison flex zlib-devel \ + && yum install -y devtoolset-8 wget cmake3 make eigen3-devel tcl-devel tcl-tclreadline-devel swig3 bison flex zlib-devel valgrind \ && yum clean -y all # Download CUDD diff --git a/Dockerfile.ubuntu22.04 b/Dockerfile.ubuntu22.04 index bee8b31e..4bc5ea9d 100644 --- a/Dockerfile.ubuntu22.04 +++ b/Dockerfile.ubuntu22.04 @@ -16,7 +16,8 @@ RUN apt-get update && \ bison \ flex \ automake \ - autotools-dev + autotools-dev \ + valgrind # Download CUDD RUN wget https://raw.githubusercontent.com/davidkebo/cudd/main/cudd_versions/cudd-3.0.0.tar.gz && \ diff --git a/sdc/Sdc.tcl b/sdc/Sdc.tcl index 75b4b813..b2382800 100644 --- a/sdc/Sdc.tcl +++ b/sdc/Sdc.tcl @@ -72,10 +72,10 @@ proc source_ { filename echo verbose } { if [catch {open $filename r} stream] { sta_error 340 "cannot open '$filename'." } else { - if { [info commands zlib] == "" } { - sta_error 339 "tcl version > 8.6 required for zlib support." - } if { [file extension $filename] == ".gz" } { + if { [info commands zlib] == "" } { + sta_error 339 "tcl version > 8.6 required for zlib support." + } zlib push gunzip $stream } # Save file and line in recursive call to source. diff --git a/test/regression.tcl b/test/regression.tcl index 260c6cec..1beb7090 100755 --- a/test/regression.tcl +++ b/test/regression.tcl @@ -75,6 +75,9 @@ proc parse_args {} { lappend app_options $threads set argv [lrange $argv 2 end] } elseif { $arg == "-valgrind" } { + if { ![find_valgrind] } { + error "valgrind not found." + } set use_valgrind 1 set argv [lrange $argv 1 end] } elseif { $arg == "-report_stats" } { @@ -92,6 +95,18 @@ proc parse_args {} { } } +# Find valgrind in $PATH. +proc find_valgrind {} { + global env + + foreach dir [regsub -all ":" $env(PATH) " "] { + if { [file executable [file join $dir "valgrind"]] } { + return 1 + } + } + return 0 +} + proc expand_tests { argv } { global test_groups errors