Skip to content

Commit

Permalink
Absolute paths in test files and adapted test guide
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentheirendt committed May 1, 2017
1 parent 4426a6f commit 6abdc77
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
6 changes: 4 additions & 2 deletions .github/guides/TESTGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ A test template is readily available [here](https://github.com/opencobra/cobrato
#### 2. Test initialization

````Matlab
global CBTDIR
% save the current path
currentDir = pwd;
% initialize the test
cd(fileparts(which(mfilename)));
cd(fileparts(which('fileName')));
````

#### 3. Define the solver packages to be tested and the tolerance
Expand All @@ -93,7 +95,7 @@ solverPkgs = {'tomlab_cplex', 'glpk', 'gurobi6'};

```Matlab
% load the model
load('modelFile.mat', 'model');
load([CBTDIR filesep 'test' filesep 'models' filesep 'testModel.mat'], 'model');
load('testData_functionToBeTested.mat');
```

Expand Down
4 changes: 3 additions & 1 deletion .github/guides/testTemplate.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
% - <major change>: <your name> <date>
%

global CBTDIR

% save the current path
currentDir = pwd;

Expand All @@ -20,7 +22,7 @@
solverPkgs = {'tomlab_cplex', 'glpk', 'gurobi6'};

% load the model
load('modelFile.mat', 'model');
load([CBTDIR filesep 'test' filesep 'models' filesep 'testModel.mat'], 'model');
load('testData_functionToBeTested.mat');

%{
Expand Down
4 changes: 3 additions & 1 deletion test/verifiedTests/testRBioNet/testGPR2Genes.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
% - Stefania Magnusdottir April 2017
%

global CBTDIR

% save the current path
currentDir = pwd;

Expand All @@ -16,7 +18,7 @@
cd(fileDir);

% load E. coli model
load('ecoli_core_model.mat', 'model')
load([CBTDIR filesep 'test' filesep 'models' filesep 'ecoli_core_model.mat'], 'model');

% extract genes from grRules
Genes = GPR2Genes(model.grRules);
Expand Down
4 changes: 3 additions & 1 deletion test/verifiedTests/testRBioNet/testLegalRxnFormula.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
% - Stefania Magnusdottir April 2017
%

global CBTDIR

% save the current path
currentDir = pwd;

Expand All @@ -16,7 +18,7 @@
cd(fileDir);

% load E. coli model
load('ecoli_core_model.mat', 'model')
load([CBTDIR filesep 'test' filesep 'models' filesep 'ecoli_core_model.mat'], 'model');

% check validity of reaction formulas
formula = printRxnFormula(model, model.rxns(1));
Expand Down
4 changes: 3 additions & 1 deletion test/verifiedTests/testRBioNet/testLoadReaction.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
% - Stefania Magnusdottir April 2017
%

global CBTDIR

% save the current path
currentDir = pwd;

Expand All @@ -16,7 +18,7 @@
cd(fileDir);

% load E. coli model
load('ecoli_core_model.mat', 'model')
load([CBTDIR filesep 'test' filesep 'models' filesep 'ecoli_core_model.mat'], 'model');

% load reaction and metabolite databases
load([fileDir, filesep 'metab.mat'])
Expand Down
4 changes: 3 additions & 1 deletion test/verifiedTests/testRBioNet/testModel2data.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
% - Stefania Magnusdottir April 2017
%

global CBTDIR

% save the current path
currentDir = pwd;

Expand All @@ -22,7 +24,7 @@
save([fileDir, filesep 'rBioNetSettingsDB.mat'], 'comp_path', 'met_path', 'rxn_path')

% load E. coli model
load('ecoli_core_model.mat', 'model');
load([CBTDIR filesep 'test' filesep 'models' filesep 'ecoli_core_model.mat'], 'model');
modelEcore = model;

% model to data
Expand Down
6 changes: 4 additions & 2 deletions test/verifiedTests/testRBioNet/testNeighborRxn2data.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
% The COBRAToolbox: testNeighborRxn2data.m
%
% Purpose:
% - testNeighborRxn2data tests the functionality of neighborRxn2data in
% - testNeighborRxn2data tests the functionality of neighborRxn2data in
% the rBioNet extension
%
% Authors:
% - Stefania Magnusdottir April 2017
%

global CBTDIR

% save the current path
currentDir = pwd;

Expand All @@ -16,7 +18,7 @@
cd(fileDir);

% load E. coli model
load('ecoli_core_model.mat', 'model')
load([CBTDIR filesep 'test' filesep 'models' filesep 'ecoli_core_model.mat'], 'model');

% equires EC number field
model.ecNumbers = cell(size(model.rxns));%requires EC number field
Expand Down

0 comments on commit 6abdc77

Please sign in to comment.