Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some basic smoke tests #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Run tests

on: # yamllint disable-line rule:truthy
push:
branches: ['master']
pull_request:

jobs:
pytest:
uses: ros-infrastructure/ci/.github/workflows/pytest.yaml@main
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: yamllint -f github .
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.coverage
MANIFEST
dist
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tool:pytest]
junit_suite_name = catkin-sphinx
markers =
sphinx

[coverage:run]
source = catkin_sphinx
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,11 @@
description="Sphinx extension for Catkin projects",
long_description="Sphinx extension for Catkin projects that provides a "
"custom ROS theme and a Sphinx domain for cmake.",
license="BSD"
license="BSD",
extras_require={
'test': [
'pytest',
'sphinx',
],
},
)
6 changes: 6 additions & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import os
import sys

sys.path.insert(0, os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'src'))
11 changes: 11 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest
from sphinx.testing.path import path

pytest_plugins = (
'sphinx.testing.fixtures',
)


@pytest.fixture(scope='session')
def rootdir():
return path(__file__).parent.abspath() / 'roots'
11 changes: 11 additions & 0 deletions test/roots/test-cmake-extension/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pathlib import Path
import sys

import catkin_sphinx


project = 'test_cmake_extension'

sys.path.append(str(Path(catkin_sphinx.__file__).parent.resolve()))

extensions = ['cmake']
11 changes: 11 additions & 0 deletions test/roots/test-sh-lexer-extension/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pathlib import Path
import sys

import catkin_sphinx


project = 'test_sh_lexer'

sys.path.append(str(Path(catkin_sphinx.__file__).parent.resolve()))

extensions = ['ShLexer']
6 changes: 6 additions & 0 deletions test/test_cmake_extension.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest


@pytest.mark.sphinx(testroot='cmake-extension')
def test_cmake_extension_setup(app):
pass
6 changes: 6 additions & 0 deletions test/test_sh_lexer_extension.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest


@pytest.mark.sphinx(testroot='sh-lexer-extension')
def test_sh_lexer_setup(app):
pass
6 changes: 6 additions & 0 deletions test/test_theme_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import catkin_sphinx


def test_theme_path():
res = catkin_sphinx.get_theme_path()
assert res
Loading