Skip to content

Commit

Permalink
Make project structure more Bazel-friendly
Browse files Browse the repository at this point in the history
Move tests close to sources, rename source
directory from `src` to `graph_autodiff`.
This way the main Bazel library target is
`@cpp-graph-autodiff//graph_autodiff`.
  • Loading branch information
eguiraud committed Oct 2, 2023
1 parent f922ae8 commit 65f707e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
11 changes: 11 additions & 0 deletions src/BUILD.bazel → graph_autodiff/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,14 @@ proto_library(
name = "graph_proto",
srcs = ["graph.proto"],
)

cc_test(
name = "graph_autodiff_test",
size = "small",
srcs = ["graph_test.cpp"],
deps = [
"@abseil-cpp//absl/status:statusor",
"@googletest//:gtest_main",
"//graph_autodiff"
],
)
2 changes: 1 addition & 1 deletion src/graph.cpp → graph_autodiff/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ under certain conditions: see LICENSE.
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "fmt/core.h"
#include "src/graph.pb.h"
#include "graph_autodiff/graph.pb.h"

using namespace graph_autodiff;
namespace gpb = graph_proto;
Expand Down
2 changes: 1 addition & 1 deletion src/graph.h → graph_autodiff/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ under certain conditions: see LICENSE.
#include "absl/container/flat_hash_map.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "src/graph.pb.h"
#include "graph_autodiff/graph.pb.h"

/* A note on the use of shared_ptr<const T>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test.cpp → graph_autodiff/graph_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <gtest/gtest.h>

#include "absl/status/statusor.h"
#include "src/graph.h"
#include "graph_autodiff/graph.h"

using namespace graph_autodiff;

Expand Down
10 changes: 0 additions & 10 deletions tests/BUILD.bazel

This file was deleted.

0 comments on commit 65f707e

Please sign in to comment.