Skip to content
Snippets Groups Projects
Commit 11386413 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Add a test for inclusion outputs to pipeline

parent fe344582
No related branches found
No related tags found
No related merge requests found
......@@ -198,6 +198,10 @@ sanity_stage:
- valgrind --leak-check=full --log-file=valgrind.log ./test_cluster_outputs
- grep "0 errors from 0 contexts" valgrind.log
- rm -rf c_OCLU_24
- chmod +x test_inclusion_outputs
- rm valgrind.log
- valgrind --leak-check=full --log-file=valgrind.log ./test_inclusion_outputs
- grep "0 errors from 0 contexts" valgrind.log
running_stage:
stage: run
......
......@@ -29,8 +29,8 @@ NP_SPHERE_BINS=sphere/np_sphere
NP_TRAPPING_SRCS=../src/trapping/np_trapping.cpp ../src/trapping/cfrfme.cpp ../src/trapping/clffft.cpp
NP_TRAPPING_OBJS=../src/trapping/np_trapping.o ../src/trapping/cfrfme.o ../src/trapping/clffft.o
NP_TRAPPING_BINS=trapping/np_trapping
NP_TESTING_OBJS=../src/testing/test_cluster_outputs.o ../src/testing/test_ParticleDescriptor.o ../src/testing/test_TEDF.o ../src/testing/test_TTMS.o
NP_TESTING_BINS=testing/test_cluster_outputs testing/test_ParticleDescriptor testing/test_TEDF testing/test_TTMS
NP_TESTING_OBJS=../src/testing/test_cluster_outputs.o ../src/testing/test_inclusion_outputs.o ../src/testing/test_ParticleDescriptor.o ../src/testing/test_TEDF.o ../src/testing/test_TTMS.o
NP_TESTING_BINS=testing/test_cluster_outputs testing/test_inclusion_outputs testing/test_ParticleDescriptor testing/test_TEDF testing/test_TTMS
all: $(NPTM_LIB) $(FORTRAN_BINS) $(NP_CLUSTER_BINS) $(NP_INCLUSION_BINS) $(NP_SPHERE_BINS) $(NP_TRAPPING_BINS) $(NP_TESTING_BINS)
......@@ -86,6 +86,9 @@ testing/test_ParticleDescriptor: $(NPTM_LIB) ../src/testing/test_ParticleDescrip
testing/test_cluster_outputs: $(NPTM_LIB) ../src/testing/test_cluster_outputs.o
$(CXX) $(CXXFLAGS) ../src/testing/test_cluster_outputs.o -o $@ $(CXXLDFLAGS)
testing/test_inclusion_outputs: $(NPTM_LIB) ../src/testing/test_inclusion_outputs.o
$(CXX) $(CXXFLAGS) ../src/testing/test_inclusion_outputs.o -o $@ $(CXXLDFLAGS)
testing/test_TEDF: $(NPTM_LIB) ../src/testing/test_TEDF.o
$(CXX) $(CXXFLAGS) ../src/testing/test_TEDF.o -o $@ $(CXXLDFLAGS)
......
#include <string>
#ifndef INCLUDE_TYPES_H_
#include "../include/types.h"
#endif
#ifndef INCLUDE_ERRORS_H_
#include "../include/errors.h"
#endif
#ifndef INCLUDE_CONFIGURATION_H_
#include "../include/Configuration.h"
#endif
#ifndef INCLUDE_COMMONS_H_
#include "../include/Commons.h"
#endif
#ifndef INCLUDE_OUTPUTS_H_
#include "../include/outputs.h"
#endif
using namespace std;
int test_inclusion_hdf5_output();
int test_inclusion_devel();
int main() {
int result = 0;
// result += test_inclusion_hdf5_output(); // 1 if failed
result += test_inclusion_devel(); // 10 if failed
return result;
}
int test_inclusion_hdf5_output() {
int result = 0;
/*
try {
const string hdf5_file = "../../test_data/cluster/c_OCLU_24.hd5";
ClusterOutputInfo *oi = new ClusterOutputInfo(hdf5_file);
oi->write("c_OCLU_24", "LEGACY");
delete oi;
} catch (const exception& ex) {
result = 1;
}
*/
return result;
}
int test_inclusion_devel() {
int result = 0;
try {
const string geom_data_file = "../../test_data/inclusion/DINCLU";
const string scat_data_file = "../../test_data/inclusion/DEDFB";
mixMPI *mpidata = new mixMPI();
GeometryConfiguration *gconf = GeometryConfiguration::from_legacy(geom_data_file);
ScattererConfiguration *sconf = ScattererConfiguration::from_dedfb(scat_data_file);
InclusionOutputInfo *oi = new InclusionOutputInfo(sconf, gconf, mpidata);
delete gconf;
delete sconf;
delete oi;
delete mpidata;
} catch (const exception& ex) {
result = 10;
}
return result;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment