Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/flex.git#d13f0a58066616f854749da1b196bacb941dfdea
This commit is contained in:
DistroBaker 2021-02-17 12:05:37 +01:00
parent 8245e5a50d
commit cf60df0c16
11 changed files with 0 additions and 260 deletions

View File

@ -1 +0,0 @@
1

View File

@ -1,19 +0,0 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

View File

@ -1,6 +0,0 @@
summary: CI Gating Plan
discover:
how: fmf
directory: tests
execute:
how: beakerlib

View File

@ -1,63 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/flex/Sanity/smoke-check-flex-runs
# Description: Show your version. Build a one-file project.
# Author: Vaclav Kadlcik <vkadlcik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/flex/Sanity/smoke-check-flex-runs
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE count_chars_and_lines.l calc-lexer.l calc-grammar.y expected_calc_output.txt
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Vaclav Kadlcik <vkadlcik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Show your version. Build a one-file project." >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: flex" >> $(METADATA)
@echo "Requires: flex bison gcc" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/flex/Sanity/smoke-check-flex-runs
Description: Show your version. Build a one-file project.
Author: Vaclav Kadlcik <vkadlcik@redhat.com>

View File

@ -1,36 +0,0 @@
%{
#include <stdio.h>
%}
%token NUMBER
%token ADD SUB MUL DIV
%token EOL
%%
input:
| input EOL { }
| input expression EOL { printf("%d\n", $2); }
;
expression:
factor
| expression ADD factor { $$ = $1 + $3; }
| expression SUB factor { $$ = $1 - $3; }
;
factor:
NUMBER
| factor MUL NUMBER { $$ = $1 * $3; }
| factor DIV NUMBER { $$ = $1 / $3; }
;
%%
int main(int argc, char ** argv) {
yyparse();
}
yyerror(char *s) {
fprintf(stderr, "ERROR: %s\n", s);
}

View File

@ -1,15 +0,0 @@
%option noyywrap
%{
#include "calc-grammar.tab.h"
%}
%%
"+" { return ADD; }
"-" { return SUB; }
"*" { return MUL; }
"/" { return DIV; }
[0-9]+ { yylval = atoi(yytext); return NUMBER; }
\n { return EOL; }
[ \t] { /* ignore whitespaces */ }
. { yyerror("unexpected character %c", *yytext); }
%%

View File

@ -1,21 +0,0 @@
%option noyywrap
%{
#include <stdio.h>
int chars = 0;
int lines = 0;
%}
%%
\n { lines++; chars++; }
. { chars++; }
%%
int main(int argc, char ** argv) {
yylex();
printf("chars: %d\n", chars);
printf("lines: %d\n", lines);
return 0;
}

View File

@ -1,3 +0,0 @@
STDOUT: 7
STDOUT: -221
STDOUT: 42

View File

@ -1,15 +0,0 @@
summary: Show your version. Build a one-file project.
description: ''
contact:
- Vaclav Kadlcik <vkadlcik@redhat.com>
component:
- flex
test: ./runtest.sh
framework: beakerlib
recommend:
- flex
- bison
- gcc
duration: 15m
extra-summary: /tools/flex/Sanity/smoke-check-flex-runs
extra-task: /tools/flex/Sanity/smoke-check-flex-runs

View File

@ -1,78 +0,0 @@
#!/usr/bin/env bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/flex/Sanity/smoke-check-flex-runs
# Description: Show your version. Build a one-file project.
# Author: Vaclav Kadlcik <vkadlcik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="flex"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
yum -y install bison gcc
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "cp count_chars_and_lines.l calc-lexer.l calc-grammar.y expected_calc_output.txt $TmpDir"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest 'Show version'
rlRun -t -s 'flex -V'
rlAssertNotGrep '^STDERR:' $rlRun_LOG
rlAssertGrep '^STDOUT: flex [0-9]' $rlRun_LOG
rlPhaseEnd
rlPhaseStartTest 'Flex works standalone'
rlRun 'flex -o count_chars_and_lines.c count_chars_and_lines.l'
rlRun 'gcc -o count_chars_and_lines count_chars_and_lines.c'
rlAssertExists 'count_chars_and_lines'
rlRun -t -s 'echo -e "nazdar\nbazar" | ./count_chars_and_lines'
rlAssertNotGrep '^STDERR:' $rlRun_LOG
rlAssertGrep '^STDOUT: chars: 13$' $rlRun_LOG
rlAssertGrep '^STDOUT: lines: 2$' $rlRun_LOG
rlPhaseEnd
rlPhaseStartTest 'Flex works with Bison'
rlRun 'bison -d calc-grammar.y'
rlRun 'flex calc-lexer.l'
rlRun 'gcc -o calc calc-grammar.tab.c lex.yy.c'
rlAssertExists 'calc'
rlRun -t -s 'echo -e "1 + 2 * 3\n1 - 666 / 3\n42" | ./calc'
rlAssertNotDiffer expected_calc_output.txt $rlRun_LOG
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd