From a3fd105acb8a323570d44a4b2417293abb47245e Mon Sep 17 00:00:00 2001 From: Todd Strader Date: Thu, 18 Jul 2019 05:31:02 -0400 Subject: [PATCH] Add more Travis coverage --- .travis.yml | 92 ++++++++++++++++++++++++--- configure.ac | 4 +- test_regress/t/t_leak.pl | 33 +++++----- test_regress/t/t_sys_sformat_noopt.pl | 3 +- 4 files changed, 104 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3de44b8c..74f3028f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,20 +5,94 @@ # General Public License Version 3 or the Perl Artistic License Version 2.0. language: cpp -compiler: gcc + +matrix: + include: +# Non-cron build will just run on whatever linux flavor we get + - if: type != cron + os: linux + compiler: gcc + env: + - SCENARIOS=--dist + - if: type != cron + os: linux + compiler: gcc + env: + - SCENARIOS=--vlt + - if: type != cron + os: linux + compiler: gcc + env: + - SCENARIOS=--vltmt +# Cron builds try different OS/compiler combinations + - if: type = cron + dist: xenial + compiler: gcc + env: + - SCENARIOS=--dist + - if: type = cron + dist: xenial + compiler: gcc + env: + - SCENARIOS=--vlt + - if: type = cron + dist: xenial + compiler: gcc + env: + - SCENARIOS=--vltmt + - if: type = cron + dist: xenial + compiler: clang + env: + - SCENARIOS=--dist + - if: type = cron + dist: xenial + compiler: clang + env: + - SCENARIOS=--vlt + - if: type = cron + dist: xenial + compiler: clang + env: + - SCENARIOS=--vltmt +# - if: type = cron +# os: osx +# compiler: gcc +# env: +# - SCENARIOS=--dist +# - if: type = cron +# os: osx +# compiler: gcc +# env: +# - SCENARIOS=--vlt +# - if: type = cron +# os: osx +# compiler: gcc +# env: +# - SCENARIOS=--vltmt + - if: type = cron + dist: trusty + compiler: gcc + env: + - SCENARIOS=--dist + - if: type = cron + dist: trusty + compiler: gcc + env: + - SCENARIOS=--vlt + - if: type = cron + dist: trusty + compiler: gcc + env: + - SCENARIOS=--vltmt + cache: ccache # Some tests require gdb addons: apt: packages: - - gdb - -# Run three test slices in parallel -env: - - TEST=--dist - - TEST=--vlt - - TEST=--vltmt + - gdb before_install: # Perl modules needed for testing @@ -32,6 +106,6 @@ script: - > ./configure --enable-maintainer-mode --enable-longtests && make -j $VLT_JOBS && - make test SCENARIOS=$TEST DRIVER_FLAGS="-j 0 --quiet --rerun" + make test_regress DRIVER_FLAGS="-j 0 --quiet --rerun" after_script: - ccache -s diff --git a/configure.ac b/configure.ac index 6fa0f9841..28882f996 100644 --- a/configure.ac +++ b/configure.ac @@ -273,7 +273,9 @@ AC_SUBST(CFG_CXXFLAGS_PARSER) # without this flag, even though there's a conditional to prevent the divide. # We still don't add no-div-by-zero as it throws message to stdout, though doesn't die. #_MY_CXX_CHECK_OPT(-Wno-div-by-zero) -_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-faligned-new) +# For some reason -faligned-new does not work under Travis w/ clang but the +# configure test doesn't catch this either +AS_IF([test "x$TRAVIS_COMPILER" != xclang], [_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-faligned-new)]) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-fbracket-depth=4096) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Qunused-arguments) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-bool-operation) diff --git a/test_regress/t/t_leak.pl b/test_regress/t/t_leak.pl index c763dc139..af1d76b34 100755 --- a/test_regress/t/t_leak.pl +++ b/test_regress/t/t_leak.pl @@ -7,22 +7,23 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. -scenarios(vlt_all => 1); - -if ($ENV{TRAVIS} && $ENV{TRAVIS} eq 'true') { - skip("Fails occasionally on Travis-CI"); -} else { - compile( - make_top_shell => 0, - make_main => 0, - verilator_flags2 => ["--exe $Self->{t_dir}/$Self->{name}.cpp"], - ); - - execute( - check_finished => 1, - ); - - ok(1); +if ($Self->{vltmt} && exists $ENV{TRAVIS_DIST} && + $ENV{TRAVIS_DIST} eq "trusty") +{ + skip("Multithreaded test does not work under Travis w/ Ubuntu Trusty"); } +scenarios(vlt_all => 1); + +compile( + make_top_shell => 0, + make_main => 0, + verilator_flags2 => ["--exe $Self->{t_dir}/$Self->{name}.cpp"], + ); + +execute( + check_finished => 1, + ); + +ok(1); 1; diff --git a/test_regress/t/t_sys_sformat_noopt.pl b/test_regress/t/t_sys_sformat_noopt.pl index dc7e03f51..b2bb8f60b 100755 --- a/test_regress/t/t_sys_sformat_noopt.pl +++ b/test_regress/t/t_sys_sformat_noopt.pl @@ -16,8 +16,7 @@ compile( verilator_flags2 => ["-O0"], ); -if ($Self->cxx_version =~ /clang version ([0-9]+\.[0-9]+)/ - && ($1 >= 3.8 && $1 <= 5.0)) { +if ($Self->cxx_version =~ /clang/) { skip("Known clang bug"); #Here: if (VL_UNLIKELY(VL_NEQ_W(12, __Vtemp1, vlSymsp->TOP__t.__PVT__str))) } else{