[AMDGPU] Parse wwm filter flag for regalloc fast (#119347)
[llvm-project.git] / clang / tools / scan-build-py / tests / unit / test_libear.py
blob22e8c2afb9d9ae545e24f977ab4b0c7226823f93
1 # -*- coding: utf-8 -*-
2 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3 # See https://llvm.org/LICENSE.txt for license information.
4 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 import libear as sut
7 import unittest
8 import os.path
11 class TemporaryDirectoryTest(unittest.TestCase):
12 def test_creates_directory(self):
13 dirname = None
14 with sut.TemporaryDirectory() as tmpdir:
15 self.assertTrue(os.path.isdir(tmpdir))
16 dirname = tmpdir
17 self.assertIsNotNone(dirname)
18 self.assertFalse(os.path.exists(dirname))
20 def test_removes_directory_when_exception(self):
21 dirname = None
22 try:
23 with sut.TemporaryDirectory() as tmpdir:
24 self.assertTrue(os.path.isdir(tmpdir))
25 dirname = tmpdir
26 raise RuntimeError("message")
27 except:
28 self.assertIsNotNone(dirname)
29 self.assertFalse(os.path.exists(dirname))