Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
be4253a0
Commit
be4253a0
authored
15 years ago
by
Daniel Dunbar
Browse files
Options
Downloads
Patches
Plain Diff
Support running tests using the new 'lit', via 'make test LIT2=1'.
llvm-svn: 81225
parent
c09988dd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clang/test/Makefile
+9
-0
9 additions, 0 deletions
clang/test/Makefile
clang/test/lit.cfg
+83
-1
83 additions, 1 deletion
clang/test/lit.cfg
with
92 additions
and
1 deletion
clang/test/Makefile
+
9
−
0
View file @
be4253a0
...
...
@@ -22,6 +22,14 @@ else
VGARG
=
endif
ifdef
LIT2
all
::
@
echo
'--- Running clang tests for
$(
TARGET_TRIPLE
)
---'
@
$(
LLVM_SRC_ROOT
)
/utils/lit/lit.py
\
--path
$(
ToolDir
)
\
--path
$(
LLVM_SRC_ROOT
)
/test/Scripts
\
$(
TESTARGS
)
$(
TESTDIRS
)
$(
VGARG
)
else
all
::
@
echo
'--- Running clang tests for
$(
TARGET_TRIPLE
)
---'
@
$(
PROJ_SRC_DIR
)
/../utils/test/MultiTestRunner.py
\
...
...
@@ -29,6 +37,7 @@ all::
--path
$(
ToolDir
)
\
--path
$(
LLVM_SRC_ROOT
)
/test/Scripts
\
$(
TESTARGS
)
$(
TESTDIRS
)
$(
VGARG
)
endif
clean
::
@
rm
-rf
Output/
...
...
This diff is collapsed.
Click to expand it.
clang/test/lit.cfg
+
83
−
1
View file @
be4253a0
# -*-
Python -
*
-
def
config_new():
#
Configuration file for the 'lit' test runner.
#
name: The name of this test suite.
config.name
= 'Clang'
#
testFormat: The test format to use to interpret tests.
#
#
For now we require '&&' between commands, until they get globally killed and
#
the test runner updated.
config.test_format
= lit.formats.ShTest(execute_external = True,
require_and_and
= True)
#
suffixes: A list of file extensions to treat as test files.
config.suffixes
= ['.c', '.cpp', '.m', '.mm']
###
#
Discover the 'clang' and 'clangcc' to use.
import
os
def
inferClang(PATH):
#
Determine which clang to use.
clang
= os.getenv('CLANG')
#
If the user set clang in the environment, definitely use that and don't
#
try to validate.
if
clang:
return
clang
#
Otherwise look in the path.
clang
= lit.util.which('clang', PATH)
if
not clang:
lit.fatal("couldn't
find 'clang' program, try setting "
"CLANG
in your environment")
return
clang
def
inferClangCC(clang, PATH):
clangcc
= os.getenv('CLANGCC')
#
If the user set clang in the environment, definitely use that and don't
#
try to validate.
if
clangcc:
return
clangcc
#
Otherwise try adding -cc since we expect to be looking in a build
#
directory.
if
clang.endswith('.exe'):
clangccName
= clang[:-4] + '-cc.exe'
else:
clangccName
= clang + '-cc'
clangcc
= lit.util.which(clangccName, PATH)
if
not clangcc:
#
Otherwise ask clang.
res
= lit.util.capture([clang, '-print-prog-name=clang-cc'])
res
= res.strip()
if
res and os.path.exists(res):
clangcc
= res
if
not clangcc:
lit.fatal("couldn't
find 'clang-cc' program, try setting "
"CLANGCC
in your environment")
return
clangcc
clang
= inferClang(config.environment['PATH'])
if
not lit.quiet:
lit.note('using
clang: %r' % clang)
config.substitutions.append(
(' clang ', ' ' + clang + ' ') )
clang_cc
= inferClangCC(clang, config.environment['PATH'])
if
not lit.quiet:
lit.note('using
clang-cc: %r' % clang_cc)
config.substitutions.append(
(' clang-cc ', ' ' + clang_cc + ' ') )
if
'config' in globals():
config_new()
raise
SystemExit # End configuration.
# Configuration
file for the 'lit' test runner.
# suffixes:
A list of file extensions to treat as test files.
suffixes
= ['.c', '.cpp', '.m', '.mm']
# environment:
The base environment to use when running test commands.
#
#
The 'PATH' and 'SYSTEMROOT' variables will be set automatically from the lit
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment