forked from ssciwr/clang-tidy-wheel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ensure that clang-tidy binary file exists and is executable * run clang-tidy on a very simple C++ file Fixes #1
- Loading branch information
1 parent
6ae0b72
commit ac1c55e
Showing
4 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import os | ||
import tempfile | ||
|
||
import clang_tidy | ||
|
||
|
||
def test_executable_file(): | ||
exe = clang_tidy._get_executable("clang-tidy") | ||
assert os.path.exists(exe), "'clang-tidy' executable is missing" | ||
assert os.access(exe, os.X_OK), "'clang-tidy'program is not executable" | ||
|
||
|
||
def test_include_iostream(): | ||
fd, compilation_unit = tempfile.mkstemp(suffix=".cpp") | ||
os.close(fd) | ||
with open(compilation_unit, "w") as ostr: | ||
ostr.write("#include <iostream>\n") | ||
try: | ||
assert clang_tidy._run("clang-tidy", compilation_unit) == 0 | ||
finally: | ||
os.remove(compilation_unit) |