diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 63de8ea65..dabfe1f95 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -53,6 +53,8 @@ jobs: make -C build bin/jitperf export ASAN_OPTIONS=detect_leaks=0 # XXX: remove this ./build/bin/jitperf -L build/lib/ test/perf/simple.vhd + - name: Check for orphan tests + run: make -C build orphan-tests - name: Coverage report run: make -C build cov-generate - name: Coveralls diff --git a/test/Makemodule.am b/test/Makemodule.am index 53bd83b87..c58dde96b 100644 --- a/test/Makemodule.am +++ b/test/Makemodule.am @@ -165,6 +165,18 @@ update-test-dist: 'test/*.gtkw' 'test/*.tcl' 'test/*.v' \ | sort | sed -e 's/^/\t/' -e '$$ ! s/$$/ \\/' ; \ ) > $(top_srcdir)/test/dist.mk + +orphan-tests: + ( \ + cd $(top_srcdir) ; \ + missing=$$(comm -23 \ + <(git ls-files -- 'test/regress/*.vhd' 'test/regress/*.v' \ + | sed 's|.*/\([[:alnum:]]*\)\..*|\1|' | sort | uniq) \ + <(cut -d' ' -f1 test/regress/testlist.txt | sort) \ + | tee /dev/stderr | wc -l) ; \ + [ "$$missing" = 0 ] || exit 1 ; \ + ) + endif .PHONY: update-test-dist diff --git a/test/regress/testlist.txt b/test/regress/testlist.txt index a9ba61398..0ba80a4c1 100644 --- a/test/regress/testlist.txt +++ b/test/regress/testlist.txt @@ -849,3 +849,4 @@ issue750 normal,2008 order3 shell driver18 normal,2008 vhpi9 normal,vhpi +issue730 normal,2008 diff --git a/tools/orphan-tests.rb b/tools/orphan-tests.rb deleted file mode 100755 index cf13b9b0e..000000000 --- a/tools/orphan-tests.rb +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env ruby - -# -# Find any tests in test/regress that are not in testlist.txt -# - -require 'rubygems' -require 'pathname' - -ScriptDir = Pathname.new(__FILE__).realpath.dirname -TestDir = ScriptDir + "../test/regress" - -have = File.open(TestDir + "testlist.txt").each_line.collect do |l| - l.split(/ /)[0] -end - -files = Dir.glob(TestDir + "*.vhd").collect do |f| - name = File.basename(f).gsub(/\.vhd/, '') - puts "missing #{name}" unless have.any? { |s| s == name } -end