Skip to content

Commit

Permalink
Add some basic smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Jan 8, 2025
1 parent ddc0de1 commit eb791ea
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 1 deletion.
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

0 comments on commit eb791ea

Please sign in to comment.