Skip to content

Commit 112772f

Browse files
authored
Review of the ContextBase include file. (#2)
* Review of the ContextBase include. Tests will follow after the Wasm header when the .cc files are sent for review. Signed-off-by: John Plevyak <[email protected]>
1 parent 48a495e commit 112772f

File tree

8 files changed

+994
-22
lines changed

8 files changed

+994
-22
lines changed

BUILD

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ package(default_visibility = ["//visibility:public"])
44

55
cc_library(
66
name = "include",
7-
hdrs = [
8-
"include/proxy-wasm/compat.h",
9-
"include/proxy-wasm/wasm_vm.h",
10-
"include/proxy-wasm/word.h",
11-
],
7+
hdrs = glob(["include/proxy-wasm/*.h"]),
128
deps = [
139
"@proxy_wasm_cpp_sdk//:common_lib",
1410
],
@@ -17,11 +13,7 @@ cc_library(
1713
# TODO: remove when dependent projects have been upgraded.
1814
cc_library(
1915
name = "include14",
20-
hdrs = [
21-
"include/proxy-wasm/compat.h",
22-
"include/proxy-wasm/wasm_vm.h",
23-
"include/proxy-wasm/word.h",
24-
],
16+
hdrs = glob(["include/proxy-wasm/*.h"]),
2517
copts = ["-std=c++14"],
2618
deps = [
2719
"@proxy_wasm_cpp_sdk//:common_lib",
@@ -30,9 +22,31 @@ cc_library(
3022

3123
cc_test(
3224
name = "wasm_vm_test",
33-
srcs = ["wasm_vm_test.cc"],
25+
srcs = ["test/wasm_vm_test.cc"],
26+
deps = [
27+
":include",
28+
"@com_google_googletest//:gtest",
29+
"@com_google_googletest//:gtest_main",
30+
],
31+
)
32+
33+
cc_test(
34+
name = "context_test",
35+
srcs = ["test/context_test.cc"],
3436
deps = [
3537
":include",
38+
"@com_google_googletest//:gtest",
39+
"@com_google_googletest//:gtest_main",
40+
],
41+
)
42+
43+
# TODO: remove when dependent projects have been upgraded.
44+
cc_test(
45+
name = "wasm_vm_14_test",
46+
srcs = ["test/wasm_vm_test.cc"],
47+
copts = ["-std=c++14"],
48+
deps = [
49+
":include14",
3650
"@com_google_absl//absl/base",
3751
"@com_google_absl//absl/strings:strings",
3852
"@com_google_absl//absl/types:optional",
@@ -41,10 +55,9 @@ cc_test(
4155
],
4256
)
4357

44-
# TODO: remove when dependent projects have been upgraded.
4558
cc_test(
46-
name = "wasm_vm_14_test",
47-
srcs = ["wasm_vm_test.cc"],
59+
name = "context_14_test",
60+
srcs = ["test/context_test.cc"],
4861
copts = ["-std=c++14"],
4962
deps = [
5063
":include14",

VERSIONING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ABI Versioning
2+
3+
TODO

include/proxy-wasm/compat.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@
1717
// Provide compatibiliby for projects which have not yet moved to C++17.
1818
// TODO: remove this when all dependent projects have upgraded.
1919

20-
#ifndef __cpp_lib_optional
21-
#include "absl/types/optional.h"
22-
#else
20+
#if __cplusplus >= 201703L
2321
#include <optional>
24-
#endif
25-
26-
#ifndef __cpp_lib_string_view
27-
#include "absl/strings/string_view.h"
28-
#else
2922
#include <string_view>
23+
#else
24+
#include "absl/types/optional.h"
25+
#include "absl/strings/string_view.h"
3026
#endif
3127

3228
namespace proxy_wasm {

0 commit comments

Comments
 (0)