Tests: Detect old GCC and skip unsupported tests.

This commit is contained in:
Wilson Snyder 2017-10-26 21:48:45 -04:00
parent ad693d67b2
commit d542921ff7
9 changed files with 64 additions and 1 deletions

View File

@ -92,6 +92,7 @@ datarootdir = @datarootdir@
CFG_WITH_CCWARN = @CFG_WITH_CCWARN@
CFG_WITH_DEFENV = @CFG_WITH_DEFENV@
CFG_WITH_LONGTESTS = @CFG_WITH_LONGTESTS@
CFG_WITH_THREADED = @CFG_WITH_THREADED@
PACKAGE_VERSION = @PACKAGE_VERSION@
#### End of system configuration section. ####
@ -505,6 +506,9 @@ dist-file-list:
@echo $(wildcard $(DISTFILES))
@echo "end-dist-file-list:"; # Scripts look for this
print-cfg-with-threaded:
@echo $(CFG_WITH_THREADED)
######################################################################
# Distributions

View File

@ -227,6 +227,23 @@ _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-unused-variable)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-shadow)
AC_SUBST(CFG_CXXFLAGS_NO_UNUSED)
# Set CFG_WITH_THREADED if can support threading
AC_MSG_CHECKING(whether $CXX supports Verilated threads)
ACO_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_STD_NEWEST $CFG_CXXFLAGS_NO_UNUSED"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <thread>], [[ ]])],
[_my_result=yes
if test -s conftest.err; then
if grep -e "$1" conftest.err >/dev/null; then
_my_result=no
fi
fi],
[_my_result=no])
CFG_WITH_THREADED=$_my_result
AC_SUBST(CFG_WITH_THREADED)
AC_MSG_RESULT($CFG_WITH_THREADED)
# Checks for library functions.
AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec],
[AC_DEFINE([HAVE_STAT_NSEC],[1],[Defined if struct stat has st_mtim.tv_nsec])],

View File

@ -1512,6 +1512,12 @@ sub cxx_version {
return $_Cxx_Version;
}
our $_Cfg_With_Threaded;
sub cfg_with_threaded {
my $out = `make -f ../Makefile print-cfg-with-threaded`;
return ($out =~ /yes/i) ? 1:0;
}
sub file_grep_not {
my $self = (ref $_[0]? shift : $Self);
my $filename = shift;

View File

@ -7,6 +7,8 @@ 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.
$Self->skip("No thread support") if !$Self->cfg_with_threaded;
top_filename("t/t_threads_counter.v");
compile (

View File

@ -7,6 +7,8 @@ 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.
$Self->skip("No thread support") if !$Self->cfg_with_threaded;
top_filename("t/t_threads_counter.v");
compile (

View File

@ -13,7 +13,7 @@ my $root = "..";
compile (
# Can't use --coverage and --savable together, so cheat and compile inline
verilator_flags2 => ['--cc --coverage-toggle --coverage-line --coverage-user --trace --threads 1 --vpi $root/include/verilated_save.cpp'],
verilator_flags2 => ['--cc --coverage-toggle --coverage-line --coverage-user --trace --vpi $root/include/verilated_save.cpp'],
);
execute (

View File

@ -0,0 +1,26 @@
#!/usr/bin/perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003-2009 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
$Self->skip("No thread support") if !$Self->cfg_with_threaded;
top_filename("t/t_verilated_all.v");
my $root = "..";
compile (
# Can't use --coverage and --savable together, so cheat and compile inline
verilator_flags2 => ['--cc --coverage-toggle --coverage-line --coverage-user --trace --threads 1 --vpi $root/include/verilated_save.cpp'],
);
execute (
check_finished=>1,
);
ok(1);
1;

View File

@ -7,6 +7,9 @@ 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.
$Self->skip("Known compiler limitation")
if $Self->cxx_version =~ /\(GCC\) 4.4/;
compile (
make_top_shell => 0,
make_main => 0,

View File

@ -7,6 +7,9 @@ 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.
$Self->skip("Known compiler limitation")
if $Self->cxx_version =~ /\(GCC\) 4.4/;
compile (
make_top_shell => 0,
make_main => 0,