-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·126 lines (115 loc) · 3.39 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
set -ex
cd "`dirname $0`"
INSTALL_DIR="`pwd`/_install"
BUILD_DIR="`pwd`/_build"
PROTO_DIR="`pwd`/proto"
rm -rf $BUILD_DIR/test/cpp
rm -rf $BUILD_DIR/test/c
rm -rf $BUILD_DIR/test/typescript
rm -rf test/unity/JsonifUnityTest/Assets/Generated
mkdir -p $BUILD_DIR/test/cpp
mkdir -p $BUILD_DIR/test/c
mkdir -p $BUILD_DIR/test/typescript
mkdir -p test/unity/JsonifUnityTest/Assets/Generated
$INSTALL_DIR/protoc/bin/protoc -I$PROTO_DIR --go_out=. $PROTO_DIR/extensions.proto
go build -o $BUILD_DIR/test/protoc-gen-jsonif-cpp cmd/protoc-gen-jsonif-cpp/main.go
go build -o $BUILD_DIR/test/protoc-gen-jsonif-c cmd/protoc-gen-jsonif-c/main.go
go build -o $BUILD_DIR/test/protoc-gen-jsonif-unity cmd/protoc-gen-jsonif-unity/main.go
go build -o $BUILD_DIR/test/protoc-gen-jsonif-typescript cmd/protoc-gen-jsonif-typescript/main.go
pushd test/proto
$INSTALL_DIR/protoc/bin/protoc \
-I. \
-I$PROTO_DIR \
--plugin=protoc-gen-jsonif-cpp=$BUILD_DIR/test/protoc-gen-jsonif-cpp \
--jsonif-cpp_out=$BUILD_DIR/test/cpp \
bytes.proto \
empty.proto \
enumpb.proto \
importing.proto \
message.proto \
nested.proto \
oneof.proto \
repeated.proto \
size.proto \
jsonfield.proto \
optimistic.proto \
optional.proto \
discard_if_default.proto \
no_serializer.proto
$INSTALL_DIR/protoc/bin/protoc \
-I. \
-I$PROTO_DIR \
--plugin=protoc-gen-jsonif-c=$BUILD_DIR/test/protoc-gen-jsonif-c \
--jsonif-c_out=$BUILD_DIR/test/c \
bytes.proto \
empty.proto \
enumpb.proto \
importing.proto \
message.proto \
nested.proto \
oneof.proto \
optional.proto \
repeated.proto \
size.proto
$INSTALL_DIR/protoc/bin/protoc \
--plugin=protoc-gen-jsonif-unity=$BUILD_DIR/test/protoc-gen-jsonif-unity \
--jsonif-unity_out=../unity/JsonifUnityTest/Assets/Generated \
empty.proto \
enumpb.proto \
importing.proto \
message.proto \
nested.proto \
oneof.proto \
optional.proto \
repeated.proto
$INSTALL_DIR/protoc/bin/protoc \
--plugin=protoc-gen-jsonif-typescript=$BUILD_DIR/test/protoc-gen-jsonif-typescript \
--jsonif-typescript_out=$BUILD_DIR/test/typescript \
empty.proto \
enumpb.proto \
importing.proto \
message.proto \
nested.proto \
oneof.proto \
optional.proto \
repeated.proto
popd
g++ test/cpp/main.cpp \
-I $BUILD_DIR/test/cpp \
-I $INSTALL_DIR/boost/include/ \
-o $BUILD_DIR/test/cpp/test
$BUILD_DIR/test/cpp/test
g++ test/cpp/main.cpp \
-I $BUILD_DIR/test/cpp \
-I $INSTALL_DIR/json/include/ \
-o $BUILD_DIR/test/cpp/test_nlohmann \
-DJSONIF_USE_NLOHMANN_JSON
$BUILD_DIR/test/cpp/test_nlohmann
g++ -g \
test/c/main.cpp \
$BUILD_DIR/test/c/*.cpp \
$BUILD_DIR/test/c/google/protobuf/*.cpp \
-I $BUILD_DIR/test/c \
-I $BUILD_DIR/test/cpp \
-I $INSTALL_DIR/boost/include/ \
-o $BUILD_DIR/test/c/test
$BUILD_DIR/test/c/test
# 複数ファイルで同じ変数や関数を定義している場合にリンクエラーにならないことを確認する
gcc \
test/c/multidef_1.c \
test/c/multidef_2.c \
test/c/multidef.cpp \
$BUILD_DIR/test/c/*.cpp \
$BUILD_DIR/test/c/google/protobuf/*.cpp \
-lstdc++ \
-I $BUILD_DIR/test/c \
-I $BUILD_DIR/test/cpp \
-I $INSTALL_DIR/boost/include/ \
-o $BUILD_DIR/test/c/test_multidef
$BUILD_DIR/test/c/test
# TypeScript のテスト
pushd test/typescript
rm -rf dist/
npx webpack
node dist/main.js
popd