diff -Nru flexc++-2.11.00/debian/changelog flexc++-2.11.00/debian/changelog --- flexc++-2.11.00/debian/changelog 2022-02-22 12:30:22.000000000 +0000 +++ flexc++-2.11.00/debian/changelog 2022-02-27 20:19:34.000000000 +0000 @@ -1,3 +1,9 @@ +flexc++ (2.11.00-2) unstable; urgency=medium + + * Add autopkgtest that uses to flexc++ to create a basic scanner. + + -- tony mancill Sun, 27 Feb 2022 12:19:34 -0800 + flexc++ (2.11.00-1) unstable; urgency=medium * Constructors of generated scanners have received a third parameter, diff -Nru flexc++-2.11.00/debian/tests/control flexc++-2.11.00/debian/tests/control --- flexc++-2.11.00/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ flexc++-2.11.00/debian/tests/control 2022-02-27 20:19:34.000000000 +0000 @@ -0,0 +1,3 @@ +Tests: run-unit-test +Depends: @, bash, shunit2, g++, libbobcat-dev +Restrictions: allow-stderr diff -Nru flexc++-2.11.00/debian/tests/run-unit-test flexc++-2.11.00/debian/tests/run-unit-test --- flexc++-2.11.00/debian/tests/run-unit-test 1970-01-01 00:00:00.000000000 +0000 +++ flexc++-2.11.00/debian/tests/run-unit-test 2022-02-27 20:19:34.000000000 +0000 @@ -0,0 +1,74 @@ +#!/bin/bash + +set -e +exec 2>&1 + +oneTimeSetUp() { + # very basic lexer + # see https://fbb-git.gitlab.io/flexcpp/manual/flexc++01.html#l4 + cat > ${SHUNIT_TMPDIR}/lexer < ${SHUNIT_TMPDIR}/testflex.cc < +#include "Scanner.h" + +using namespace std; + +int main() +{ + Scanner scanner; + while (scanner.lex()) { + cout << scanner.matched() << " "; + } + cout << "\n"; + return 0; +} +EOF2 + + # some input for our lexer + cat > ${SHUNIT_TMPDIR}/input <