import inspect

import carb
import carb.settings

import omni.kit.app
import omni.kit.test

import omni.kit.app_snippets

class RendererTest(omni.kit.test.AsyncTestCase):
    async def setUp(self):
        self._settings = carb.settings.acquire_settings_interface()
        self._app_snippets = omni.kit.app_snippets.acquire_app_snippets_interface()
        self._app_snippets.startup()

    def __test_name(self) -> str:
        return f"{self.__module__}.{self.__class__.__name__}.{inspect.stack()[2][3]}"

    async def tearDown(self):
        self._app_snippets.shutdown()
        self._app_snippets = None

        self._settings = None

    async def test_0_cpp_snippets(self):

        carb.log_warn("\n\n\ntest 0!!\n\n")
        failed_test_count = self._app_snippets.execute()
        carb.log_warn("failed test count: %d" % (failed_test_count))
        self.assertEqual(0, failed_test_count)
