diff --git a/CI_files/default_test.m b/CI_files/default_test.m new file mode 100644 index 0000000000000000000000000000000000000000..515ad3718e2c3c0b06b6e037da2f6343796055eb --- /dev/null +++ b/CI_files/default_test.m @@ -0,0 +1,66 @@ +function [result] = default_test() +%UNTITLED2 This is a simple test if Plot ID works for the default settings +% Detailed explanation goes here + +clear; clc; close all; +addpath('./fcn_core','./fcn_help'); + +ProjectID = 'Test01'; +%% Data +% some random data +x = linspace(0,7); +y = rand(1,100)+2; +dataset1 = 'test_data.mat'; +save('CI_files/test_data.mat','x','y'); +% some data as .h5 +x1 = linspace(0,2*pi); +y1 = sin(x1)+2; + +% define file path & name +fpath = "CI_files/testdata_2.h5"; +dataset2 = 'testdata_2.h5'; + +% create hdf5 file and dataset > write data to hdf5 file / dataset +h5create(fpath, "/x1", size(x1), "Datatype", class(x1)) +h5create(fpath, "/y1", size(y1), "Datatype", class(y1)) +h5write(fpath, "/x1", x1) +h5write(fpath, "/y1", y1) + +%% Plotting + +fig(1) =figure('visible','off'); +plot(x,y,'-k'); +hold on +plot(x1,y1,'-r'); + +%% Tag the plot +try + [figs, ID] = TagPlot(fig, ProjectID); + + %% call a dummy function + a=1; + a = example_fcn(a); + + %% publishing + + % The functions needs the file location, the location of the data and the + % figure + path.script = mfilename('fullpath'); % filename of the m.script + + % file name of the data + path.rdata = {dataset1,dataset2} ; % don't forget the extension + + Publish(path, ID, figs, 'Location', 'CI-Test') + + % clean up + delete CI_files/export/* CI_files/*.mat CI_files/*.h5 + rmdir('CI_files/export','s'); + result = true; + clc; +catch + result = false; + warning('simple_test failed'); +end + +end + diff --git a/example.m b/example.m index a489c7a00d2bdf82e90f031d0199faf56b854c1b..9686cb452b91b082b8612c709ade0d9f2b11196e 100644 --- a/example.m +++ b/example.m @@ -1,6 +1,7 @@ % test skript clear; clc; close all; addpath('fcn_core','fcn_help'); +addpath('CI_files'); % Test scripts try delete testdata_2.h5; diff --git a/fcn_core/Publish.m b/fcn_core/Publish.m index 9c2fc18e55957f56eda85f32161b115bf063c21b..6ab522b164e79cab7c6cc442047f9587a5c6ad4e 100644 --- a/fcn_core/Publish.m +++ b/fcn_core/Publish.m @@ -11,7 +11,7 @@ arguments DataPaths ID (1,:) {mustBeNonzeroLengthText} % ID must be provided figures (1,:) {mustBeFigure} % Checks if Figures are figures - options.Location {mustBeMember(options.Location ,['local','server'])} = 'local' % storage path + options.Location {mustBeMember(options.Location ,['local','server','CI-Test'])} = 'local' % storage path options.Method {mustBeMember(options.Method ,['individual','centraliced'])} = 'individual' options.CopyUserFCN (1,1) {mustBeNumericOrLogical} = true end @@ -20,7 +20,9 @@ switch options.Location case 'local' storPath = fullfile(pwd,'export'); case 'server' - storPath = '\\FST-220\Jans-50GB-SMB\Lemmer'; + storPath = '\\FST-220\Jans-50GB-SMB\Lemmer'; + case 'CI-Test' + storPath = fullfile(pwd,'CI_files','export'); end folderName = char(ID); diff --git a/test_data.mat b/test_data.mat index 6f6642858ca39fe4ad4f41979dcdcca3b30b4877..33fbe1ef1a97e81ad944afeb8bcf68356d7d626a 100644 Binary files a/test_data.mat and b/test_data.mat differ