Skip to content

Commit 6d4711c

Browse files
committed
Add missing external tests directory
Try pinning lief Disable cleanup step Try removing some default setup-miniconda options
1 parent 80ffea7 commit 6d4711c

File tree

4 files changed

+72
-14
lines changed

4 files changed

+72
-14
lines changed

.github/workflows/conda_recipe.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ jobs:
3838
auto-update-conda: true
3939
channels: conda-forge
4040
channel-priority: strict
41-
miniforge-version: latest
41+
# miniforge-version: latest
4242
use-mamba: true
43-
mamba-version: "1.5.10"
43+
# mamba-version: "1.5.10"
4444
conda-remove-defaults: true
4545
- name: Install conda-build
4646
run: |
4747
mamba info
4848
mamba list
49-
mamba install conda-build -y
49+
mamba install conda-build py-lief=0.14 -y
5050
- name: Check mamba installation
5151
run: |
5252
mamba info

.github/workflows/test-suite.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ jobs:
103103
with-asan: true
104104
fail-fast: false
105105
steps:
106-
- name: Clean up unused software (Ubuntu)
107-
uses: easimon/maximize-build-space@master
108-
if: matrix.os == 'ubuntu-latest'
109-
with:
110-
remove-dotnet: 'true'
111-
remove-android: 'true'
112-
remove-haskell: 'true'
113-
remove-codeql: 'true'
114-
remove-docker-images: 'true'
106+
# - name: Clean up unused software (Ubuntu)
107+
# uses: easimon/maximize-build-space@master
108+
# if: matrix.os == 'ubuntu-latest'
109+
# with:
110+
# remove-dotnet: 'true'
111+
# remove-android: 'true'
112+
# remove-haskell: 'true'
113+
# remove-codeql: 'true'
114+
# remove-docker-images: 'true'
115115
- name: Check out repository code
116116
uses: actions/checkout@v4
117117
with:
@@ -145,9 +145,9 @@ jobs:
145145
auto-update-conda: true
146146
channels: conda-forge
147147
channel-priority: strict
148-
miniforge-version: latest
148+
# miniforge-version: latest
149149
use-mamba: true
150-
mamba-version: "1.5.10"
150+
# mamba-version: "1.5.10"
151151
conda-remove-defaults: true
152152
- name: Set USERPROFILE
153153
if: matrix.os == 'windows-latest'

tests/external/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
3+
project(ePhotosynthesisExample LANGUAGES CXX)
4+
set(CMAKE_CXX_STANDARD 14)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
7+
add_executable(example example.cpp)
8+
9+
find_package(ePhotosynthesis REQUIRED)
10+
11+
target_link_libraries(example PUBLIC ePhotosynthesis::EPhotosynthesis)

tests/external/example.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include "ePhotosynthesis.hpp"
2+
3+
4+
using namespace ePhotosynthesis;
5+
6+
int main(int argc, const char* argv[]) {
7+
try {
8+
double stoptime = 5000.0, begintime = 0.0, stepsize = 1.0;
9+
double abstol = 1e-5, reltol = 1e-4;
10+
int maxSubSteps = 750, RUBISCOMETHOD = 2;
11+
12+
std::map<std::string, std::string> inputs;
13+
Variables *theVars = new Variables();
14+
15+
// Read files
16+
theVars->readParam("data/InputEvn.txt", inputs);
17+
theVars->readParam("data/InputATPCost.txt", inputs);
18+
theVars->readEnzymeAct("data/InputEnzyme.txt");
19+
theVars->readGRN("data/InputGRNC.txt");
20+
21+
double Tp = theVars->Tp;
22+
theVars->record = false;
23+
theVars->useC3 = true;
24+
theVars->RUBISCOMETHOD = RUBISCOMETHOD;
25+
modules::PR::setRUBISCOTOTAL(3);
26+
27+
drivers::Driver *maindriver = new drivers::EPSDriver(
28+
theVars, begintime, stepsize, stoptime,
29+
maxSubSteps, abstol, reltol, 1, 1, Tp);
30+
31+
std::vector<double> ResultRate = maindriver->run();
32+
33+
std::ofstream outfile("example_output.data");
34+
outfile << ResultRate[0] << std::endl;
35+
outfile.close();
36+
37+
if (theVars != nullptr) {
38+
maindriver->inputVars = nullptr;
39+
delete theVars;
40+
}
41+
delete maindriver;
42+
return (EXIT_SUCCESS);
43+
} catch (std::exception& e) {
44+
std::cout << "An error occurred: " << e.what() << std:: endl;
45+
exit(EXIT_FAILURE);
46+
}
47+
}

0 commit comments

Comments
 (0)