Skip to content

Commit

Permalink
fix tutorial and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Coulom committed Oct 12, 2024
1 parent 0e6e69d commit e361830
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 32 deletions.
35 changes: 22 additions & 13 deletions compcmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,20 @@ if(GTest_FOUND)
../test/compiler/Readonly_Client.cpp
../test/compiler/single_row.cpp
../test/compiler/translation.h
../test/compiler/db/blob.cpp
../test/compiler/db/test.cpp
../test/compiler/db/multi_index.cpp
../test/compiler/db/schema_v1.cpp
../test/compiler/db/schema_v2.cpp
../test/compiler/db/vector_test.cpp
../test/compiler/db/empty.cpp
../test/compiler/db/blob/readonly.cpp
../test/compiler/db/blob/writable.cpp
../test/compiler/db/empty/readonly.cpp
../test/compiler/db/empty/writable.cpp
../test/compiler/db/multi_index/readonly.cpp
../test/compiler/db/multi_index/writable.cpp
../test/compiler/db/schema_v1/readonly.cpp
../test/compiler/db/schema_v1/writable.cpp
../test/compiler/db/schema_v2/readonly.cpp
../test/compiler/db/schema_v2/writable.cpp
../test/compiler/db/test/readonly.cpp
../test/compiler/db/test/writable.cpp
../test/compiler/db/vector_test/readonly.cpp
../test/compiler/db/vector_test/writable.cpp
../test/compiler/db/test_dbname_base64.cpp
../test/compiler/db/test_dbname_ascii.cpp
../src/joedb/io/base64_decode.cpp
Expand Down Expand Up @@ -221,13 +228,13 @@ if (asio_FOUND)
endif()
endif()

joedbc_build(../test/compiler/db test)
joedbc_build(../test/compiler/db empty)
joedbc_build(../test/compiler/db blob)
joedbc_build(../test/compiler/db multi_index)
joedbc_build(../test/compiler/db schema_v1)
joedbc_build(../test/compiler/db schema_v2)
joedbc_build(../test/compiler/db test)
joedbc_build(../test/compiler/db vector_test)
joedbc_build(../test/compiler/db multi_index)
joedbc_build(../test/compiler/db empty)
joedbc_build(../test/compiler/db blob)
joedbc_build(../benchmark benchmarkdb)
joedbc_build(../doc/source/tutorial tutorial)
joedbc_build(../doc/source/tutorial settings)
Expand Down Expand Up @@ -320,7 +327,8 @@ joedb_add_executable(index_tutorial
)

joedb_add_executable(joedb_generate_translation_header
../test/compiler/db/test.cpp
../test/compiler/db/test/readonly.cpp
../test/compiler/db/test/writable.cpp
../test/compiler/generate_translation_header.cpp
)

Expand All @@ -331,7 +339,8 @@ joedb_add_executable(joedbc_insert
)

joedb_add_executable(update_large_string
../test/compiler/db/schema_v1.cpp
../test/compiler/db/schema_v1/readonly.cpp
../test/compiler/db/schema_v1/writable.cpp
../test/compiler/update_large_string.cpp
)

Expand Down
36 changes: 30 additions & 6 deletions doc/source/tutorial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,38 @@ include("../../../compcmake/joedbc.cmake")
joedbc_build("." tutorial)
joedbc_build("." settings)

joedb_add_executable(tutorial tutorial_main.cpp tutorial.cpp)
joedb_add_executable(tutorial
tutorial_main.cpp
tutorial/readonly.cpp
tutorial/writable.cpp
)

joedb_add_executable(local_concurrency local_concurrency.cpp tutorial.cpp)
joedb_add_executable(local_concurrency
local_concurrency.cpp
tutorial/readonly.cpp
tutorial/writable.cpp
)

joedb_add_executable(file_tutorial file_tutorial.cpp tutorial.cpp)
joedb_add_executable(file_tutorial
file_tutorial.cpp
tutorial/readonly.cpp
tutorial/writable.cpp
)

joedb_add_executable(concurrency_tutorial concurrency_tutorial.cpp tutorial.cpp)
joedb_add_executable(concurrency_tutorial
concurrency_tutorial.cpp
tutorial/readonly.cpp
tutorial/writable.cpp
)

joedb_add_executable(index_tutorial index_tutorial.cpp tutorial.cpp)
joedb_add_executable(index_tutorial
index_tutorial.cpp
tutorial/readonly.cpp
tutorial/writable.cpp
)

joedb_add_executable(settings settings_main.cpp settings.cpp)
joedb_add_executable(settings
settings_main.cpp
settings/readonly.cpp
settings/writable.cpp
)
2 changes: 1 addition & 1 deletion src/joedb/compiler/joedb_embed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int main(int argc, char **argv)
}

cpp << "#include \"" << file_name.str() << ".h\"\n";
cpp << "#include \"" << name_space.back() << "_readonly.h\"\n";
cpp << "#include \"" << name_space.back() << "/readonly.h\"\n";
cpp << "#include \"joedb/journal/Readonly_Memory_File.h\"\n";
if (mode == base64)
cpp << "#include \"joedb/io/base64.h\"\n";
Expand Down
2 changes: 1 addition & 1 deletion test/compiler/Blob.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "db/blob.h"
#include "db/blob/writable.h"
#include "joedb/journal/Memory_File.h"

#include "gtest/gtest.h"
Expand Down
12 changes: 6 additions & 6 deletions test/compiler/Compiler_GTest.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "db/test.h"
#include "db/multi_index.h"
#include "db/schema_v1.h"
#include "db/schema_v2.h"
#include "db/test_readonly.h"
#include "db/vector_test.h"
#include "db/test/writable.h"
#include "db/multi_index/writable.h"
#include "db/schema_v1/writable.h"
#include "db/schema_v2/writable.h"
#include "db/test/readonly.h"
#include "db/vector_test/writable.h"
#include "translation.h"
#include "joedb/journal/Readonly_Interpreted_File.h"
#include "joedb/concurrency/File_Connection.h"
Expand Down
2 changes: 1 addition & 1 deletion test/compiler/Readonly_Client.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "db/test.h"
#include "db/test/writable.h"

#include "gtest/gtest.h"

Expand Down
2 changes: 1 addition & 1 deletion test/compiler/embedded_GTest.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "db/test_dbname_base64.h"
#include "db/test_dbname_ascii.h"
#include "db/test.h"
#include "db/test/readonly.h"

#include "gtest/gtest.h"

Expand Down
4 changes: 2 additions & 2 deletions test/compiler/generate_translation_header.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "db/test_readonly.h"
#include "db/test/readonly.h"
#include "joedb/io/main_exception_catcher.h"

#include <iostream>
Expand All @@ -12,7 +12,7 @@ static int generate_translation_header(int argc, char **argv)
std::cout << "#ifndef translation_declared\n";
std::cout << "#define translation_declared\n\n";

std::cout << "#include \"db/test.h\"\n\n";
std::cout << "#include \"db/test/readonly.h\"\n\n";

std::cout << "namespace my_namespace\n";
std::cout << "{\n";
Expand Down
2 changes: 1 addition & 1 deletion test/compiler/update_large_string.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>

#include "db/schema_v1.h"
#include "db/schema_v1/writable.h"

/////////////////////////////////////////////////////////////////////////////
int main()
Expand Down

0 comments on commit e361830

Please sign in to comment.