Laszlo Nagy | bc68758 | 2016-01-12 22:38:41 +0000 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | # The LLVM Compiler Infrastructure |
| 3 | # |
| 4 | # This file is distributed under the University of Illinois Open Source |
| 5 | # License. See LICENSE.TXT for details. |
| 6 | |
Laszlo Nagy | 258ff25 | 2017-02-14 10:43:38 +0000 | [diff] [blame^] | 7 | import libear |
Laszlo Nagy | bc68758 | 2016-01-12 22:38:41 +0000 | [diff] [blame] | 8 | import libscanbuild.analyze as sut |
Laszlo Nagy | 258ff25 | 2017-02-14 10:43:38 +0000 | [diff] [blame^] | 9 | import unittest |
| 10 | |
| 11 | class ReportDirectoryTest(unittest.TestCase): |
| 12 | |
| 13 | # Test that successive report directory names ascend in lexicographic |
| 14 | # order. This is required so that report directories from two runs of |
| 15 | # scan-build can be easily matched up to compare results. |
| 16 | def test_directory_name_comparison(self): |
| 17 | with libear.TemporaryDirectory() as tmpdir, \ |
| 18 | sut.report_directory(tmpdir, False) as report_dir1, \ |
| 19 | sut.report_directory(tmpdir, False) as report_dir2, \ |
| 20 | sut.report_directory(tmpdir, False) as report_dir3: |
| 21 | self.assertLess(report_dir1, report_dir2) |
| 22 | self.assertLess(report_dir2, report_dir3) |