diff options
author | Jelmer Vernooij <jelmer@jelmer.uk> | 2022-11-16 21:28:35 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@jelmer.uk> | 2022-11-26 14:22:39 +0000 |
commit | 2656841c8194d546fdab4f776322e760609346df (patch) | |
tree | d28048f33f99c303e4a4026eebd4394960f3ccef | |
parent | 52ba9e78e36d421a7417cac56a1ae577607aa24b (diff) | |
download | subunit-git-2656841c8194d546fdab4f776322e760609346df.tar.gz |
Remove perl support from the main subunit repo
This has now moved to https://github.com/jelmer/subunit-perl
This simplifies the build system logic and makes it unnecessary to
integrate auto{conf,make} and the Perl buildsystem. The perl support
is also not in the samestate as the rest of the code - it doesn't have a
testsuite, and only supports subunit v1.
-rw-r--r-- | Makefile.am | 28 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rwxr-xr-x | perl/Makefile.PL.in | 22 | ||||
-rw-r--r-- | perl/lib/Subunit.pm | 183 | ||||
-rw-r--r-- | perl/lib/Subunit/Diff.pm | 85 | ||||
-rwxr-xr-x | perl/subunit-diff | 31 |
6 files changed, 1 insertions, 351 deletions
diff --git a/Makefile.am b/Makefile.am index e1cb02d..5d68c98 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,10 +12,6 @@ EXTRA_DIST = \ c/check-subunit-0.9.3.patch \ c/check-subunit-0.9.5.patch \ c/check-subunit-0.9.6.patch \ - perl/Makefile.PL.in \ - perl/lib/Subunit.pm \ - perl/lib/Subunit/Diff.pm \ - perl/subunit-diff \ python/iso8601/LICENSE \ python/iso8601/README \ python/iso8601/README.subunit \ @@ -108,35 +104,13 @@ c_tests_test_child_CFLAGS = -I$(top_srcdir)/c/include $(SUBUNIT_CFLAGS) @CHECK_C c_tests_test_child_LDADD = $(tests_LDADD) -all-local: perl/Makefile - $(MAKE) -C perl all - -check-local: perl/Makefile - $(MAKE) -C perl check +check-local: SHELL_SHARE='$(top_srcdir)/shell/share/' \ PYTHONPATH='$(abs_top_srcdir)/python':'$(abs_top_srcdir)':$${PYTHONPATH} \ $(PYTHON) -m testtools.run all_tests.test_suite clean-local: find . -type f -name "*.pyc" -exec rm {} ';' - rm -f perl/Makefile - -# The default for MakeMaker; can be overridden by exporting -PERL_INSTALLDIRS ?= site -# Remove perl dir for VPATH builds. distclean-local: - -rm perl/Makefile.PL || true - -rmdir perl > /dev/null -rm -r .hypothesis > /dev/null - -install-exec-local: perl/Makefile - $(MAKE) -C perl install INSTALLDIRS=${PERL_INSTALLDIRS} DESTDIR=$(DESTDIR) INSTALL_BASE=$(prefix) INSTALLSITEBIN=$(bindir) - -mostlyclean-local: - rm -rf perl/blib - rm -rf perl/pm_to_blib - -# 'uninstall' perl files during distcheck -uninstall-local: perl/Makefile - $(MAKE) -C perl uninstall_distcheck INSTALLDIRS=${PERL_INSTALLDIRS} DESTDIR=$(DESTDIR) INSTALLSITEBIN=$(bindir) diff --git a/configure.ac b/configure.ac index 5e1dec8..064d3b3 100644 --- a/configure.ac +++ b/configure.ac @@ -68,11 +68,8 @@ PKG_CHECK_MODULES([CPPUNIT], [cppunit]) # Output files AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_COMMANDS([perl], [cd perl && perl Makefile.PL && cd ..], []) - AC_CONFIG_FILES([libsubunit.pc libcppunit_subunit.pc Makefile - perl/Makefile.PL ]) AC_OUTPUT diff --git a/perl/Makefile.PL.in b/perl/Makefile.PL.in deleted file mode 100755 index 395116e..0000000 --- a/perl/Makefile.PL.in +++ /dev/null @@ -1,22 +0,0 @@ -use ExtUtils::MakeMaker; -WriteMakefile( - 'PREFIX' => '@prefix@', - 'NAME' => 'Subunit', - 'VERSION' => '@SUBUNIT_VERSION@', - 'test' => { 'TESTS' => 'tests/*.pl' }, - 'PMLIBDIRS' => [ 'lib' ], - 'EXE_FILES' => [ '@abs_srcdir@/subunit-diff' ], -); -sub MY::postamble { -<<'EOT'; -check: # test - -uninstall_distcheck: - find $(DESTDIR)$(INSTALLSITEARCH) -type f -exec rm {} \; - rm -f MYMETA.yml MYMETA.json - rm -f $(DESTINSTALLBIN)/subunit-diff - -VPATH = @srcdir@ -.PHONY: uninstall_distcheck -EOT -} diff --git a/perl/lib/Subunit.pm b/perl/lib/Subunit.pm deleted file mode 100644 index 72aa1eb..0000000 --- a/perl/lib/Subunit.pm +++ /dev/null @@ -1,183 +0,0 @@ -# Perl module for parsing and generating the Subunit protocol -# Copyright (C) 2008-2009 Jelmer Vernooij <jelmer@samba.org> -# -# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause -# license at the users choice. A copy of both licenses are available in the -# project source as Apache-2.0 and BSD. You may not use this file except in -# compliance with one of these two licences. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# license you chose for the specific language governing permissions and -# limitations under that license. - -package Subunit; -use POSIX; - -require Exporter; -@ISA = qw(Exporter); -@EXPORT_OK = qw(parse_results $VERSION); - -use vars qw ( $VERSION ); - -$VERSION = '0.0.2'; - -use strict; - -sub parse_results($$$) -{ - my ($msg_ops, $statistics, $fh) = @_; - my $expected_fail = 0; - my $unexpected_fail = 0; - my $unexpected_err = 0; - my $open_tests = []; - - while(<$fh>) { - if (/^test: (.+)\n/) { - $msg_ops->control_msg($_); - $msg_ops->start_test($1); - push (@$open_tests, $1); - } elsif (/^time: (\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)Z\n/) { - $msg_ops->report_time(mktime($6, $5, $4, $3, $2, $1-1900)); - } elsif (/^(success|successful|failure|fail|skip|knownfail|error|xfail): (.*?)( \[)?([ \t]*)\n/) { - $msg_ops->control_msg($_); - my $result = $1; - my $testname = $2; - my $reason = undef; - if ($3) { - $reason = ""; - # reason may be specified in next lines - my $terminated = 0; - while(<$fh>) { - $msg_ops->control_msg($_); - if ($_ eq "]\n") { $terminated = 1; last; } else { $reason .= $_; } - } - - unless ($terminated) { - $statistics->{TESTS_ERROR}++; - $msg_ops->end_test($testname, "error", 1, "reason ($result) interrupted"); - return 1; - } - } - if ($result eq "success" or $result eq "successful") { - pop(@$open_tests); #FIXME: Check that popped value == $testname - $statistics->{TESTS_EXPECTED_OK}++; - $msg_ops->end_test($testname, $result, 0, $reason); - } elsif ($result eq "xfail" or $result eq "knownfail") { - pop(@$open_tests); #FIXME: Check that popped value == $testname - $statistics->{TESTS_EXPECTED_FAIL}++; - $msg_ops->end_test($testname, $result, 0, $reason); - $expected_fail++; - } elsif ($result eq "failure" or $result eq "fail") { - pop(@$open_tests); #FIXME: Check that popped value == $testname - $statistics->{TESTS_UNEXPECTED_FAIL}++; - $msg_ops->end_test($testname, $result, 1, $reason); - $unexpected_fail++; - } elsif ($result eq "skip") { - $statistics->{TESTS_SKIP}++; - my $last = pop(@$open_tests); - if (defined($last) and $last ne $testname) { - push (@$open_tests, $testname); - } - $msg_ops->end_test($testname, $result, 0, $reason); - } elsif ($result eq "error") { - $statistics->{TESTS_ERROR}++; - pop(@$open_tests); #FIXME: Check that popped value == $testname - $msg_ops->end_test($testname, $result, 1, $reason); - $unexpected_err++; - } - } else { - $msg_ops->output_msg($_); - } - } - - while ($#$open_tests+1 > 0) { - $msg_ops->end_test(pop(@$open_tests), "error", 1, - "was started but never finished!"); - $statistics->{TESTS_ERROR}++; - $unexpected_err++; - } - - return 1 if $unexpected_err > 0; - return 1 if $unexpected_fail > 0; - return 0; -} - -sub start_test($) -{ - my ($testname) = @_; - print "test: $testname\n"; -} - -sub end_test($$;$) -{ - my $name = shift; - my $result = shift; - my $reason = shift; - if ($reason) { - print "$result: $name [\n"; - print "$reason"; - print "]\n"; - } else { - print "$result: $name\n"; - } -} - -sub skip_test($;$) -{ - my $name = shift; - my $reason = shift; - end_test($name, "skip", $reason); -} - -sub fail_test($;$) -{ - my $name = shift; - my $reason = shift; - end_test($name, "failure", $reason); -} - -sub success_test($;$) -{ - my $name = shift; - my $reason = shift; - end_test($name, "success", $reason); -} - -sub xfail_test($;$) -{ - my $name = shift; - my $reason = shift; - end_test($name, "xfail", $reason); -} - -sub report_time($) -{ - my ($time) = @_; - my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($time); - printf "time: %04d-%02d-%02d %02d:%02d:%02dZ\n", $year+1900, $mon, $mday, $hour, $min, $sec; -} - -sub progress_pop() -{ - print "progress: pop\n"; -} - -sub progress_push() -{ - print "progress: push\n"; -} - -sub progress($;$) -{ - my ($count, $whence) = @_; - - unless(defined($whence)) { - $whence = ""; - } - - print "progress: $whence$count\n"; -} - -1; diff --git a/perl/lib/Subunit/Diff.pm b/perl/lib/Subunit/Diff.pm deleted file mode 100644 index e7841c3..0000000 --- a/perl/lib/Subunit/Diff.pm +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/perl -# Diff two subunit streams -# Copyright (C) Jelmer Vernooij <jelmer@samba.org> -# -# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause -# license at the users choice. A copy of both licenses are available in the -# project source as Apache-2.0 and BSD. You may not use this file except in -# compliance with one of these two licences. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# license you chose for the specific language governing permissions and -# limitations under that license. - -package Subunit::Diff; - -use strict; - -use Subunit qw(parse_results); - -sub control_msg() { } -sub report_time($$) { } - -sub output_msg($$) -{ - my ($self, $msg) = @_; - - # No output for now, perhaps later diff this as well ? -} - -sub start_test($$) -{ - my ($self, $testname) = @_; -} - -sub end_test($$$$$) -{ - my ($self, $testname, $result, $unexpected, $reason) = @_; - - $self->{$testname} = $result; -} - -sub new { - my ($class) = @_; - - my $self = { - }; - bless($self, $class); -} - -sub from_file($) -{ - my ($path) = @_; - my $statistics = { - TESTS_UNEXPECTED_OK => 0, - TESTS_EXPECTED_OK => 0, - TESTS_UNEXPECTED_FAIL => 0, - TESTS_EXPECTED_FAIL => 0, - TESTS_ERROR => 0, - TESTS_SKIP => 0, - }; - - my $ret = new Subunit::Diff(); - open(IN, $path) or return; - parse_results($ret, $statistics, *IN); - close(IN); - return $ret; -} - -sub diff($$) -{ - my ($old, $new) = @_; - my $ret = {}; - - foreach my $testname (keys %$old) { - if ($new->{$testname} ne $old->{$testname}) { - $ret->{$testname} = [$old->{$testname}, $new->{$testname}]; - } - } - - return $ret; -} - -1; diff --git a/perl/subunit-diff b/perl/subunit-diff deleted file mode 100755 index 581e832..0000000 --- a/perl/subunit-diff +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/perl -# Diff two subunit streams -# Copyright (C) Jelmer Vernooij <jelmer@samba.org> -# -# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause -# license at the users choice. A copy of both licenses are available in the -# project source as Apache-2.0 and BSD. You may not use this file except in -# compliance with one of these two licences. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# license you chose for the specific language governing permissions and -# limitations under that license. - -use Getopt::Long; -use strict; -use FindBin qw($RealBin $Script); -use lib "$RealBin/lib"; -use Subunit::Diff; - -my $old = Subunit::Diff::from_file($ARGV[0]); -my $new = Subunit::Diff::from_file($ARGV[1]); - -my $ret = Subunit::Diff::diff($old, $new); - -foreach my $e (sort(keys %$ret)) { - printf "%s: %s -> %s\n", $e, $ret->{$e}[0], $ret->{$e}[1]; -} - -0; |