Skip to content

Commit 9cf7482

Browse files
committed
Fix optional compiler diagnostic tests
1 parent 8fce4c9 commit 9cf7482

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

‎tests/test_diagnostics.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ TEST_CASE("Compiler diagnostics", "[diagnostics]")
1414
// Should be available since tests are working
1515
REQUIRE(info.is_available == true);
1616
REQUIRE(!info.path.empty());
17-
REQUIRE(!info.version.empty());
18-
REQUIRE(!info.architecture.empty());
17+
REQUIRE(info.could_compile);
18+
REQUIRE(info.could_load);
19+
REQUIRE(info.verified_result);
1920

2021
std::cout << "Compiler validation successful:" << std::endl;
2122
std::cout << " Path: " << info.path << std::endl;
22-
std::cout << " Version: " << info.version << std::endl;
23-
std::cout << " Architecture: " << info.architecture << std::endl;
23+
std::cout << " Compiled, loaded, and verified test program" << std::endl;
2424
std::cout << " AVX Support: " << (info.supports_avx ? "YES" : "NO") << std::endl;
2525
}
2626

@@ -30,10 +30,10 @@ TEST_CASE("Compiler diagnostics", "[diagnostics]")
3030
symx::CompilerInfo bad_info = symx::get_compiler_info("/nonexistent/compiler");
3131

3232
REQUIRE(bad_info.is_available == false);
33-
REQUIRE(!bad_info.error_message.empty());
33+
REQUIRE(bad_info.path == "/nonexistent/compiler");
3434

3535
std::cout << "Invalid compiler correctly detected:" << std::endl;
36-
std::cout << " Error: " << bad_info.error_message << std::endl;
36+
symx::print_compiler_info(bad_info);
3737
}
3838

3939
SECTION("Print diagnostics (visual test)")

‎tests/test_user_api.cpp‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ TEST_CASE("User-friendly compiler API", "[user_api]")
99
SECTION("Easy compiler checking")
1010
{
1111
// Simple check if compiler is working
12-
bool working = is_compiler_working();
12+
CompilerInfo info = get_compiler_info(resolve_compiler_path());
13+
REQUIRE(info.is_available);
14+
REQUIRE(info.could_compile);
15+
REQUIRE(info.could_load);
16+
bool working = info.verified_result;
1317
REQUIRE(working == true); // Should be true since tests are passing
1418

1519
std::cout << "Compiler working: " << (working ? "YES" : "NO") << std::endl;
1620
}
1721

18-
SECTION("Get recommended compiler")
22+
SECTION("Resolve compiler")
1923
{
20-
std::string recommended = get_recommended_compiler();
24+
std::string recommended = resolve_compiler_path();
2125
REQUIRE(!recommended.empty());
2226

2327
std::cout << "Recommended compiler: " << recommended << std::endl;
@@ -26,11 +30,11 @@ TEST_CASE("User-friendly compiler API", "[user_api]")
2630
SECTION("Test specific compiler")
2731
{
2832
// Test the current compiler
29-
CompilerInfo info = test_compiler(symx::resolve_compiler_path());
33+
CompilerInfo info = get_compiler_info(symx::resolve_compiler_path());
3034
REQUIRE(info.is_available == true);
3135

3236
// Test a bad compiler
33-
CompilerInfo bad_info = test_compiler("nonexistent_compiler");
37+
CompilerInfo bad_info = get_compiler_info("nonexistent_compiler");
3438
REQUIRE(bad_info.is_available == false);
3539

3640
std::cout << "Current compiler test: " << (info.is_available ? "PASS" : "FAIL") << std::endl;
@@ -40,7 +44,7 @@ TEST_CASE("User-friendly compiler API", "[user_api]")
4044
SECTION("Comprehensive check (visual test)")
4145
{
4246
std::cout << "\n=== User-Friendly Compiler Check ===" << std::endl;
43-
check_compiler_setup();
47+
print_compiler_diagnostics();
4448
std::cout << "===================================" << std::endl;
4549
}
4650
}

0 commit comments

Comments
 (0)