Skip to content

Commit

Permalink
Add todo and test targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Chi-EEE committed Oct 17, 2023
1 parent 3a23b37 commit b78b284
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 6 deletions.
10 changes: 5 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TODO List:

Pass Lidar data from raspberry pi to backend

Pass commands from backend to raspberry pi

Display Lidar data in Svelte
- Pass Lidar data from raspberry pi to backend
- Caleribate the compass
- Authenication to rooms
- Pass commands from backend to raspberry pi
- Display Lidar data in Svelte
21 changes: 20 additions & 1 deletion backend/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,23 @@ target("backend")
end

set_configdir("$(buildir)/$(plat)/$(arch)/$(mode)/config")
add_configfiles("config/*.json", {onlycopy = true})
add_configfiles("config/*.json", {onlycopy = true})


for _, file in ipairs(os.files("tests/test_*.cpp")) do
local name = path.basename(file)
target(name)
set_kind("binary")
set_default(false)
add_packages("boost")
add_packages("fmt", "spdlog")
add_packages("nlohmann_json")
add_packages("oatpp", "oatpp-websocket")
add_packages("tl_expected")
add_files("tests/" .. name .. ".cpp")
add_files("src/controller/**.cc")
-- add_tests("default")
-- add_tests("args", {runargs = {"foo", "bar"}})
-- add_tests("pass_output", {trim_output = true, runargs = "foo", pass_outputs = "hello foo"})
-- add_tests("fail_output", {fail_outputs = {"hello2 .*", "hello xmake"}})
end
18 changes: 18 additions & 0 deletions legacy/repository/packages/j/json-schema-validator-/port/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
add_rules("mode.debug", "mode.release")

add_requires("nlohmann_json")

target("json-schema-validator")
set_kind("$(kind)")
set_languages("cxx17")
add_packages("nlohmann_json")

add_headerfiles("src/(nlohmann/json-schema.hpp)")
add_includedirs("src", { public = true })

add_files("src/**.cpp")
add_headerfiles("src/*.hpp")

if is_plat("windows") then
add_defines("_WIN32")
end
33 changes: 33 additions & 0 deletions legacy/repository/packages/j/json-schema-validator-/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package("json-schema-validator-")
set_homepage("https://github.com/pboettch/json-schema-validator")
set_description("JSON schema validator for JSON for Modern C++")

add_urls("https://github.com/pboettch/json-schema-validator/archive/refs/tags/$(version).tar.gz",
"https://github.com/pboettch/json-schema-validator.git")
add_versions("2.1.0", "83f61d8112f485e0d3f1e72d51610ba3924b179926a8376aef3c038770faf202")

add_deps("nlohmann_json")

on_install(function (package)
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
local configs = {}
if package:config("shared") then
package:add("defines", "JSON_SCHEMA_VALIDATOR_EXPORTS")
end
import("package.tools.xmake").install(package, configs)
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <nlohmann/json-schema.hpp>
using nlohmann::json;
using nlohmann::json_schema::json_validator;
static json person_schema = R"({})"_json;
static void test() {
json_validator validator;
validator.set_root_schema(person_schema);
}
]]}, {configs = {languages = "c++17"}}))
end)

0 comments on commit b78b284

Please sign in to comment.