1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 08:07:44 +00:00

Everywhere: Replace uses of __serenity__ with AK_OS_SERENITY

Now that we have OS macros for essentially every supported OS, let's try
to use them everywhere.
This commit is contained in:
Andrew Kaster 2022-10-09 15:23:23 -06:00 committed by Linus Groh
parent 896d4e8dc1
commit 828441852f
46 changed files with 118 additions and 113 deletions

View file

@ -37,7 +37,7 @@
#include <sys/time.h>
#include <unistd.h>
#ifdef __serenity__
#ifdef AK_OS_SERENITY
# include <serenity.h>
#endif
@ -292,7 +292,7 @@ inline JSFileResult TestRunner::run_file_test(String const& test_path)
{
g_currently_running_test = test_path;
#ifdef __serenity__
#ifdef AK_OS_SERENITY
auto string_id = perf_register_string(test_path.characters(), test_path.length());
perf_event(PERF_EVENT_SIGNPOST, string_id, 0);
#endif
@ -499,7 +499,7 @@ inline void TestRunner::print_file_result(JSFileResult const& file_result) const
if (!file_result.logged_messages.is_empty()) {
print_modifiers({ FG_GRAY, FG_BOLD });
#ifdef __serenity__
#ifdef AK_OS_SERENITY
outln(" Console output:");
#else
// This emoji has a second invisible byte after it. The one above does not
@ -514,7 +514,7 @@ inline void TestRunner::print_file_result(JSFileResult const& file_result) const
auto test_error = file_result.error.value();
print_modifiers({ FG_RED });
#ifdef __serenity__
#ifdef AK_OS_SERENITY
outln(" ❌ The file failed to parse");
#else
// No invisible byte here, but the spacing still needs to be altered on the host
@ -541,14 +541,14 @@ inline void TestRunner::print_file_result(JSFileResult const& file_result) const
print_modifiers({ FG_GRAY, FG_BOLD });
if (failed) {
#ifdef __serenity__
#ifdef AK_OS_SERENITY
out(" ❌ Suite: ");
#else
// No invisible byte here, but the spacing still needs to be altered on the host
out(" ❌ Suite: ");
#endif
} else {
#ifdef __serenity__
#ifdef AK_OS_SERENITY
out(" ⚠ Suite: ");
#else
// This emoji has a second invisible byte after it. The one above does not

View file

@ -81,7 +81,7 @@ int main(int argc, char** argv)
bool print_times = false;
bool print_progress =
#ifdef __serenity__
#ifdef AK_OS_SERENITY
true; // Use OSC 9 to print progress
#else
false;
@ -140,7 +140,7 @@ int main(int argc, char** argv)
if (specified_test_root) {
test_root = String { specified_test_root };
} else {
#ifdef __serenity__
#ifdef AK_OS_SERENITY
test_root = LexicalPath::join("/home/anon/Tests"sv, String::formatted("{}-tests", program_name.split_view('-').last())).string();
#else
char* serenity_source_dir = getenv("SERENITY_SOURCE_DIR");
@ -158,7 +158,7 @@ int main(int argc, char** argv)
}
if (common_path.is_empty()) {
#ifdef __serenity__
#ifdef AK_OS_SERENITY
common_path = "/home/anon/Tests/js-tests/test-common.js";
#else
char* serenity_source_dir = getenv("SERENITY_SOURCE_DIR");