Skip to content

[ISSUE-404] Create New Conditional Compilation Switch for Testing #774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: HaripriyaDevelopment
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ if(NOT GPROF)
set(GPROF NO)
endif()

#CONDITIONAL FLAG to turn on TESTING_MODE
if(NOT TESTING_MODE)
set(TESTING_MODE YES)
endif()

#Creates the Graphitti project with the correct languages, depending on if using GPU or not
#If using CUDA, also verify the CUDA package and set the required CUDA variables
if(ENABLE_CUDA)
Expand Down Expand Up @@ -72,6 +77,11 @@ if(GPROF)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
endif()

if(TESTING_MODE)
message("-- Setting TESTING_MODE: ON")
add_definitions(-DTESTING_MODE)
endif()

#HDF5 Support, finds HDF5 package for C and C++ and links the hdf5 libraries to the executable \
# later in the file.
find_package(HDF5 COMPONENTS C CXX)
Expand Down
4 changes: 4 additions & 0 deletions Simulator/Core/Graphitti_Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ using namespace std;
/// @return -1 if error, else 0 if success.
int main(int argc, char *argv[])
{
#ifdef TESTING_MODE
cout << "Testing mode is ON \n";
#endif

// Clear logging files at the start of each simulation
fstream("Output/Debug/logging.txt", ios::out | ios::trunc);
fstream("Output/Debug/vertices.txt", ios::out | ios::trunc);
Expand Down
Loading