tc: Make tpl-test backend choosable 45/163845/4
authorHoyub Lee <hoyub.lee@samsung.com>
Wed, 13 Dec 2017 12:28:16 +0000 (21:28 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 14 Dec 2017 04:27:18 +0000 (04:27 +0000)
Change-Id: I2bac7c16fa4087edf1930e1cde14971af9fe149f
Signed-off-by: Hoyub Lee <hoyub.lee@samsung.com>
tc/src/main.cpp

index 25bb681..fa0afd3 100644 (file)
@@ -107,7 +107,19 @@ main(int argc, char **argv)
        TPLTestBase::config = tpl_test_parse_arguments(argc, argv);
 
        // Initialize backend
-       TPLTestBase::backend = new TPLWayland();
+       switch(TPLTestBase::config.backend) {
+       case TPL_BACKEND_WAYLAND:
+       case TPL_BACKEND_WAYLAND_THREAD:
+               TPLTestBase::backend = new TPLWayland();
+               break;
+       case TPL_BACKEND_TBM:
+               // TODO
+               break;
+       default:
+               printf("config is not set correctly.\n");
+               printf("Exit program now.\n");
+               return -1;
+       }
 
        ::testing::InitGoogleTest(&argc, argv);
        return RUN_ALL_TESTS();