*
*/
+#if defined(ENABLE_TEST)
+#define APP_VALIDATE
+#endif
+
#include <climits>
#include <cmath>
#include <fstream>
#include <stdlib.h>
#include <time.h>
-#if defined(__TIZEN__)
+#if defined(APP_VALIDATE)
#include <gtest/gtest.h>
#endif
return ML_ERROR_NONE;
}
-#if defined(__TIZEN__)
+#if defined(APP_VALIDATE)
TEST(MNIST_training, verify_accuracy) {
EXPECT_FLOAT_EQ(training_loss, 2.0374029);
}
NN.readModel();
NN.setDataBuffer((DB));
-#if defined(__TIZEN__)
+#if defined(APP_VALIDATE)
status = NN.setProperty({"epochs=5"});
if (status != ML_ERROR_NONE) {
std::cerr << "Error setting the number of epochs" << std::endl;
return 0;
}
-#if defined(__TIZEN__)
+#if defined(APP_VALIDATE)
try {
testing::InitGoogleTest(&argc, argv);
} catch (...) {
*
*/
+#if defined(__TIZEN__) && defined(ENABLE_TEST)
+#define APP_VALIDATE
+#endif
+
#include <limits.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#if defined(__TIZEN__)
-#include <gtest/gtest.h>
-
#include <nnstreamer-single.h>
#include <nnstreamer.h>
#include <nntrainer_internal.h>
#include <iostream>
#endif
+#if defined(APP_VALIDATE)
+#include <gtest/gtest.h>
+#endif
+
#include "bitmap_helpers.h"
#include <nntrainer.h>
float inputVector[EPOCH_SIZE][INPUT_SIZE];
float labelVector[EPOCH_SIZE][LABEL_SIZE];
+#if defined(APP_VALIDATE)
/** Benchmark output values */
const float test_output_benchmark[TOTAL_TEST_SIZE] = {
0.99669778, 0.96033746, 0.99192446, 0.98053128,
0.95911789, 0.99331927, 0.55696899, 0.46636438};
+#endif
/** Container to hold the output values when running */
float test_output[TOTAL_TEST_SIZE];
#endif
}
-#if defined(__TIZEN__)
+#if defined(APP_VALIDATE)
/**
* @brief Test to verify that the draw classification app is successful
*/
set_feature_state(NOT_CHECKED_YET);
#endif
-#if defined(__TIZEN__)
+#if defined(APP_VALIDATE)
try {
testing::InitGoogleTest(&argc, argv);
} catch (...) {
add_project_arguments('-D__LOGGING__=1', language:['c','cpp'])
endif
+if get_option('enable-test')
+ add_project_arguments('-DENABLE_TEST=1', language:['c','cpp'])
+endif
+
libm_dep = cxx.find_library('m') # cmath library
libdl_dep = cxx.find_library('dl') # DL library
thread_dep = dependency('threads') # pthread for tensorflow-lite
cp ../Applications/MNIST/jni/mnist_trainingSet.dat .
MNIST_APP=Applications/MNIST
./${MNIST_APP}/jni/nntrainer_mnist ../${MNIST_APP}/res/mnist.ini
-
popd
# unittest for nntrainer plugin for nnstreamer