Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/moxunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches: '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 1
- name: MOxUnit Action
uses: joergbrech/moxunit-action@v1.1
with:
tests: tests
src: src
with_coverage: true
cover_xml_file: coverage.xml
- name: Code coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Travis CI (https://travis-ci.org/)
# This will only work on your repo if you have an account on travis and you
# have set it up to run continuous integration on this this repo

# Linux distribution (bionic beaver)
dist: bionic

# Language and version
language: python
python:
- "3.6" # current default Python on Travis CI

cache:
apt: true # only works with Pro version

# Install the miss_hit linter
before_install:
- pip3 install miss_hit

# Lists all the tasks we will do
jobs:
include:
- name: "miss_hit: checking code quality"
script: mh_metric . --ci
- name: "miss_hit: checking code style"
script: mh_style .

6 changes: 4 additions & 2 deletions initEnv.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% - struct
% - statistics
%
% MATLAB > R2017a
% MATLAB >= R2015b
%
% 2 - Add project to the O/M path

Expand Down Expand Up @@ -58,7 +58,9 @@

% If external dir is empty throw an exception
% and ask user to update submodules.
if numel(dir('lib')) <= 2 % Means that the external is empty
libDirectory = fullfile(fileparts(mfilename('fullpath')), 'lib');

if numel(dir(libDirectory)) <= 2 % Means that the external is empty
error(['Git submodules are not cloned!', ...
'Try this in your terminal:', ...
' git submodule update --recursive ']);
Expand Down
9 changes: 1 addition & 8 deletions subfun/expDesign.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,7 @@

% Set variables here for a dummy test of this function
if nargin < 1 || isempty(cfg)
% cfg.design.motionType = 'translation';
cfg.design.motionType = 'translation';
cfg.design.names = {'static'; 'motion'};
cfg.design.nbRepetitions = 10;
cfg.design.nbEventsPerBlock = 12;
cfg.dot.speedPixPerFrame = 4;
cfg.target.maxNbPerBlock = 1;
displayFigs = 1;
error('give me something to work with')
end

fprintf('\n\nCreating design.\n\n')
Expand Down
25 changes: 25 additions & 0 deletions tests/test_exDesign.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function test_suite = test_exDesign %#ok<*STOUT>
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
test_functions = localfunctions(); %#ok<*NASGU>
catch % no problem; early Matlab versions can use initTestSuite fine
end
initTestSuite;
end

function test_checkCfgDefault()

initEnv();

% cfg.design.motionType = 'translation';
cfg.design.motionType = 'translation';
cfg.design.names = {'static'; 'motion'};
cfg.design.nbRepetitions = 10;
cfg.design.nbEventsPerBlock = 12;
cfg.dot.speedPixPerFrame = 4;
cfg.target.maxNbPerBlock = 1;
displayFigs = 1;

[cfg] = expDesign(cfg, displayFigs)


end