Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6fb51b2

Browse files
committed
Update test_toolchain_verify.cpp
1 parentf05e415 commit6fb51b2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

‎buildcc/lib/toolchain/test/test_toolchain_verify.cpp‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,38 @@ TEST(ToolchainVerifyTestGroup, VerifyToolchain_Msvc) {
210210
STRCMP_EQUAL(compiler_info.target_arch.c_str(),"host_arch_tgt_arch");
211211
}
212212

213+
TEST(ToolchainVerifyTestGroup,
214+
VerifyToolchain_Msvc_CompilerVersionAndTargetArchFailure) {
215+
buildcc::Toolchainmsvc(buildcc::ToolchainId::Msvc,"msvc","cl","cl","cl",
216+
"lib","link");
217+
// Setup ENV
218+
// VSCMD_VER
219+
// std::string vscmd_ver = std::string("VSCMD_VER=version");
220+
// // VSCMD_ARG_HOST_ARCH
221+
// std::string host_arch = std::string("VSCMD_ARG_HOST_ARCH=host_arch");
222+
// // VSCMD_ARG_TGT_ARCH
223+
// std::string tgt_arch = std::string("VSCMD_ARG_TGT_ARCH=tgt_arch");
224+
225+
// CHECK_TRUE(putenv(vscmd_ver.data()) == 0);
226+
// CHECK_TRUE(putenv(host_arch.data()) == 0);
227+
// CHECK_TRUE(putenv(tgt_arch.data()) == 0);
228+
229+
// MSVC Compiler
230+
std::string putenv_str =
231+
fmt::format("CUSTOM_BUILDCC_PATH={}/toolchains/msvc",fs::current_path());
232+
int put =putenv(putenv_str.data());
233+
CHECK_TRUE(put ==0);
234+
constchar *custom_buildcc_path =getenv("CUSTOM_BUILDCC_PATH");
235+
CHECK_TRUE(custom_buildcc_path !=nullptr);
236+
UT_PRINT(custom_buildcc_path);
237+
238+
buildcc::ToolchainVerifyConfig config;
239+
config.env_vars.clear();
240+
config.env_vars.insert("CUSTOM_BUILDCC_PATH");
241+
242+
CHECK_THROWS(std::exception, msvc.Verify(config));
243+
}
244+
213245
TEST(ToolchainVerifyTestGroup, VerifyToolchain_BadCompilerId) {
214246
buildcc::Toolchaingcc((buildcc::ToolchainId)65535,"gcc","as","gcc","g++",
215247
"ar","ld");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp