From 1248546684bb6a6de3329d5a92f9d117a622b255 Mon Sep 17 00:00:00 2001 From: Loic Marx Date: Mon, 27 May 2019 10:43:58 +0200 Subject: [PATCH] add provenance note to function in base --- test/base/clearGlobal.m | 5 +++++ test/base/getEnvironment.m | 6 ++++++ test/base/getFilesInDir.m | 6 ++++++ test/base/getGlobalValue.m | 6 ++++++ test/base/getIgnoredFiles.m | 8 +++++++- test/base/restoreEnvironment.m | 7 ++++++- test/base/runScriptFile.m | 6 ++++++ test/base/runTestSuite.m | 6 ++++++ test/base/setGlobal.m | 8 +++++++- 9 files changed, 55 insertions(+), 3 deletions(-) diff --git a/test/base/clearGlobal.m b/test/base/clearGlobal.m index 5240fce..75a273d 100644 --- a/test/base/clearGlobal.m +++ b/test/base/clearGlobal.m @@ -6,6 +6,11 @@ function clearGlobal(globalName) % % INPUTS: % globalName: The name of the global variable to clear. +% +% NOTE: +% this function has been uploaded from +% https://github.com/opencobra/cobratoolbox/blob/master/src/base/utilities/clearGlobal.m +% [e6b4efd] clearvars('-global',globalName); end \ No newline at end of file diff --git a/test/base/getEnvironment.m b/test/base/getEnvironment.m index 1ee5fe0..525dab0 100644 --- a/test/base/getEnvironment.m +++ b/test/base/getEnvironment.m @@ -7,6 +7,12 @@ % environment: a struct with two fields % * .globals - contains all global values % * .path - contains the current path +% +% NOTE: +% this function has been uploaded from +% https://github.com/opencobra/cobratoolbox/blob/master/src/base/utilities/getEnvironment.m +% [cadfa58] + environment = struct(); globals = struct(); globalvars = who('global'); diff --git a/test/base/getFilesInDir.m b/test/base/getFilesInDir.m index 220940e..3b5e399 100644 --- a/test/base/getFilesInDir.m +++ b/test/base/getFilesInDir.m @@ -43,6 +43,12 @@ % % % get only the gitIgnored files in the current folder % files = getFilesInDir('type', 'ignored'); +% +% NOTE: +% this function has been uploaded from +% https://github.com/opencobra/cobratoolbox/blob/master/src/base/install/getFilesInDir.m +% [cdb2478] + persistent COBRAIgnored diff --git a/test/base/getGlobalValue.m b/test/base/getGlobalValue.m index 9c8c879..cabc519 100644 --- a/test/base/getGlobalValue.m +++ b/test/base/getGlobalValue.m @@ -9,6 +9,12 @@ % % OUTPUT: % value: The value of the requested global variable +% +% NOTE: +% this function has been uploaded from +% https://github.com/opencobra/cobratoolbox/blob/master/src/base/utilities/getGlobalValue.m +% [e6b4efd] + eval(['global ' globalName]); eval(['value = ' globalName ';']); diff --git a/test/base/getIgnoredFiles.m b/test/base/getIgnoredFiles.m index 412fa40..18c9345 100644 --- a/test/base/getIgnoredFiles.m +++ b/test/base/getIgnoredFiles.m @@ -14,8 +14,14 @@ % ignoredFiles: All files (and patterns) indicated as ignored in % the gitignore file. % -% .. Authors: - Original Code: Laurent Heirandt +% .. Authors: - Original Code: Laurent Heirendt % - Move to function: Thomas Pfau, Jan 2018 +% +% NOTE: +% this function has been adapted from +% https://github.com/opencobra/cobratoolbox/blob/master/src/base/install/getIgnoredFiles.m +% [f9a9213] + global CELLFIEDIR diff --git a/test/base/restoreEnvironment.m b/test/base/restoreEnvironment.m index 95db5e4..a9184b4 100644 --- a/test/base/restoreEnvironment.m +++ b/test/base/restoreEnvironment.m @@ -12,7 +12,12 @@ function restoreEnvironment(environment, restorePath, printLevel) % printLevel: Set the verbosity of this method: % * 0: No outputs (Default) % * 1: Info what each value is set to -% +% +% NOTE: +% this function has been adapted from +% https://github.com/opencobra/cobratoolbox/blob/master/src/base/utilities/restoreEnvironment.m +% [005f7d1] + if ~exist('restorePath','var') restorePath = true; end diff --git a/test/base/runScriptFile.m b/test/base/runScriptFile.m index 93d6fff..b817502 100644 --- a/test/base/runScriptFile.m +++ b/test/base/runScriptFile.m @@ -17,6 +17,12 @@ % - `.Error`: Error message received from a failed or skipped test % % .. Author: - Thomas Pfau Jan 2018. +% +% NOTE: +% this function has been adapted from +% https://github.com/opencobra/cobratoolbox/blob/master/test/runScriptFile.m +% [b58da0c] + global CBT_MISSING_REQUIREMENTS_ERROR_ID diff --git a/test/base/runTestSuite.m b/test/base/runTestSuite.m index 9e9d420..c8cc325 100644 --- a/test/base/runTestSuite.m +++ b/test/base/runTestSuite.m @@ -24,6 +24,12 @@ % % Author: % - Thomas Pfau Jan 2018. +% +% NOTE: +% this function has been adapted from +% https://github.com/opencobra/cobratoolbox/blob/master/test/runTestSuite.m +% [5395578] + global CELLFIEDIR diff --git a/test/base/setGlobal.m b/test/base/setGlobal.m index d2d1493..2bd7dae 100644 --- a/test/base/setGlobal.m +++ b/test/base/setGlobal.m @@ -6,7 +6,13 @@ function setGlobal(globalName,globalValue) % % INPUTS: % globalName: A string representing the name of the global variable -% globalValue: The value to set the global variable to +% globalValue: The value to set the global variable +% +% NOTE: +% this function has been adapted from +% https://github.com/opencobra/cobratoolbox/blob/master/src/base/utilities/setGlobal.m +% [e6b4efd] + eval([ globalName '_val = globalValue;']); eval(['global ' globalName]);