mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
tt: Port to LibMain
This commit is contained in:
parent
ab9a78a305
commit
cf154ec0d9
2 changed files with 5 additions and 5 deletions
|
@ -210,7 +210,7 @@ target_link_libraries(traceroute LibMain)
|
||||||
target_link_libraries(tree LibMain)
|
target_link_libraries(tree LibMain)
|
||||||
target_link_libraries(true LibMain)
|
target_link_libraries(true LibMain)
|
||||||
target_link_libraries(truncate LibMain)
|
target_link_libraries(truncate LibMain)
|
||||||
target_link_libraries(tt LibPthread)
|
target_link_libraries(tt LibPthread LibMain)
|
||||||
target_link_libraries(umount LibMain)
|
target_link_libraries(umount LibMain)
|
||||||
target_link_libraries(uname LibMain)
|
target_link_libraries(uname LibMain)
|
||||||
target_link_libraries(uniq LibMain)
|
target_link_libraries(uniq LibMain)
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
|
#include <LibMain/Main.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <signal_numbers.h>
|
#include <signal_numbers.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -22,7 +22,7 @@ static int staying_alive_test();
|
||||||
static int set_stack_test();
|
static int set_stack_test();
|
||||||
static int kill_test();
|
static int kill_test();
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
const char* test_name = "n";
|
const char* test_name = "n";
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ int main(int argc, char** argv)
|
||||||
"Exercise error-handling and edge-case paths of the execution environment "
|
"Exercise error-handling and edge-case paths of the execution environment "
|
||||||
"(i.e., Kernel or UE) by doing unusual thread-related things.");
|
"(i.e., Kernel or UE) by doing unusual thread-related things.");
|
||||||
args_parser.add_positional_argument(test_name, "Test to run (m = mutex, d = detached, p = priority, s = stack size, t = simple thread test, x = set stack, k = kill, nothing = join race)", "test-name", Core::ArgsParser::Required::No);
|
args_parser.add_positional_argument(test_name, "Test to run (m = mutex, d = detached, p = priority, s = stack size, t = simple thread test, x = set stack, k = kill, nothing = join race)", "test-name", Core::ArgsParser::Required::No);
|
||||||
args_parser.parse(argc, argv);
|
args_parser.parse(arguments);
|
||||||
|
|
||||||
if (*test_name == 'm')
|
if (*test_name == 'm')
|
||||||
return mutex_test();
|
return mutex_test();
|
||||||
|
@ -48,7 +48,7 @@ int main(int argc, char** argv)
|
||||||
if (*test_name == 'k')
|
if (*test_name == 'k')
|
||||||
return kill_test();
|
return kill_test();
|
||||||
if (*test_name != 'n') {
|
if (*test_name != 'n') {
|
||||||
args_parser.print_usage(stdout, argv[0]);
|
args_parser.print_usage(stdout, arguments.argv[0]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue