Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Dietrich
clang-hash
Commits
0a856287
Commit
0a856287
authored
Mar 17, 2016
by
Christian Dietrich
Browse files
run-test: place .o files correctly
parent
41e3e080
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/clang-hash.cc
View file @
0a856287
...
...
@@ -44,8 +44,9 @@ protected:
std
::
error_code
Error
;
std
::
string
HashFile
=
CI
.
getFrontendOpts
().
OutputFile
+
".hash"
;
Out
=
new
llvm
::
raw_fd_ostream
(
HashFile
,
Error
,
llvm
::
sys
::
fs
::
F_Text
);
errs
()
<<
"dump-ast-file: "
<<
CI
.
getFrontendOpts
().
OutputFile
<<
" "
<<
HashFile
<<
"
\n
"
;
if
(
Error
)
{
errs
()
<<
"Could not open ast-hash file: "
<<
Hash
File
<<
"
\n
"
;
errs
()
<<
"Could not open ast-hash file: "
<<
CI
.
getFrontendOpts
().
Output
File
<<
"
\n
"
;
}
}
return
llvm
::
make_unique
<
HashTranslationUnitConsumer
>
(
Out
);
...
...
test/run-tests
View file @
0a856287
...
...
@@ -178,6 +178,9 @@ def run_testcase_cleaner(basename):
cruftfiles
=
list
()
cruftfiles
.
extend
(
glob
.
glob
(
basename
+
".*.o"
))
cruftfiles
.
extend
(
glob
.
glob
(
basename
+
".*.var.c"
))
cruftfiles
.
extend
(
glob
.
glob
(
basename
+
".*.o.hash"
))
cruftfiles
.
extend
(
glob
.
glob
(
basename
+
".*.o.clang-hash-stderr"
))
for
cruft
in
cruftfiles
:
try
:
os
.
unlink
(
cruft
)
...
...
@@ -261,10 +264,10 @@ def run_testcase_helper(test_case, check_name, future):
failed
=
True
#### Run Clang-Hash
cmd
=
"{cmd} -c {source_file} {flags}"
.
format
(
cmd
=
"{cmd} -c {source_file} -o {object_file} {flags}"
.
format
(
cmd
=
hash_command
,
source_file
=
source_file
,
object_file
=
object_file
,
# Won't be overriden
flags
=
compile_flags
)
(
ret_hasher
,
x
,
_
,
stderr
)
=
run_command
(
cmd
)
if
(
LOGLEVEL
>=
LOGLEVEL_NORMAL
and
ret_hasher
!=
0
)
or
LOGLEVEL
>=
LOGLEVEL_DEBUG
:
...
...
@@ -395,14 +398,16 @@ def get_testcases(paths = ["."]):
if
__name__
==
'__main__'
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"ht:qcv"
)
if
len
(
args
)
==
0
:
args
=
[
"."
]
for
opt
,
arg
in
opts
:
if
opt
in
(
'-c'
,
'--clean'
):
tests
=
get_testcases
()
tests
=
get_testcases
(
args
)
for
test
in
tests
:
basename
,
_
=
os
.
path
.
splitext
(
test
)
run_testcase_cleaner
(
basename
)
sys
.
exit
(
1
)
sys
.
exit
(
0
)
if
opt
in
(
'-t'
,
'--threads'
):
threads
=
int
(
arg
)
if
threads
<
1
:
...
...
@@ -420,8 +425,6 @@ if __name__ == '__main__':
print
"unkown option"
assert
False
if
len
(
args
)
==
0
:
args
=
[
"."
]
ret
=
run_test_suite
(
get_testcases
(
args
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment