21 #include <boost/filesystem/operations.hpp> 22 #include <gtest/gtest.h> 24 TEST(UnitTestEnvironment, testSDK)
26 std::system(
"python2 /opt/movidius/NCSDK/tests/api-check/ncs-python2-check.py > /tmp/NCS_unittest.txt");
27 EXPECT_TRUE(boost::filesystem::exists(
"/tmp/NCS_unittest.txt"));
28 std::ifstream fin(
"/tmp/NCS_unittest.txt");
29 std::string ncs_check, tmp;
30 while (std::getline(fin, tmp))
34 EXPECT_EQ(ncs_check,
"NCS device working.");
35 std::system(
"rm -rf /tmp/NCS_unittest.txt > /dev/null 2>&1");
38 TEST(UnitTestEnvironment, testAppZoo)
40 EXPECT_TRUE(boost::filesystem::exists(
"/opt/movidius/ncappzoo"));
41 std::system(
"cd /opt/movidius/ncappzoo && make > /dev/null 2>&1");
42 std::vector<std::string> caffe_dirs = {
"AlexNet",
"GoogLeNet",
"SqueezeNet",
"SSD_MobileNet",
"TinyYolo" };
43 std::vector<std::string> tf_dirs = {
"inception_v1",
"inception_v2",
"inception_v3",
"inception_v4",
"mobilenets" };
44 for (std::string caffe : caffe_dirs)
46 EXPECT_TRUE(boost::filesystem::exists(
"/opt/movidius/ncappzoo/caffe/" + caffe +
"/graph"));
49 for (std::string tf : tf_dirs)
51 EXPECT_TRUE(boost::filesystem::exists(
"/opt/movidius/ncappzoo/tensorflow/" + tf +
"/graph"));
55 TEST(UnitTestEnvironment, testCategories)
57 EXPECT_TRUE(boost::filesystem::exists(
"/opt/movidius/ncappzoo/data/ilsvrc12/imagenet1000.txt"));
58 EXPECT_TRUE(boost::filesystem::exists(
"/opt/movidius/ncappzoo/data/ilsvrc12/imagenet1001.txt"));
59 EXPECT_TRUE(boost::filesystem::exists(
"/opt/movidius/ncappzoo/data/ilsvrc12/voc20.txt"));
60 EXPECT_TRUE(boost::filesystem::exists(
"/opt/movidius/ncappzoo/data/ilsvrc12/voc21.txt"));
63 int main(
int argc,
char** argv)
65 testing::InitGoogleTest(&argc, argv);
66 return RUN_ALL_TESTS();
TEST(UnitTestEnvironment, testSDK)
int main(int argc, char **argv)