-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_user_api.cpp
More file actions
46 lines (37 loc) · 1.51 KB
/
test_user_api.cpp
File metadata and controls
46 lines (37 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "catch.hpp"
#include <symx>
#include "utils.h"
using namespace symx;
TEST_CASE("User-friendly compiler API", "[user_api]")
{
SECTION("Easy compiler checking")
{
// Simple check if compiler is working
bool working = is_compiler_working();
REQUIRE(working == true); // Should be true since tests are passing
std::cout << "Compiler working: " << (working ? "YES" : "NO") << std::endl;
}
SECTION("Get recommended compiler")
{
std::string recommended = get_recommended_compiler();
REQUIRE(!recommended.empty());
std::cout << "Recommended compiler: " << recommended << std::endl;
}
SECTION("Test specific compiler")
{
// Test the current compiler
CompilerInfo info = test_compiler(symx::resolve_compiler_path());
REQUIRE(info.is_available == true);
// Test a bad compiler
CompilerInfo bad_info = test_compiler("nonexistent_compiler");
REQUIRE(bad_info.is_available == false);
std::cout << "Current compiler test: " << (info.is_available ? "PASS" : "FAIL") << std::endl;
std::cout << "Bad compiler test: " << (bad_info.is_available ? "PASS (unexpected)" : "FAIL (expected)") << std::endl;
}
SECTION("Comprehensive check (visual test)")
{
std::cout << "\n=== User-Friendly Compiler Check ===" << std::endl;
check_compiler_setup();
std::cout << "===================================" << std::endl;
}
}