diff --git a/.travis.yml b/.travis.yml index 526353bf..73839af7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ before_script: jobs: include: - name: "BIDS validator: create and check dataset" - script: octave $OCTFLAGS --eval "test_makeRawDataset" && bids-validator `pwd`/output/rawdata/ --ignoreNiftiHeaders + script: octave $OCTFLAGS --eval "test_makeRawDataset" && bids-validator `pwd`/output/raw/ --ignoreNiftiHeaders - name: "miss_hit: checking code quality" script: mh_metric . --ci - name: "miss_hit: checking code style" diff --git a/src/convertSourceToRaw.m b/src/convertSourceToRaw.m index c70854a7..bfc846ba 100644 --- a/src/convertSourceToRaw.m +++ b/src/convertSourceToRaw.m @@ -10,7 +10,7 @@ function convertSourceToRaw(cfg) % Only covers func folder at the moment sourceDir = fullfile(cfg.dir.output, 'source'); - rawDir = fullfile(cfg.dir.output, 'rawdata'); + rawDir = fullfile(cfg.dir.output, 'raw'); % add dummy README and CHANGE file copyfile(fullfile( ... diff --git a/src/createFilename.m b/src/createFilename.m index 6e3f2ab6..5a9a5da7 100644 --- a/src/createFilename.m +++ b/src/createFilename.m @@ -105,7 +105,7 @@ 'echo', ... 'phaseEncodingDirection', ... 'reconstruction', ... - 'recording', ... + 'recording' ... }; targetFields = { ... @@ -114,7 +114,7 @@ 'echo', ... 'dir', ... 'rec', ... - 'recording', ... + 'recording' ... }; for iField = 1:numel(fields2Check) @@ -146,10 +146,10 @@ pattern = cfg.fileName.pattern; runSuffix = cfg.fileName.suffix.run; - acqSuffix = cfg.fileName.suffix.acquisition ; - ceSuffix = cfg.fileName.suffix.contrastEnhancement ; - dirSuffix = cfg.fileName.suffix.phaseEncodingDirection ; - recSuffix = cfg.fileName.suffix.reconstruction ; + acqSuffix = cfg.fileName.suffix.acquisition; + ceSuffix = cfg.fileName.suffix.contrastEnhancement; + dirSuffix = cfg.fileName.suffix.phaseEncodingDirection; + recSuffix = cfg.fileName.suffix.reconstruction; echoSuffix = cfg.fileName.suffix.echo; recordingSuffix = cfg.fileName.suffix.recording; diff --git a/src/checkCppBidsDependencies.m b/src/subfun/checkCppBidsDependencies.m similarity index 93% rename from src/checkCppBidsDependencies.m rename to src/subfun/checkCppBidsDependencies.m index 03dfd92f..dc752114 100644 --- a/src/checkCppBidsDependencies.m +++ b/src/subfun/checkCppBidsDependencies.m @@ -12,7 +12,7 @@ function checkCppBidsDependencies(cfg) elseif isempty(GITHUB_WORKSPACE) % local - pth = fullfile(fileparts(mfilename('fullpath')), '..'); + pth = fullfile(fileparts(mfilename('fullpath')), '..', '..'); checkSubmodule(fullfile(pth, 'lib', 'JSONio')); checkSubmodule(fullfile(pth, 'lib', 'bids-matlab')); diff --git a/src/printCreditsCppBids.m b/src/subfun/printCreditsCppBids.m similarity index 90% rename from src/printCreditsCppBids.m rename to src/subfun/printCreditsCppBids.m index ab1e19d8..5a6f2c95 100644 --- a/src/printCreditsCppBids.m +++ b/src/subfun/printCreditsCppBids.m @@ -1,5 +1,12 @@ function printCreditsCppBids(cfg) + try + version = fileread(fullfile(fileparts(mfilename('fullpath')), ... + '..', '..', 'version.txt')); + catch + version = 'v1.0.0'; + end + verbose = true; if ~isempty(cfg) && isfield(cfg, 'verbose') && ~isempty(cfg.verbose) verbose = cfg.verbose; @@ -7,8 +14,6 @@ function printCreditsCppBids(cfg) if verbose - version = '0.0.1'; - contributors = { ... 'Rémi Gau', ... 'Marco Barilari', ... diff --git a/tests/test_getIsQuestionToAsk.m b/tests/test_getIsQuestionToAsk.m index 3be47593..632668c6 100644 --- a/tests/test_getIsQuestionToAsk.m +++ b/tests/test_getIsQuestionToAsk.m @@ -9,10 +9,10 @@ function test_isPositiveIntegerBasic() questions.questionsToAsk = { ... - [], 1 ; ... - [], 0 ; ... - [], 1 ; ... - [], 0 ; ... + [], 1; ... + [], 0; ... + [], 1; ... + [], 0; ... }; responses = { ... @@ -24,6 +24,6 @@ function test_isPositiveIntegerBasic() isQuestionToAsk = getIsQuestionToAsk(questions, responses); - assertEqual(isQuestionToAsk, [false;false;true;false]); + assertEqual(isQuestionToAsk, [false; false; true; false]); end diff --git a/tests/test_removeDateSuffix.m b/tests/test_removeDateSuffix.m index 13c25e1a..67aa2a43 100644 --- a/tests/test_removeDateSuffix.m +++ b/tests/test_removeDateSuffix.m @@ -23,13 +23,13 @@ function test_removeDateSuffixBasic() stimNameZipped = 'test2_stim_date-202008050730.tsv.gz'; filesToProcess = { ... - boldName ; - boldName2 ; - boldName3 ; - jsonName ; - eventsName ; - stimName ; - stimNameZipped ; + boldName; + boldName2; + boldName3; + jsonName; + eventsName; + stimName; + stimNameZipped; }; % create new files for new tests diff --git a/tests/test_utils.m b/tests/test_utils.m new file mode 100644 index 00000000..d7f4d771 --- /dev/null +++ b/tests/test_utils.m @@ -0,0 +1,17 @@ +function test_suite = test_utils %#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_utilsBasic() + + cfg.verbose = true; + + printCreditsCppBids(cfg); + + checkCppBidsDependencies(cfg); + +end diff --git a/version.txt b/version.txt new file mode 100644 index 00000000..60453e69 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +v1.0.0 \ No newline at end of file