Skip to content

Commit ce32184

Browse files
committed
Check root privileges before running tests
References #155.
1 parent 33e9363 commit ce32184

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "mbpfan.h"
3030
#include "daemon.h"
3131
#include "global.h"
32+
#include "main.h"
3233
#include "minunit.h"
3334

3435
int daemonize = 1;

src/main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void check_requirements();

src/minunit.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "global.h"
1010
#include "mbpfan.h"
1111
#include "settings.h"
12+
#include "main.h"
1213
#include "minunit.h"
1314

1415
int tests_run = 0;
@@ -193,6 +194,8 @@ static const char *all_tests()
193194

194195
int tests()
195196
{
197+
check_requirements();
198+
196199
printf("Starting the tests..\n");
197200
printf("It is normal for them to take a bit to finish.\n");
198201

0 commit comments

Comments
 (0)