Skip to content

Commit

Permalink
[C++] Fix test-io build (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotekina committed Dec 15, 2024
1 parent 2108eeb commit 9298899
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,17 @@ test:
done
test-io:
mkdir -p bin
$(CC) \
$(CXX) \
-std=c++20 \
-DDATA_DIR= \
-o bin/test-io \
t/test-io.c \
src/keyboard.c \
src/string.c \
src/macro.c \
src/config.c \
src/log.c \
src/ini.c \
src/keys.c \
t/test-io.cpp \
src/keyboard.cpp \
src/string.cpp \
src/macro.cpp \
src/config.cpp \
src/log.cpp \
src/ini.cpp \
src/keys.cpp \
src/unicode.c && \
./bin/test-io t/test.conf t/*.t
5 changes: 3 additions & 2 deletions t/test-io.c → t/test-io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <stdlib.h>
#include <time.h>
#include "../src/keyd.h"
#include <memory>

#define MAX_EVENTS 1024

Expand Down Expand Up @@ -243,7 +244,7 @@ int main(int argc, char *argv[])
struct config config;
uint64_t total_time;

struct keyboard *kbd;
std::unique_ptr<struct keyboard> kbd;

struct output output = {
.send_key = send_key,
Expand All @@ -265,7 +266,7 @@ int main(int argc, char *argv[])
kbd = new_keyboard(&config, &output);

for (i = 2; i < argc; i++)
total_time += run_test(kbd, argv[i]);
total_time += run_test(kbd.get(), argv[i]);

printf("\nTotal time spent in the main loop: %zu us\n", total_time/1000);
return 0;
Expand Down

0 comments on commit 9298899

Please sign in to comment.