/* Binaries directory */
#define BINARY_FOLDER "${PROJECT_BINARY_DIR}"
+/* This is an absolute path so that we can run test from any build
+ * directory */
+#define ABS_TEST_DATA_DIR "${PROJECT_SOURCE_DIR}/src/caffe/test/test_data/"
+
/* Test device */
#define CUDA_TEST_DEVICE ${CUDA_TEST_DEVICE}
-
-/* Temporary (TODO: remove) */
-#if 1
- #define CMAKE_SOURCE_DIR SOURCE_FOLDER "/src/"
- #define EXAMPLES_SOURCE_DIR BINARY_FOLDER "/examples/"
- #define CMAKE_EXT ".gen.cmake"
-#else
- #define CMAKE_SOURCE_DIR "src/"
- #define EXAMPLES_SOURCE_DIR "examples/"
- #define CMAKE_EXT ""
-#endif
#include "caffe_config.h"
#else
#define CUDA_TEST_DEVICE -1
- #define CMAKE_SOURCE_DIR "src/"
#define EXAMPLES_SOURCE_DIR "examples/"
- #define CMAKE_EXT ""
+ #define ABS_TEST_DATA_DIR "src/caffe/test/test_data"
#endif
int main(int argc, char** argv);
seed_(1701), num_(4), channels_(3), height_(10), width_(10),
share_(false) {
input_file_ = new string(
- CMAKE_SOURCE_DIR "caffe/test/test_data/solver_data_list.txt" CMAKE_EXT);
+ ABS_TEST_DATA_DIR "/solver_data_list.txt");
}
~GradientBasedSolverTest() {
delete input_file_;
protected:
HDF5OutputLayerTest()
- : input_file_name_(
- CMAKE_SOURCE_DIR "caffe/test/test_data/sample_data.h5"),
+ : input_file_name_(ABS_TEST_DATA_DIR "/sample_data.h5"),
blob_data_(new Blob<Dtype>()),
blob_label_(new Blob<Dtype>()),
num_(5),
blob_top_vec_.push_back(blob_top_label2_);
// Check out generate_sample_data.py in the same directory.
- filename = new string(
- CMAKE_SOURCE_DIR "caffe/test/test_data/sample_data_list.txt" CMAKE_EXT);
+ filename = new string(ABS_TEST_DATA_DIR "/sample_data_list.txt");
LOG(INFO)<< "Using sample HDF5 data file " << filename;
}