Browse Source

Formatting

default_compile_flags
vector-of-bool 5 years ago
parent
commit
810c0a69a3
10 changed files with 19 additions and 19 deletions
  1. +1
    -1
      src/dds/build/plan/compile_file.hpp
  2. +1
    -1
      src/dds/catch2_embedded.hpp
  3. +1
    -2
      src/dds/package_manifest.cpp
  4. +1
    -1
      src/dds/repo/remote.hpp
  5. +1
    -1
      src/dds/repo/repo.cpp
  6. +2
    -2
      src/dds/sdist.hpp
  7. +6
    -6
      src/dds/toolchain/from_dds.cpp
  8. +1
    -1
      src/dds/toolchain/from_dds.test.cpp
  9. +2
    -1
      src/dds/toolchain/toolchain.test.cpp
  10. +3
    -3
      src/dds/util/string.test.cpp

+ 1
- 1
src/dds/build/plan/compile_file.hpp View File

shared_compile_file_rules() = default; shared_compile_file_rules() = default;


auto clone() const noexcept { auto clone() const noexcept {
auto cp = *this;
auto cp = *this;
cp._impl = std::make_shared<rules_impl>(*_impl); cp._impl = std::make_shared<rules_impl>(*_impl);
return cp; return cp;
} }

+ 1
- 1
src/dds/catch2_embedded.hpp View File



extern const char* const catch2_embedded_single_header_str; extern const char* const catch2_embedded_single_header_str;


} // namespace dds::detail
} // namespace dds::detail

+ 1
- 2
src/dds/package_manifest.cpp View File

} else if (test_driver_str == "Catch") { } else if (test_driver_str == "Catch") {
ret.test_driver = test_lib::catch_; ret.test_driver = test_lib::catch_;
} else { } else {
throw std::runtime_error(
fmt::format("Unknown 'Test-Driver': '{}'", test_driver_str));
throw std::runtime_error(fmt::format("Unknown 'Test-Driver': '{}'", test_driver_str));
} }
} }



+ 1
- 1
src/dds/repo/remote.hpp View File



#include <dds/sdist.hpp> #include <dds/sdist.hpp>
#include <dds/temp.hpp> #include <dds/temp.hpp>
#include <semver/version.hpp>
#include <libman/library.hpp> #include <libman/library.hpp>
#include <semver/version.hpp>


#include <set> #include <set>
#include <string> #include <string>

+ 1
- 1
src/dds/repo/repo.cpp View File

fs::path repository::default_local_path() noexcept { return dds_data_dir() / "repo"; } fs::path repository::default_local_path() noexcept { return dds_data_dir() / "repo"; }


repository repository::_open_for_directory(bool writeable, path_ref dirpath) { repository repository::_open_for_directory(bool writeable, path_ref dirpath) {
sdist_set entries = load_sdists(dirpath) | to<sdist_set>();
sdist_set entries = load_sdists(dirpath) | to<sdist_set>();
return {writeable, dirpath, std::move(entries)}; return {writeable, dirpath, std::move(entries)};
} }



+ 2
- 2
src/dds/sdist.hpp View File

}; };


struct sdist { struct sdist {
package_manifest manifest;
fs::path path;
package_manifest manifest;
fs::path path;


sdist(package_manifest man, path_ref path_) sdist(package_manifest man, path_ref path_)
: manifest(std::move(man)) : manifest(std::move(man))

+ 6
- 6
src/dds/toolchain/from_dds.cpp View File

ret = {get_compiler(language::cxx), "/nologo", "/EHsc", "<IN>", "/Fe<OUT>"}; ret = {get_compiler(language::cxx), "/nologo", "/EHsc", "<IN>", "/Fe<OUT>"};
} else if (is_gnu_like) { } else if (is_gnu_like) {
ret = {get_compiler(language::cxx), ret = {get_compiler(language::cxx),
"-fPIC",
"-fdiagnostics-color",
"<IN>",
"-pthread",
"-lstdc++fs",
"-o<OUT>"};
"-fPIC",
"-fdiagnostics-color",
"<IN>",
"-pthread",
"-lstdc++fs",
"-o<OUT>"};
} else { } else {
assert(false && "No link-exe command"); assert(false && "No link-exe command");
std::terminate(); std::terminate();

+ 1
- 1
src/dds/toolchain/from_dds.test.cpp View File

std::string_view expected_compile_warnings, std::string_view expected_compile_warnings,
std::string_view expected_ar, std::string_view expected_ar,
std::string_view expected_exe) { std::string_view expected_exe) {
auto tc = dds::parse_toolchain_dds(tc_content);
auto tc = dds::parse_toolchain_dds(tc_content);


dds::compile_file_spec cf; dds::compile_file_spec cf;
cf.source_path = "foo.cpp"; cf.source_path = "foo.cpp";

+ 2
- 1
src/dds/toolchain/toolchain.test.cpp View File



#define CHECK_SHLEX(str, ...) \ #define CHECK_SHLEX(str, ...) \
do { \ do { \
INFO("Shell-lexing string: '" << str << "'"); CHECK(dds::split_shell_string(str) == std::vector<std::string>(__VA_ARGS__)); \
INFO("Shell-lexing string: '" << str << "'"); \
CHECK(dds::split_shell_string(str) == std::vector<std::string>(__VA_ARGS__)); \
} while (0) } while (0)


TEST_CASE("Shell lexer") { TEST_CASE("Shell lexer") {

+ 3
- 3
src/dds/util/string.test.cpp View File

CHECK(!ends_with("foo.bar", "foo")); CHECK(!ends_with("foo.bar", "foo"));
} }


TEST_CASE( "trim" ) {
TEST_CASE("trim") {
CHECK(trim_view("foo") == "foo"); CHECK(trim_view("foo") == "foo");
CHECK(trim_view("foo ") == "foo"); CHECK(trim_view("foo ") == "foo");
CHECK(trim_view(" ").size() == 0); CHECK(trim_view(" ").size() == 0);
} }


TEST_CASE( "contains" ) {
TEST_CASE("contains") {
CHECK(contains("foo", "foo")); CHECK(contains("foo", "foo"));
CHECK(contains("foo", "")); CHECK(contains("foo", ""));
CHECK(contains("foo", "o")); CHECK(contains("foo", "o"));
CHECK(!contains("foo", "bar")); CHECK(!contains("foo", "bar"));
} }


TEST_CASE( "split" ) {
TEST_CASE("split") {
CHECK_SPLIT("foo.bar", ".", {"foo", "bar"}); CHECK_SPLIT("foo.bar", ".", {"foo", "bar"});
CHECK_SPLIT("foo.bar.baz", ".", {"foo", "bar", "baz"}); CHECK_SPLIT("foo.bar.baz", ".", {"foo", "bar", "baz"});
CHECK_SPLIT(".", ".", {"", ""}); CHECK_SPLIT(".", ".", {"", ""});

Loading…
Cancel
Save