Compare commits

..

No commits in common. "c8" and "c8s" have entirely different histories.
c8 ... c8s

8 changed files with 101 additions and 6 deletions

View File

@ -1 +0,0 @@
82a824cf7c8b2eb16dc8ef2ffc270102d4e77efa SOURCES/2.7.0.tar.gz

4
.gitignore vendored
View File

@ -1 +1,3 @@
SOURCES/2.7.0.tar.gz
/1.3.1.tar.gz
/2.6.0.tar.gz
/2.7.0.tar.gz

View File

@ -1,8 +1,9 @@
%global debug_package %{nil}
%bcond_without check
Name: PEGTL
Version: 2.7.0
Release: 1%{?dist}
Release: 3%{?dist}
Summary: Parsing Expression Grammar Template Library
Group: Development/Libraries
License: MIT
@ -30,15 +31,17 @@ applications that use %{name}.
%prep
%setup -q -n %{name}-%{version}
%check
make
%install
install -d -m 0755 %{buildroot}%{_includedir}
pushd include/
cp -R tao/ %{buildroot}%{_includedir}
popd
%if 0%{with check}
%check
make
%endif
%files devel
%doc README.md doc/
%license LICENSE
@ -46,6 +49,12 @@ popd
%{_includedir}/tao/pegtl
%changelog
* Thu Apr 11 2019 Daniel Kopecek <dkopecek@redhat.com> - 2.7.0-3
- spec: use rpm build conditionals for the check phase conditional
* Wed Apr 10 2019 Daniel Kopecek <dkopecek@redhat.com> - 2.7.0-2
- spec: make the check phase conditional
* Wed Aug 01 2018 Daniel Kopecek <dkopecek@redhat.com> - 2.7.0-1
- Update to 2.7.0

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (2.7.0.tar.gz) = 783e1f1c3bd319687fa3300d6c4bfc550f8c50812fbb7e4b51c5db4d26acb07da4637d404c1f15a5dac846b09ff6188c9be3b4e7b2f30d047afb7025f353e909

View File

@ -0,0 +1,45 @@
// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
#include <iostream>
#include <string>
#include <tao/pegtl.hpp>
namespace pegtl = tao::pegtl;
namespace hello
{
// clang-format off
struct prefix : pegtl::string< 'H', 'e', 'l', 'l', 'o', ',', ' ' > {};
struct name : pegtl::plus< pegtl::alpha > {};
struct grammar : pegtl::must< prefix, name, pegtl::one< '!' >, pegtl::eof > {};
// clang-format on
template< typename Rule >
struct action : pegtl::nothing<Rule>
{};
template<>
struct action< name >
{
template< typename Input >
static void apply( const Input& in, std::string& v )
{
v = in.string();
}
};
} // namespace hello
int main( int argc, char** argv )
{
if( argc > 1 ) {
std::string name;
pegtl::argv_input<> in( argv, 1 );
pegtl::parse< hello::grammar, hello::action >( in, name );
std::cout << "Good bye, " << name << "!" << std::endl;
}
}

View File

@ -0,0 +1,20 @@
#!/bin/bash
set -e
TEST_SOURCE=hello_world.cpp
TEST_TARGET="${TEST_SOURCE/\.cpp/}"
CXXFLAGS="$(rpm --eval '%{build_cxxflags}')"
LDFLAGS="$(rpm --eval '%{build_ldflags}')"
# build target using distribution-specific flags
g++ -std=c++11 $CXXFLAGS $LDFLAGS -o $TEST_TARGET $TEST_SOURCE
# test that target exists
test -f ./$TEST_TARGET
# test that target is executable
test -x ./$TEST_TARGET
# test that target runs successfully
./$TEST_TARGET "Hello, world!"

13
tests/tests.yml Normal file
View File

@ -0,0 +1,13 @@
---
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- devel-usability
required_packages:
- gcc-c++
- rpm
- redhat-rpm-config
- PEGTL-devel