diff --git a/src/Vector/performance/vector_dist_performance_util.hpp b/src/Vector/performance/vector_dist_performance_util.hpp
index d8ae07f969fb45a61ca1905af31304ab68faf7a7..bbc45d880d4de7405344fd5d51554b0eef3b4141 100644
--- a/src/Vector/performance/vector_dist_performance_util.hpp
+++ b/src/Vector/performance/vector_dist_performance_util.hpp
@@ -1136,7 +1136,8 @@ template<unsigned int dim> void vd_verlet_performance_write_report(openfpm::vect
 		cg.AddLinesGraph(x,y2.get(i),yn2,options2);
 	}
 
-	cg.write("Vect_dist_verlet_perf_" + std::to_string(dim) + "D.html");
+	// Get the directory of the performance test files
+	cg.write(std::string(test_dir) + "/openfpm_pdata/Vect_dist_verlet_perf_" + std::to_string(dim) + "D.html");
 }
 
 
@@ -1299,7 +1300,7 @@ template<unsigned int dim> void vd_cl_performance_write_report(size_t n_moving,o
 		cg.AddLinesGraph(x3,y3.get(k).get(cl_r_cutoff.size()-1),yn3,options3);
 	}
 
-	cg.write("Vect_dist_cl_perf_" + std::to_string(dim) + "D.html");
+	cg.write(std::string(test_dir) + "/openfpm_pdata/Vect_dist_cl_perf_" + std::to_string(dim) + "D.html");
 }
 
 /*! \brief Function for cell list hilb performance report
@@ -1393,7 +1394,7 @@ template<unsigned int dim> void vd_celllist_performance_write_report(openfpm::ve
 		cg.AddLinesGraph(x,y2.get(i),yn2,options2);
 	}
 
-	cg.write("Vect_dist_cl_hilb_perf_" + std::to_string(dim) + "D.html");
+	cg.write(std::string(test_dir) + "/openfpm_pdata/Vect_dist_cl_hilb_perf_" + std::to_string(dim) + "D.html");
 }
 
 #endif /* SRC_VECTOR_VECTOR_DIST_PERFORMANCE_UTIL_HPP_ */
diff --git a/src/unit_test_init_cleanup.hpp b/src/unit_test_init_cleanup.hpp
index 8b103197698c210302024ad6392d557317beed74..96e7743fd623246872f08a08f0871f5bb8526869 100644
--- a/src/unit_test_init_cleanup.hpp
+++ b/src/unit_test_init_cleanup.hpp
@@ -10,9 +10,33 @@
 
 #include "VCluster/VCluster.hpp"
 
-struct ut_start {
-    ut_start()   { BOOST_TEST_MESSAGE("Initialize global VCluster"); openfpm_init(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv); }
-    ~ut_start()  { BOOST_TEST_MESSAGE("Delete global VClster"); openfpm_finalize(); }
+const char * test_dir;
+
+struct ut_start
+{
+	//!
+    ut_start()
+    {
+    	BOOST_TEST_MESSAGE("Initialize global VCluster");
+
+    	openfpm_init(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
+
+#ifdef PERFORMANCE_TEST
+    	test_dir = getenv("OPENFPM_PERFORMANCE_TEST_DIR");
+
+    	if (test_dir == NULL)
+    	{
+    		std::cerr << "Error: " __FILE__ << ":" << __LINE__ << " in order to run the performance test you must set the environment variable $OPENFPM_PERFORMANCE_TEST_DIR to the test or an empty directory";
+    		exit(1);
+    	}
+#endif
+    }
+
+    ~ut_start()
+    {
+    	BOOST_TEST_MESSAGE("Delete global VClster");
+    	openfpm_finalize();
+    }
 };
 
 //____________________________________________________________________________//