mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-02-07 02:09:52 +08:00
Merge pull request #62 from fastfloat/dlemire/test_installation
Testing installation in CI
This commit is contained in:
commit
f41410b91f
27
.github/workflows/ubuntu20.yml
vendored
27
.github/workflows/ubuntu20.yml
vendored
@ -15,20 +15,13 @@ jobs:
|
|||||||
#- {cxx: , arch: -DCMAKE_CXX_FLAGS="-m32"} # default=gcc9
|
#- {cxx: , arch: -DCMAKE_CXX_FLAGS="-m32"} # default=gcc9
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Setup cmake
|
- name: Use cmake
|
||||||
uses: jwlawson/actions-setup-cmake@v1.4
|
run: |
|
||||||
with:
|
mkdir build &&
|
||||||
cmake-version: '3.11.x'
|
cd build &&
|
||||||
#- name: install older compilers
|
cmake ${{matrix.cxx}} ${{matrix.arch}} -DFASTFLOAT_TEST=ON -DCMAKE_INSTALL_PREFIX:PATH=destination .. &&
|
||||||
# run: |
|
cmake --build . &&
|
||||||
# sudo -E dpkg --add-architecture i386
|
ctest --output-on-failure &&
|
||||||
# sudo -E apt-get update
|
cmake --install . &&
|
||||||
# sudo -E apt-get install -y g++-8 g++-8-multilib g++-multilib linux-libc-dev:i386 libc6:i386 libc6-dev:i386 libc6-dbg:i386
|
cd ../tests/installation_tests/find &&
|
||||||
- name: Prepare build dir
|
mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=../../../build/destination .. && cmake --build .
|
||||||
run: mkdir build
|
|
||||||
- name: Configure
|
|
||||||
run: cd build && cmake ${{matrix.cxx}} ${{matrix.arch}} -DFASTFLOAT_TEST=ON ..
|
|
||||||
- name: Build
|
|
||||||
run: cmake --build build
|
|
||||||
- name: Run basic tests
|
|
||||||
run: cd build && ctest --output-on-failure -R basictest
|
|
||||||
18
.github/workflows/vs16-ci.yml
vendored
18
.github/workflows/vs16-ci.yml
vendored
@ -15,13 +15,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Configure
|
- name: Use cmake
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build &&
|
||||||
cd build && cmake -G "${{matrix.gen}}" -A ${{matrix.arch}} -DFASTFLOAT_TEST=ON ..
|
cd build &&
|
||||||
- name: Build
|
cmake ${{matrix.cxx}} ${{matrix.arch}} -DFASTFLOAT_TEST=ON -DCMAKE_INSTALL_PREFIX:PATH=destination .. &&
|
||||||
run: cmake --build build --config Release --parallel
|
cmake --build . &&
|
||||||
- name: Run basic tests
|
ctest --output-on-failure &&
|
||||||
run: |
|
cmake --install . &&
|
||||||
cd build
|
cd ../tests/installation_tests/find &&
|
||||||
ctest -C Release --output-on-failure -R basictest
|
mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=../../../build/destination .. && cmake --build .
|
||||||
28
tests/installation_tests/find/CMakeLists.txt
Normal file
28
tests/installation_tests/find/CMakeLists.txt
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
|
project(test_simdjson_install VERSION 0.1.0 LANGUAGES CXX)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
find_package(FastFloat REQUIRED)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
file(WRITE main.cpp "
|
||||||
|
#include \"fast_float/fast_float.h\"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
const std::string input = \"3.1416 xyz \";
|
||||||
|
double result;
|
||||||
|
auto answer = fast_float::from_chars(input.data(), input.data()+input.size(), result);
|
||||||
|
if(answer.ec != std::errc()) { std::cerr << \"parsing failure\\n\"; return EXIT_FAILURE; }
|
||||||
|
std::cout << \"parsed the number \" << result << std::endl;
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
add_executable(repro main.cpp)
|
||||||
|
target_link_libraries(repro PUBLIC FastFloat::fast_float)
|
||||||
Loading…
x
Reference in New Issue
Block a user