Skip to content

Commit

Permalink
Overhaul signals (#3)
Browse files Browse the repository at this point in the history
* Add initial work on signals.

* WIP

* WIP

* Add ternary operator.

* Work on docs.

* Add various other signal utilities.

* Try to integrate codecov.

* Fix codecov integration and try to get Travis caching to work.

* Attempt to fix codecov.

* Attempt to fix caching.

* Improve coverage.

* Fix a compilation error.

* Improve test coverage.

* Add code coverage badge.

* Improve test coverage.

* WIP

* Remove constant signals. Improve test coverage.

* Fix .gitignore.

* Fix Travis CI.

* Improve test coverage.

* Fix lcov macro names.

* Improve interface of lazy_reader.

* Add core signal tests.
  • Loading branch information
tmadden committed Jul 6, 2018
1 parent 68ba67d commit e9fb330
Show file tree
Hide file tree
Showing 42 changed files with 3,164 additions and 1,875 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.fips-*
.vscode
.python
.lcov.info
.venv

12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ before_script:
- sudo apt-get install -y --upgrade binutils-2.26
- export PATH=/usr/lib/binutils-2.26/bin:${PATH}
- scripts/set-up-python.sh
- source .python/bin/activate
- source .venv/bin/activate
- export CC=`which gcc-5`
- export CXX=`which g++-5`
- scripts/set-up-conan.sh

script:
- ./fips make test linux-make-debug
- ./fips make test linux-make-release

before_cache:
- conan remove "*" -s -b -f

cache:
directories:
- $HOME/.conan/data

after_success:
- bash <(curl -s https://codecov.io/bash) -X gcov
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ if(FIPS_GCC AND CMAKE_BUILD_TYPE STREQUAL "Debug")
COMMAND ${CMAKE_COMMAND} --build . --target unit_tests
COMMAND lcov --directory . --capture --output-file raw.info
COMMAND lcov --extract raw.info '${PROJECT_SOURCE_DIR}/src/alia/*' --output-file filtered.info
COMMAND ${CMAKE_COMMAND} -E copy filtered.info ${PROJECT_SOURCE_DIR}/.lcov.info
COMMAND ${CMAKE_COMMAND} -E copy filtered.info ${PROJECT_SOURCE_DIR}/lcov.info
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
add_test(
NAME unit_test_coverage
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

[![Build Status](https://travis-ci.org/tmadden/alia.svg?branch=master)](https://travis-ci.org/tmadden/alia)
[![Build status](https://ci.appveyor.com/api/projects/status/nxtmxag4oph0a0ie/branch/master?svg=true)](https://ci.appveyor.com/project/tmadden/alia/branch/master)
[![codecov](https://codecov.io/gh/tmadden/alia/branch/master/graph/badge.svg)](https://codecov.io/gh/tmadden/alia)
13 changes: 13 additions & 0 deletions compilation_tests/invalid_signal_access.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <alia/signals.hpp>

using namespace alia;

void
f()
{
auto s = value(0);
signal_is_readable(s);
#ifdef ALIA_TEST_COMPILATION_FAILURE
signal_is_writable(s);
#endif
}
23 changes: 23 additions & 0 deletions compilation_tests/invalid_signal_argument.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <alia/signals.hpp>

using namespace alia;

void
g(input<int> x)
{
}

void
h(inout<int> x)
{
}

void
f()
{
auto s = value(0);
g(s);
#ifdef ALIA_TEST_COMPILATION_FAILURE
h(s);
#endif
}
12 changes: 12 additions & 0 deletions compilation_tests/read_write_intersection.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <alia/signals.hpp>

using namespace alia;

void
f()
{
signal_direction_intersection<read_only_signal, two_way_signal>::type();
#ifdef ALIA_TEST_COMPILATION_FAILURE
signal_direction_intersection<read_only_signal, write_only_signal>::type();
#endif
}
12 changes: 12 additions & 0 deletions compilation_tests/write_read_intersection.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <alia/signals.hpp>

using namespace alia;

void
f()
{
signal_direction_intersection<write_only_signal, two_way_signal>::type();
#ifdef ALIA_TEST_COMPILATION_FAILURE
signal_direction_intersection<write_only_signal, read_only_signal>::type();
#endif
}
29 changes: 9 additions & 20 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand All @@ -30,7 +29,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ['sphinx.ext.todo']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -76,9 +75,10 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
Expand All @@ -88,15 +88,13 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []

# html_static_path = []

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'aliadoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
Expand All @@ -121,31 +119,22 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'alia.tex', u'alia Documentation',
u'Thomas Madden', 'manual'),
(master_doc, 'alia.tex', u'alia Documentation', u'Thomas Madden',
'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'alia', u'alia Documentation',
[author], 1)
]

man_pages = [(master_doc, 'alia', u'alia Documentation', [author], 1)]

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'alia', u'alia Documentation',
author, 'alia', 'One line description of project.',
'Miscellaneous'),
(master_doc, 'alia', u'alia Documentation', author, 'alia',
'One line description of project.', 'Miscellaneous'),
]



0 comments on commit e9fb330

Please sign in to comment.