Skip to content

Commit

Permalink
NetworkGeneration: Added this to test directory
Browse files Browse the repository at this point in the history
This is actually part of Seldon, but some functions here could be useful
for testing. Also axed the main.cpp. Will use catch2 tests for testing.
  • Loading branch information
amritagos committed Apr 19, 2024
1 parent 17c8b15 commit b90478c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions graph_lib/include/directed_network.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "network_base.hpp"
#include <utility>

namespace Seldon {
namespace Graph {

/*
A class that represents a directed graph using adjacency lists.
Expand Down Expand Up @@ -228,4 +228,4 @@ class DirectedNetwork : public NetworkBase<AgentType, WeightType> {
EdgeDirection _direction{};
};

} // namespace Seldon
} // namespace Graph
11 changes: 5 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ compiler = meson.get_compiler('cpp')
inc = include_directories('graph_lib/include')
graphlib_dep = declare_dependency(include_directories : inc)

exe_verification = executable('exe', 'verification/main.cpp',
install : true,
include_directories : inc
)

tests = [
['Test', 'test/test.cpp'],
]

test_inc = []
test_inc += inc
test_inc += 'test/util'

Catch2 = dependency('Catch2', method : 'cmake', modules : ['Catch2::Catch2WithMain', 'Catch2::Catch2'])

foreach t : tests
exe = executable(t.get(0), t.get(1),
dependencies : [Catch2],
include_directories : inc
include_directories : test_inc
)
test(t.get(0), exe, workdir : meson.project_source_root())
endforeach
1 change: 1 addition & 0 deletions test/test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "undirected_network.hpp"
#include "util/network_generation.hpp"
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_range_equals.hpp>
#include <cstddef>
Expand Down
6 changes: 0 additions & 6 deletions verification/main.cpp

This file was deleted.

0 comments on commit b90478c

Please sign in to comment.