mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
8f68d35cbb
* some more * faster tests * on by default
33 lines
1.3 KiB
C++
33 lines
1.3 KiB
C++
// Test the game running without loading debug segments.
|
|
|
|
#include "gtest/gtest.h"
|
|
#include "goalc/compiler/Compiler.h"
|
|
#include "test/goalc/framework/test_runner.h"
|
|
|
|
TEST(GameNoDebugSegment, Init) {
|
|
Compiler compiler;
|
|
compiler.run_front_end_on_string("(build-kernel)");
|
|
std::thread runtime_thread = std::thread(GoalTest::runtime_with_kernel_no_debug_segment);
|
|
|
|
compiler.run_test_from_string("(set! *use-old-listener-print* #t)");
|
|
|
|
// this shouldn't crash
|
|
compiler.run_test_from_string("(inspect *kernel-context*)");
|
|
|
|
// these should be equal, both the fallback inspect method
|
|
EXPECT_TRUE(compiler.run_test_from_string("(printl (eq? (method-of-type kernel-context inspect) "
|
|
"(method-of-type cpu-thread inspect))) 0") ==
|
|
std::vector<std::string>{"#t\n0\n"});
|
|
|
|
// should be below the debug heap.
|
|
EXPECT_TRUE(compiler.run_test_from_string("(printl (< (the uint (method-of-type kernel-context "
|
|
"inspect)) (the uint (-> debug base)))) 0") ==
|
|
std::vector<std::string>{"#t\n0\n"});
|
|
|
|
// debug segment flag should be disabled.
|
|
EXPECT_TRUE(compiler.run_test_from_string("(printl *debug-segment*) 0") ==
|
|
std::vector<std::string>{"#f\n0\n"});
|
|
|
|
compiler.shutdown_target();
|
|
runtime_thread.join();
|
|
} |