Skip to content
Snippets Groups Projects
Commit a9315d69 authored by Lemmer, Jan's avatar Lemmer, Jan
Browse files

add a test fcn fo default settings

parent 231c563c
Branches
No related tags found
3 merge requests!13PreRelease_V0.1,!12PreRelease_V0.1,!1Add Link-replacement feature
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
% test skript % test skript
clear; clc; close all; clear; clc; close all;
addpath('fcn_core','fcn_help'); addpath('fcn_core','fcn_help');
addpath('CI_files'); % Test scripts
try try
delete testdata_2.h5; delete testdata_2.h5;
......
...@@ -11,7 +11,7 @@ arguments ...@@ -11,7 +11,7 @@ arguments
DataPaths DataPaths
ID (1,:) {mustBeNonzeroLengthText} % ID must be provided ID (1,:) {mustBeNonzeroLengthText} % ID must be provided
figures (1,:) {mustBeFigure} % Checks if Figures are figures 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.Method {mustBeMember(options.Method ,['individual','centraliced'])} = 'individual'
options.CopyUserFCN (1,1) {mustBeNumericOrLogical} = true options.CopyUserFCN (1,1) {mustBeNumericOrLogical} = true
end end
...@@ -20,7 +20,9 @@ switch options.Location ...@@ -20,7 +20,9 @@ switch options.Location
case 'local' case 'local'
storPath = fullfile(pwd,'export'); storPath = fullfile(pwd,'export');
case 'server' 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 end
folderName = char(ID); folderName = char(ID);
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment