tests: use the test helpers in more places
This is mostly cosmetic. It makes those test binaries support SYSTEMD_LOG_* environment variables.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "log.h"
|
||||
#include "resolved-etc-hosts.h"
|
||||
#include "strv.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
|
||||
static void test_parse_etc_hosts_system(void) {
|
||||
@@ -137,9 +138,7 @@ static void test_parse_file(const char *fname) {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
log_set_max_level(LOG_DEBUG);
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
test_setup_logging(LOG_DEBUG);
|
||||
|
||||
if (argc == 1) {
|
||||
test_parse_etc_hosts_system();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "log.h"
|
||||
#include "resolved-dns-packet.h"
|
||||
#include "tests.h"
|
||||
|
||||
static void test_dns_packet_new(void) {
|
||||
size_t i;
|
||||
@@ -23,10 +24,7 @@ static void test_dns_packet_new(void) {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
log_set_max_level(LOG_DEBUG);
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
test_setup_logging(LOG_DEBUG);
|
||||
|
||||
test_dns_packet_new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user