Skip to content

Commit

Permalink
experiment with fmt use
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrush committed Sep 14, 2020
1 parent d11971f commit ad3d1a1
Show file tree
Hide file tree
Showing 18 changed files with 9,380 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cmake/Setup3rdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ include_directories(thirdparty_builtin/libyaml-690a781/include)
add_subdirectory(thirdparty_builtin/civetweb-0a95342/)
include_directories(thirdparty_builtin/civetweb-0a95342/include)

################################
# Setup includes for fmt
################################
include_directories(thirdparty_builtin/fmt-5.0.3/)


################################
# Optional Features
################################
Expand Down
3 changes: 3 additions & 0 deletions src/tests/thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ add_cpp_test(TEST t_libyaml_smoke
SOURCES $<TARGET_OBJECTS:conduit_libyaml>
FOLDER tests/thirdparty)

add_cpp_test(TEST t_fmt_smoke
FOLDER tests/thirdparty)


set(civet_test_deps ${CIVETWEB_LIB_DEPENDS})

Expand Down
60 changes: 60 additions & 0 deletions src/tests/thirdparty/t_fmt_smoke.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) 2014-2019, Lawrence Livermore National Security, LLC.
//
// Produced at the Lawrence Livermore National Laboratory
//
// LLNL-CODE-666778
//
// All rights reserved.
//
// This file is part of Conduit.
//
// For details, see: http://software.llnl.gov/conduit/.
//
// Please also read conduit/LICENSE
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the disclaimer below.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the disclaimer (as noted below) in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the LLNS/LLNL nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
// LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//-----------------------------------------------------------------------------
///
/// file: t_fmt_smoke.cpp
///
//-----------------------------------------------------------------------------

#include <iostream>
#include "gtest/gtest.h"

#include "fmt/conduit_fmt.h"

TEST(libb64_smoke, basic_use )
{
std::string res = fmt::format("The answer is {}.", 42);
EXPECT_EQ(res, "The answer is 42.");
}
10 changes: 10 additions & 0 deletions src/thirdparty_builtin/fmt-5.0.3/conduit_readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
2020-09-11

Header-only source extracted from the fmt 7.0.3 release tarball

https://github.com/fmtlib/fmt/releases/tag/7.0.3

Added header (fmt/fmt.h) to simplify header only use
(following path paved by Axom)

License: MIT
Loading

0 comments on commit ad3d1a1

Please sign in to comment.