Skip to content

Commit

Permalink
Merge pull request #46 from okurz/feature/tests
Browse files Browse the repository at this point in the history
Add tidy and compile checks
  • Loading branch information
mergify[bot] authored Feb 7, 2024
2 parents c697cdf + a35eda2 commit 4afceaf
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/perl-author-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: 'Perl author tests'

on: [push, pull_request]

jobs:
perl-author-tests:
runs-on: ubuntu-latest
name: Perl author tests
container:
image: registry.opensuse.org/devel/openqa/containers/os-autoinst_dev
steps:
- uses: actions/checkout@v4
- run: make test-author
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
.PHONY: help
help:
@echo Call one of the available targets:
@sed -n 's/\(^[^.#[:space:]A-Z]*\):.*$$/\1/p' Makefile | uniq

.PHONY: update-deps
update-deps:
tools/update-deps --cpanfile cpanfile

.PHONY: test
test: test-tidy test-author

.PHONY: test-tidy
test-tidy:
tools/tidyall --all --check-only

.PHONY: test-author
test-author:
prove -l -r xt/
7 changes: 7 additions & 0 deletions xt/00-tidy.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/perl
# Copyright SUSE LLC
# SPDX-License-Identifier: GPL-2.0-or-later

use Test::Most;
use Test::Code::TidyAll;
tidyall_ok();
20 changes: 20 additions & 0 deletions xt/01-compile-check-all.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright SUSE LLC
# SPDX-License-Identifier: GPL-2.0-or-later

use Test::Most;
# We need :no_end_test here because otherwise it would output a no warnings
# test for each of the modules, but with the same test number
use Test::Warnings qw(:no_end_test :report_warnings);
use FindBin;
use lib "$FindBin::Bin/lib";
use OpenQA::Test::TimeLimit '400';

use Test::Strict;

push @Test::Strict::MODULES_ENABLING_STRICT, 'Test::Most';
push @Test::Strict::MODULES_ENABLING_WARNINGS, 'Test::Most';

$Test::Strict::TEST_SYNTAX = 1;
$Test::Strict::TEST_STRICT = 1;
$Test::Strict::TEST_WARNINGS = 1;
all_perl_files_ok(qw(lib tools xt));

0 comments on commit 4afceaf

Please sign in to comment.