@@ -101,6 +101,54 @@ TEST(ToolchainVerifyTestGroup, VerifyToolchain_Gcc_CompilerVersionEmpty) {
101101CHECK_THROWS (std::exception, gcc.Verify (config));
102102}
103103
104+ TEST (ToolchainVerifyTestGroup, VerifyToolchain_Gcc_TargetArchFailure) {
105+ buildcc::Toolchaingcc (buildcc::ToolchainId::Gcc," gcc" ," as" ," gcc" ," g++" ,
106+ " ar" ," ld" );
107+
108+ std::vector<std::string> version_stdout_data{" version" };
109+ std::vector<std::string> arch_stdout_data{" arch" };
110+ buildcc::env::m::CommandExpect_Execute (1 ,true , &version_stdout_data);
111+ buildcc::env::m::CommandExpect_Execute (1 ,false , &arch_stdout_data);
112+
113+ std::string putenv_str =
114+ fmt::format (" CUSTOM_BUILDCC_PATH={}/toolchains/gcc" ,fs::current_path ());
115+ int put =putenv (putenv_str.data ());
116+ CHECK_TRUE (put ==0 );
117+ const char *custom_buildcc_path =getenv (" CUSTOM_BUILDCC_PATH" );
118+ CHECK_TRUE (custom_buildcc_path !=nullptr );
119+ UT_PRINT (custom_buildcc_path);
120+
121+ buildcc::ToolchainVerifyConfig config;
122+ config.env_vars .clear ();
123+ config.env_vars .insert (" CUSTOM_BUILDCC_PATH" );
124+
125+ CHECK_THROWS (std::exception, gcc.Verify (config));
126+ }
127+
128+ TEST (ToolchainVerifyTestGroup, VerifyToolchain_Gcc_TargetArchEmpty) {
129+ buildcc::Toolchaingcc (buildcc::ToolchainId::Gcc," gcc" ," as" ," gcc" ," g++" ,
130+ " ar" ," ld" );
131+
132+ std::vector<std::string> version_stdout_data{" version" };
133+ std::vector<std::string> arch_stdout_data;
134+ buildcc::env::m::CommandExpect_Execute (1 ,true , &version_stdout_data);
135+ buildcc::env::m::CommandExpect_Execute (1 ,true , &arch_stdout_data);
136+
137+ std::string putenv_str =
138+ fmt::format (" CUSTOM_BUILDCC_PATH={}/toolchains/gcc" ,fs::current_path ());
139+ int put =putenv (putenv_str.data ());
140+ CHECK_TRUE (put ==0 );
141+ const char *custom_buildcc_path =getenv (" CUSTOM_BUILDCC_PATH" );
142+ CHECK_TRUE (custom_buildcc_path !=nullptr );
143+ UT_PRINT (custom_buildcc_path);
144+
145+ buildcc::ToolchainVerifyConfig config;
146+ config.env_vars .clear ();
147+ config.env_vars .insert (" CUSTOM_BUILDCC_PATH" );
148+
149+ CHECK_THROWS (std::exception, gcc.Verify (config));
150+ }
151+
104152TEST (ToolchainVerifyTestGroup, VerifyToolchain_Clang) {
105153 buildcc::Toolchainclang (buildcc::ToolchainId::Clang," clang" ," llvm-as" ,
106154" clang" ," clang++" ," llvm-ar" ," lld" );