Skip to content
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

Fix docker build #54

Merged
merged 1 commit into from
Jun 16, 2020
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
15 changes: 0 additions & 15 deletions cmake/clangmetatool-get-clang-std-include.sh

This file was deleted.

6 changes: 4 additions & 2 deletions t/027-c-style-variadic-integer-propagation.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ TEST(propagation_ConstantIntegerPropagation, functionArgs) {
const char* argv[] = {
"foo",
CMAKE_SOURCE_DIR "/t/data/027-c-style-variadic-integer-propagation/main.cpp",
"--extra-arg-before=-I" CLANG_STD_INCLUDE_DIR,
"--",
// Test C++ for confirming that this works on a superset
"-xc++"
"-xc++",

// Set resource dir so stdarg.h can be found
"-resource-dir=" CLANG_RESOURCE_DIR
};
clang::tooling::CommonOptionsParser optionsParser
(argc, argv, MyToolCategory);
Expand Down
10 changes: 5 additions & 5 deletions t/029-tool-application-support.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ TEST_F(ToolApplicationSupportTest, ARCH_DEPENDENT(ResourceDirUnspecified))
TEST_F(ToolApplicationSupportTest, ARCH_DEPENDENT(ResourceDirFound))
{
EXPECT_TRUE(verifyInstallation({"tool", "test.cpp", "--",
"-resource-dir", CLANG_STD_INCLUDE_DIR}))
<< "verification failed with CLANG_STD_INCLUDE_DIR=" CLANG_STD_INCLUDE_DIR
"-resource-dir", CLANG_RESOURCE_DIR}))
<< "verification failed with CLANG_RESOURCE_DIR=" CLANG_RESOURCE_DIR
<< "\n";
}

Expand All @@ -93,15 +93,15 @@ TEST_F(ToolApplicationSupportTest, ARCH_DEPENDENT(GCCToolChain))
"clang is installed";
ASSERT_DEATH(
verifyInstallation({"tool", "test.cpp", "--",
"-resource-dir", CLANG_STD_INCLUDE_DIR,
"-resource-dir", CLANG_RESOURCE_DIR,
"-gcc-toolchain", "/non-existent/123"}),
messageRegex);
}

TEST_F(ToolApplicationSupportTest, ARCH_DEPENDENT(CFilesWithResourceDir))
{
EXPECT_TRUE(verifyInstallation({"tool", "test.c", "--",
"-resource-dir", CLANG_STD_INCLUDE_DIR}));
"-resource-dir", CLANG_RESOURCE_DIR}));
}

TEST_F(ToolApplicationSupportTest, ARCH_DEPENDENT(CFilesWithGCCToolChain))
Expand All @@ -112,7 +112,7 @@ TEST_F(ToolApplicationSupportTest, ARCH_DEPENDENT(CFilesWithGCCToolChain))
"clang is installed";
ASSERT_DEATH(
verifyInstallation({"tool", "test.c", "--",
"-resource-dir", CLANG_STD_INCLUDE_DIR,
"-resource-dir", CLANG_RESOURCE_DIR,
"-gcc-toolchain", "/non-existent/123"}),
messageRegex);
}
Expand Down
8 changes: 4 additions & 4 deletions t/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ find_package(Threads REQUIRED)
find_package(GTest REQUIRED)
find_package(LLVM REQUIRED)

list(GET CLANG_INCLUDE_DIRS 0 CLANG_PREFIX_DIR)
get_filename_component(CLANG_PREFIX_DIR "${CLANG_PREFIX_DIR}" DIRECTORY)
execute_process(
COMMAND
"${PROJECT_SOURCE_DIR}/cmake/clangmetatool-get-clang-std-include.sh"
"${CLANG_INCLUDE_DIRS}"
OUTPUT_VARIABLE CLANG_STD_INCLUDE_DIR
COMMAND "${CLANG_PREFIX_DIR}/bin/clang" -print-resource-dir
OUTPUT_VARIABLE CLANG_RESOURCE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)

Expand Down
2 changes: 1 addition & 1 deletion t/include/clangmetatool-testconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

#define CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@"
#define CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@"
#define CLANG_RESOURCE_DIR "@CLANG_RESOURCE_DIR@"

#define CLANG_STD_INCLUDE_DIR "@CLANG_STD_INCLUDE_DIR@"
#endif