Skip to content

Use cmake to find perl executable #91275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,8 @@ endif()


if( CLANG_INCLUDE_TESTS )
find_package(Perl)

add_subdirectory(unittests)
list(APPEND CLANG_TEST_DEPS ClangUnitTests)
list(APPEND CLANG_TEST_PARAMS
Expand Down
1 change: 0 additions & 1 deletion clang/test/Analysis/scan-build/deduplication.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// FIXME: Actually, "perl".
REQUIRES: shell

RUN: rm -rf %t.output_dir && mkdir %t.output_dir
Expand Down
3 changes: 0 additions & 3 deletions clang/test/Analysis/scan-build/exclude_directories.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME: Actually, "perl".
REQUIRES: shell

RUN: rm -rf %t.output_dir && mkdir %t.output_dir
RUN: %scan-build -o %t.output_dir %clang -S \
RUN: %S/Inputs/multidirectory_project/directory1/file1.c \
Expand Down
3 changes: 0 additions & 3 deletions clang/test/Analysis/scan-build/help.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME: Actually, "perl".
REQUIRES: shell

RUN: %scan-build -h | FileCheck %s
RUN: %scan-build --help | FileCheck %s

Expand Down
1 change: 0 additions & 1 deletion clang/test/Analysis/scan-build/html_output.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// FIXME: Actually, "perl".
REQUIRES: shell

RUN: rm -rf %t.output_dir && mkdir %t.output_dir
Expand Down
13 changes: 8 additions & 5 deletions clang/test/Analysis/scan-build/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- Python -*-

import lit.util
import lit.formats
import os
import platform

use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL")
config.test_format = lit.formats.ShTest(use_lit_shell == "0")
Expand All @@ -12,13 +12,16 @@ clang_path = config.clang if config.have_llvm_driver else os.path.realpath(confi
config.substitutions.append(
(
"%scan-build",
"'%s' --use-analyzer=%s "
"'%s' '%s' --use-analyzer=%s "
% (
lit.util.which(
"scan-build",
os.path.join(config.clang_src_dir, "tools", "scan-build", "bin"),
config.perl_executable,
os.path.join(
config.clang_src_dir, "tools", "scan-build", "bin", "scan-build"
),
clang_path,
),
)
)

if not config.perl_executable or platform.system() == "Windows":
config.unsupported = True
1 change: 0 additions & 1 deletion clang/test/Analysis/scan-build/plist_html_output.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// FIXME: Actually, "perl".
REQUIRES: shell

RUN: rm -rf %t.output_dir && mkdir %t.output_dir
Expand Down
1 change: 0 additions & 1 deletion clang/test/Analysis/scan-build/plist_output.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// FIXME: Actually, "perl".
REQUIRES: shell

RUN: rm -rf %t.output_dir && mkdir %t.output_dir
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME: Actually, "perl".
REQUIRES: shell

RUN: rm -rf %t.output_dir && mkdir %t.output_dir
RUN: cp %S/report-1.html %t.output_dir
RUN: cp %S/report-2.html %t.output_dir
Expand Down
3 changes: 0 additions & 3 deletions clang/test/Analysis/scan-build/silence-core-checkers.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME: Actually, "perl".
REQUIRES: shell

RUN: rm -rf %t.output_dir && mkdir %t.output_dir
RUN: %scan-build -o %t.output_dir \
RUN: %clang -S %S/Inputs/null_dereference_and_division_by_zero.c \
Expand Down
1 change: 1 addition & 0 deletions clang/test/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ config.enable_backtrace = @ENABLE_BACKTRACES@
config.enable_threads = @LLVM_ENABLE_THREADS@
config.reverse_iteration = @LLVM_ENABLE_REVERSE_ITERATION@
config.host_arch = "@HOST_ARCH@"
config.perl_executable = "@PERL_EXECUTABLE@"
config.python_executable = "@Python3_EXECUTABLE@"
config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@")
config.has_plugins = @CLANG_PLUGIN_SUPPORT@
Expand Down