Skip to content

Commit 8ce492c

Browse files
use makefile for test
1 parent 48f371b commit 8ce492c

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ dist
33
node_modules
44
.vscode-test/
55
*.vsix
6-
library/test.bin
6+
library/test.exe
7+
library/test.d
78
.yarn/

.vscodeignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ tsconfig.json
1010
webpack.config.js
1111
yarn.lock
1212
library/test/
13-
library/test.bin
13+
library/test.exe
14+
library/test.d
15+
.github/

library/makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
CXX = g++
3+
4+
CXXFLAGS = -Wall -Wextra -g -I. -MMD
5+
6+
TARGET = test.exe
7+
8+
GTEST_LIBS = -lgtest -lgtest_main -pthread
9+
10+
11+
LDFLAGS = $(GTEST_LIBS)
12+
13+
SRCS = test/main.cpp
14+
15+
-include *.d
16+
17+
test: $(TARGET)
18+
19+
$(TARGET): $(SRCS)
20+
$(CXX) $(CXXFLAGS) -o $(TARGET) $(SRCS) $(LDFLAGS)
21+
22+
clean:
23+
rm -f $(TARGET)
24+
25+
.PHONY: all clean

library/test/main.o

971 KB
Binary file not shown.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"pack": "vsce pack --no-yarn -o mp-oi-library.vsix",
4646
"format:check": "prettier -c .",
4747
"format:write": "prettier -w .",
48-
"testlib": "yarn run test-compile-lib && ./library/test.bin --gtest_repeat=100 --gtest_break_on_failure",
4948
"debug-compile-lib": "g++ -std=c++14 -Wall -Wextra -g -I./library -o ./library/test.bin ./library/test/main.cpp -lgtest -lgtest_main",
5049
"test-compile-lib": "g++ -std=c++14 -Wall -Wextra -O3 -I./library -o ./library/test.bin ./library/test/main.cpp -lgtest -lgtest_main"
5150
},

0 commit comments

Comments
 (0)