Skip to content

Commit

Permalink
fix several bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ggeorgiev committed Jun 13, 2016
1 parent f3d50eb commit b5256f6
Show file tree
Hide file tree
Showing 24 changed files with 37 additions and 28 deletions.
2 changes: 2 additions & 0 deletions src/3rdparty/boost.dbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cxx_library /boost_template
@directory=../../boost/include:

boost/asio.hpp
boost/asio/io_service.hpp
boost/crc.hpp
boost/functional/hash.hpp
boost/functional/hash/hash.hpp
Expand All @@ -26,6 +27,7 @@ cxx_library /boost_template
@visibility=protected
@directory=../../boost/include:

boost/asio/impl/io_service.ipp
boost/variant/detail/apply_visitor_unary.hpp
boost/variant/detail/hash_variant.hpp
;
Expand Down
1 change: 1 addition & 0 deletions src/config.dbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
verbose:
-crc
-inspect
-sys
-db
-parse
Expand Down
1 change: 1 addition & 0 deletions src/db/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <rocksdb/options.h>
#include <rocksdb/slice.h>
#include <rocksdb/status.h>
#include "fmt/format.h"
#include <functional>

namespace db
Expand Down
6 changes: 2 additions & 4 deletions src/doim/gtest/set_manager-utest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ TEST(SetManagerTest, find)

TEST(SetManagerTest, combine)
{
auto tags1 =
doim::TagSet::make(doim::TagSet{doim::gTaskTag, doim::gRunTag, doim::gDoneTag});
auto tags2 =
doim::TagSet::make(doim::TagSet{doim::gCrcTag, doim::gRunTag, doim::gDoneTag});
auto tags1 = doim::TagSet::unique({doim::gTaskTag, doim::gRunTag, doim::gDoneTag});
auto tags2 = doim::TagSet::unique({doim::gCrcTag, doim::gRunTag, doim::gDoneTag});

auto comb1 = tags1->combine(tags2);
auto comb2 = tags2->combine(tags1);
Expand Down
8 changes: 3 additions & 5 deletions src/doim/gtest/tag/tag_expression-utest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@

TEST(TagExpressionTest, patternMatch)
{
doim::TagSetSPtr pattern = doim::TagSet::unique(doim::TagSet::make(doim::TagSet{}));
doim::TagSetSPtr pattern = doim::TagSet::unique({});

doim::TagSetSPtr pattern1 =
doim::TagSet::unique(doim::TagSet::make(doim::TagSet{doim::gCrcTag}));
doim::TagSetSPtr pattern2 = doim::TagSet::unique(
doim::TagSet::make(doim::TagSet{doim::gCrcTag, doim::gDbTag}));
doim::TagSetSPtr pattern1 = doim::TagSet::unique({doim::gCrcTag});
doim::TagSetSPtr pattern2 = doim::TagSet::unique({doim::gCrcTag, doim::gDbTag});

doim::TagSetSPtr tags = pattern;
doim::TagSetSPtr tags1 = pattern1;
Expand Down
2 changes: 1 addition & 1 deletion src/doim/tag/tag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace doim
{
TagSPtr gCrcTag = Tag::global("crc", gCrcTag);
TagSPtr gDependTag = Tag::global("depend", gDependTag);
TagSPtr gInspectTag = Tag::global("inspect", gInspectTag);

TagSPtr gDbTag = Tag::global("db", gDbTag);
TagSPtr gParseTag = Tag::global("parse", gParseTag);
Expand Down
4 changes: 3 additions & 1 deletion src/doim/tag/tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
#include "doim/element.hpp"
#include "doim/set.hpp"
#include <boost/hana/for_each.hpp>
#include <functional>
#include <memory>
#include <str>
#include <tuple>
#include <unordered>

namespace doim
{
Expand All @@ -32,7 +34,7 @@ class Tag : public Element<Tag, string>
};

extern TagSPtr gCrcTag;
extern TagSPtr gDependTag;
extern TagSPtr gInspectTag;

extern TagSPtr gDbTag;
extern TagSPtr gParseTag;
Expand Down
3 changes: 3 additions & 0 deletions src/engine/cxx_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "doim/cxx/cxx_header.h"
#include "doim/cxx/cxx_include_directory.h"
#include "doim/cxx/cxx_program.h"
#include "doim/db/db_value.hpp"
#include "doim/fs/fs_file.h"
#include "doim/protobuf/protobuf_file.h"
#include "doim/sys/sys_command.h"
Expand All @@ -26,8 +27,10 @@
#include "err/err.h"
#include "err/err_assert.h"
#include "im/initialization_manager.hpp"
#include "log/log.h"
#include "math/crc.hpp"
#include "rtti/class_rtti.hpp"
#include <boost/hana/for_each.hpp>
#include <algorithm>
#include <functional>
#include <str>
Expand Down
1 change: 1 addition & 0 deletions src/rpc/client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//

#include "rpc/client/client.h"
#include <boost/asio.hpp>
#include <cstdlib>
#include <iostream>
#include <thread>
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include <boost/asio.hpp>
#include <boost/asio/io_service.hpp>

namespace rpc
{
Expand Down
6 changes: 2 additions & 4 deletions src/rpc/server/server.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// Copyright © 2016 George Georgiev. All rights reserved.
//

#include <boost/asio.hpp>
#include <boost/asio.hpp> // IWYU pragma: keep
#include <cstdlib>
#include <deque>
#include <iostream>
#include <list>
#include <memory>
#include <set>
#include <utility>
#include <type_traits>

using boost::asio::ip::tcp;

Expand Down
4 changes: 2 additions & 2 deletions src/task/cxx/cxx_object_file_crc_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ bool CxxObjectFileCrcTask::check() const
return cxxObjectFile() != nullptr && cxxObjectFile()->isUnique();
}

static doim::TagSetSPtr gTags =
doim::TagSet::global({&doim::gCrcTag, &doim::gCxxTag, &doim::gObjTag}, gTags);
static doim::TagSetSPtr gTags = doim::TagSet::global(
{&doim::gCrcTag, &doim::gInspectTag, &doim::gCxxTag, &doim::gObjTag}, gTags);

doim::TagSetSPtr CxxObjectFileCrcTask::tags() const
{
Expand Down
4 changes: 2 additions & 2 deletions src/task/cxx/cxx_program_crc_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ bool CxxProgramCrcTask::check() const
return cxxProgram() != nullptr && cxxProgram()->isUnique();
}

static doim::TagSetSPtr gTags =
doim::TagSet::global({&doim::gCrcTag, &doim::gCxxTag, &doim::gProgramTag}, gTags);
static doim::TagSetSPtr gTags = doim::TagSet::global(
{&doim::gCrcTag, &doim::gInspectTag, &doim::gCxxTag, &doim::gProgramTag}, gTags);

doim::TagSetSPtr CxxProgramCrcTask::tags() const
{
Expand Down
2 changes: 1 addition & 1 deletion src/task/cxx/cxx_source_crc_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bool CxxSourceCrcTask::check() const
}

static doim::TagSetSPtr gTags =
doim::TagSet::global({&doim::gCrcTag, &doim::gCxxTag}, gTags);
doim::TagSet::global({&doim::gCrcTag, &doim::gInspectTag, &doim::gCxxTag}, gTags);

doim::TagSetSPtr CxxSourceCrcTask::tags() const
{
Expand Down
2 changes: 1 addition & 1 deletion src/task/cxx/cxx_source_headers_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bool CxxSourceHeadersTask::check() const
}

static doim::TagSetSPtr gTags =
doim::TagSet::global({&doim::gDependTag, &doim::gCxxTag}, gTags);
doim::TagSet::global({&doim::gInspectTag, &doim::gCxxTag}, gTags);

doim::TagSetSPtr CxxSourceHeadersTask::tags() const
{
Expand Down
1 change: 0 additions & 1 deletion src/task/db/db_put_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "task/db/db_put_task.h"

#include "db/database.h"
#include "err/err_assert.h"
#include <str>

namespace task
Expand Down
1 change: 1 addition & 0 deletions src/task/db/db_put_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "doim/tag/tag.h"
#include "err/err.h"
#include <fmt/format.h>
#include <boost/hana/for_each.hpp>
#include <memory>
#include <str>
#include <tuple>
Expand Down
1 change: 1 addition & 0 deletions src/task/gtest/cxx/cxx_file_crc_task-utest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "err/gtest/err.h"
#include "gtest/framework.h"
#include "gtest/test_resource.h"
#include <fmt/format.h>
#include <memory>
#include <ostream>

Expand Down
1 change: 1 addition & 0 deletions src/task/gtest/cxx/cxx_header_crc_task-utest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "err/gtest/err.h"
#include "gtest/framework.h"
#include "gtest/test_resource.h"
#include "fmt/format.h"
#include <memory>
#include <ostream>

Expand Down
3 changes: 2 additions & 1 deletion src/task/protobuf/protobuf_file_crc_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ bool ProtobufFileCrcTask::check() const
}

static doim::TagSetSPtr gTags =
doim::TagSet::global({&doim::gCrcTag, &doim::gProtobufTag}, gTags);
doim::TagSet::global({&doim::gCrcTag, &doim::gInspectTag, &doim::gProtobufTag},
gTags);

doim::TagSetSPtr ProtobufFileCrcTask::tags() const
{
Expand Down
2 changes: 1 addition & 1 deletion src/task/sys/execute_command_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace task
bool ExecuteCommandTask::check() const
{
return command() != nullptr && command()->isUnique() &&
targetDirectory() != nullptr && targetDirectory()->isUnique();
(targetDirectory() == nullptr || targetDirectory()->isUnique());
}

static doim::TagSetSPtr gTags = doim::TagSet::global({&doim::gSysTag}, gTags);
Expand Down
2 changes: 1 addition & 1 deletion src/task/sys/parse_stdout_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ParseStdoutTask::ParseStdoutTask(const doim::SysCommandSPtr& command,
bool ParseStdoutTask::check() const
{
return command() != nullptr && command()->isUnique() &&
targetDirectory() != nullptr && targetDirectory()->isUnique();
(targetDirectory() == nullptr || targetDirectory()->isUnique());
}

static doim::TagSetSPtr gTags = doim::TagSet::global({}, gTags);
Expand Down
2 changes: 2 additions & 0 deletions src/task/sys/parse_stdout_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
#include "task/element_manager.hpp"
#include "doim/fs/fs_directory.h"
#include "doim/sys/sys_command.h"
#include "doim/tag/tag.h"
#include "err/err.h"
#include "rtti/class_rtti.hpp"
#include <fmt/format.h>
#include <boost/hana/for_each.hpp>
#include <functional>
#include <shared_ptr>
#include <str>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@
</CommandLineArgument>
<CommandLineArgument
argument = "build"
isEnabled = "YES">
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "iwyu"
isEnabled = "NO">
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "dbs"
Expand Down

0 comments on commit b5256f6

Please sign in to comment.