@@ -210,6 +210,38 @@ TEST(ToolchainVerifyTestGroup, VerifyToolchain_Msvc) {
210210STRCMP_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+ const char *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+
213245TEST (ToolchainVerifyTestGroup, VerifyToolchain_BadCompilerId) {
214246 buildcc::Toolchaingcc ((buildcc::ToolchainId)65535 ," gcc" ," as" ," gcc" ," g++" ,
215247" ar" ," ld" );