├── .gitignore ├── .gitlab-ci.yml ├── .gitmodules ├── AUTHORS ├── Android.mk ├── COPYING ├── Dockerfile ├── Dockerfile.fmbt-cli ├── Dockerfile.fmbt-gui ├── HACKING ├── KNOWN_ISSUES ├── Makefile.am ├── README ├── README-windows.txt ├── SECURITY.md ├── autodebug ├── README.md ├── bin │ ├── autodebug │ └── valgrind-autodebug ├── examples │ └── buggy │ │ ├── Makefile │ │ ├── README.md │ │ └── buggy.c └── setup.py ├── autogen.sh ├── bogus ├── build-fMBT-installer-winXX.exe.sh ├── build-fMBT-packages-linux.sh ├── configure.ac ├── debian ├── changelog ├── compat ├── control ├── copyright ├── fmbt-adapter-android.install ├── fmbt-adapter-chromiumos.install ├── fmbt-adapter-eyenfinger.install ├── fmbt-adapter-tizen.install ├── fmbt-adapter-vnc.install ├── fmbt-adapter-windows.install ├── fmbt-adapter-x11.install ├── fmbt-adapters-remote.install ├── fmbt-core.install ├── fmbt-coreutils.install ├── fmbt-dev.install ├── fmbt-doc.install ├── fmbt-editor.install ├── fmbt-examples.install ├── fmbt-python.install ├── fmbt-pythonshare.install ├── fmbt-utils.install ├── rules └── source │ └── format ├── doc ├── aal_python.txt ├── adapters.txt ├── architecture.txt ├── configuration.txt ├── reporting.txt └── tutorial.txt ├── docker ├── Dockerfile └── build_fmbt_windows_docker.sh ├── examples ├── Makefile.am ├── aal-components │ ├── README │ ├── aal_lib │ │ ├── calc.actions │ │ └── clock.actions │ ├── basesystem.aal │ └── fullsystem.conf ├── aal_robot │ ├── README │ ├── browser.robot │ ├── robot.aal │ ├── robot_adapter.py │ ├── test.conf │ └── test.robot ├── c++-unittest │ ├── Makefile │ ├── README │ ├── mycounter.cc │ ├── mycounter.h │ ├── mycountertest.cc.aal │ └── test.conf ├── filesystemtest │ ├── Makefile │ ├── README │ ├── filesystemtest.aal │ ├── filesystemtest.cc.aal │ ├── filesystemtest.cc.conf │ ├── filesystemtest.conf │ └── filesystemtest.lsts.conf ├── fmbtcourse-camera-pygt │ ├── README │ ├── camera.py │ ├── capture-py.conf │ ├── capture-py.gt │ └── teststeps.py ├── gt-components │ ├── README │ ├── endmeeting.gt.inc │ ├── meeting.conf │ ├── meeting.gt │ ├── present.gt.inc │ └── question.gt ├── input-devices │ ├── README.md │ ├── caps_and_numpad_is_mouse.py │ └── xmodmap-capsnumpad ├── java-unittest │ ├── Makefile │ ├── MyCounter.java │ ├── README │ ├── mycountertestfalse.java.aal │ ├── mycountertesttrue.java.aal │ ├── testfalse.conf │ └── testtrue.conf ├── javascript-unittest │ ├── README │ ├── mycounter.js │ ├── mycountertest.aal │ ├── regressiontest.conf │ ├── reliabilitytest.conf │ ├── smoketest.conf │ └── test.html ├── link-layer-protocol │ ├── abp.aal │ └── abp.conf ├── offline-test-suite │ ├── README │ ├── generate-all-tests │ ├── weakly-connected.conf │ └── weakly-connected.gt ├── python-unittest │ ├── mycounter.py │ ├── mycountertest.py.aal │ └── test.conf ├── shell-configurationtest │ ├── README │ └── test-configurations.sh ├── shortener │ ├── Makefile │ ├── mycounter.cc │ ├── mycounter.h │ ├── mycountertest.cc.aal │ ├── shortener.sh │ ├── test.conf │ ├── test.crules │ ├── test_shortener.conf │ └── testmodel.gt ├── uc │ ├── Makefile │ └── test.uc └── usb-connect-disconnect │ └── usb-conn-disconn.aal ├── exec_wrapper.c ├── fMBT.spec.in ├── fmbt.ico ├── fmbt.nsis.in ├── license.rtf ├── m4 └── .gitignore ├── man ├── fmbt-aalc.1 ├── fmbt-aalp.1 ├── fmbt-editor.1 ├── fmbt-gt.1 ├── fmbt-log.1 ├── fmbt-scripter.1 ├── fmbt-trace-share.1 ├── fmbt-view.1 ├── fmbt.1 └── remote_pyaal.1 ├── misc └── aal-mode.el ├── packaging ├── Makefile ├── fmbt.dsc.in └── fmbt.spec ├── python3-remotedevices ├── debian │ ├── changelog │ ├── compat │ ├── control │ └── rules ├── remotedevices-ctl ├── remotedevices-server ├── remotedevices.py ├── remotedevices_plugins │ ├── __init__.py │ ├── androiddevices.py │ ├── example_lightbulbs.py │ └── yoctorelay.py ├── remotedevices_server.py └── setup.py ├── python3share ├── Makefile.am ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ └── rules ├── man │ ├── python3share-client.1 │ └── python3share-server.1 ├── python3share-client ├── python3share-server ├── python3share │ ├── __init__.py │ ├── client.py │ ├── messages.py │ ├── server.py │ └── upickle.py ├── setup.py └── tests │ ├── ps-win.conf │ ├── ps.aal │ ├── ps.conf │ ├── ps.py │ ├── python3share-client.bat │ └── python3share-server.bat ├── pythonshare ├── MANIFEST.in ├── Makefile.am ├── README.md ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ └── rules ├── docker │ ├── Dockerfile │ ├── build_pythonshare_docker.sh │ └── cpython.Modules.Setup.dist.patch ├── man │ ├── pythonshare-client.1 │ └── pythonshare-server.1 ├── packaging │ ├── Makefile │ ├── pythonshare.dsc.in │ └── pythonshare.spec ├── pythonshare-client ├── pythonshare-server ├── pythonshare │ ├── __init__.py │ ├── client.py │ ├── messages.py │ └── server.py ├── setup.py └── tests │ ├── README.txt │ ├── onlinetests.py │ ├── ps.aal │ ├── ps.conf │ ├── ps.py │ └── psmap.py ├── remotedevices ├── README ├── debian │ ├── changelog │ ├── compat │ ├── control │ └── rules ├── remotedevices-ctl ├── remotedevices-server ├── remotedevices.py ├── remotedevices_plugins │ ├── __init__.py │ ├── androiddevices.py │ ├── example_lightbulbs.py │ └── yoctorelay.py ├── remotedevices_server.py ├── setup.py └── tests │ ├── perms-parallel.conf │ ├── perms.conf │ ├── rd.aal │ ├── rd.py │ ├── run-parallel.sh │ ├── run.sh │ └── smoke.conf ├── src ├── Android.mk ├── Application.mk ├── Makefile.am ├── Sources.mk ├── aal.cc ├── aal.hh ├── aal_java.cc ├── aal_java.hh ├── aal_loader.cc ├── aal_remote.cc ├── aal_remote.hh ├── aalang.hh ├── aalang_action.hh ├── aalang_cpp.cc ├── aalang_cpp.hh ├── aalang_java.cc ├── aalang_java.hh ├── aalang_py.cc ├── aalang_py.hh ├── aalang_py3.cc ├── aalang_py3.hh ├── aalang_tag.cc ├── aalang_tag.hh ├── aalp.ll ├── adapter.cc ├── adapter.hh ├── adapter_dlopen.cc ├── adapter_dlopen.hh ├── adapter_dummy.cc ├── adapter_dummy.hh ├── adapter_lib.cc ├── adapter_mapper.cc ├── adapter_mapper.hh ├── adapter_model.cc ├── adapter_model.hh ├── adapter_remote.cc ├── adapter_remote.hh ├── adapter_rly08btech.cc ├── adapter_rly08btech.hh ├── adapter_timer.cc ├── adapter_timer.hh ├── adapter_v4l2.cc ├── adapter_v4l2.hh ├── alg_bdfs.cc ├── alg_bdfs.hh ├── alphabet.hh ├── alphabet_impl.hh ├── awrapper.cc ├── awrapper.hh ├── conf.cc ├── conf.g ├── conf.hh ├── coverage.cc ├── coverage.hh ├── coverage_avoid.cc ├── coverage_avoid.hh ├── coverage_const.cc ├── coverage_const.hh ├── coverage_end_condition.cc ├── coverage_end_condition.hh ├── coverage_exec_filter.cc ├── coverage_exec_filter.hh ├── coverage_if.cc ├── coverage_if.hh ├── coverage_include.cc ├── coverage_include.hh ├── coverage_join.cc ├── coverage_join.hh ├── coverage_mapper.cc ├── coverage_mapper.hh ├── coverage_market.cc ├── coverage_market.hh ├── coverage_min.cc ├── coverage_min.hh ├── coverage_nohistory.cc ├── coverage_nohistory.hh ├── coverage_notice.cc ├── coverage_notice.hh ├── coverage_of.cc ├── coverage_of.hh ├── coverage_paths.cc ├── coverage_paths.hh ├── coverage_prop.cc ├── coverage_prop.hh ├── coverage_proxy.cc ├── coverage_proxy.hh ├── coverage_random.cc ├── coverage_random.hh ├── coverage_report.cc ├── coverage_report.hh ├── coverage_report_filter.cc ├── coverage_report_filter.hh ├── coverage_restart.cc ├── coverage_restart.hh ├── coverage_set.cc ├── coverage_set.hh ├── coverage_shared.cc ├── coverage_shared.hh ├── coverage_short.cc ├── coverage_short.hh ├── coverage_tema_seq.cc ├── coverage_tema_seq.hh ├── coverage_trace.cc ├── coverage_trace.hh ├── coverage_tree.cc ├── coverage_tree.hh ├── coverage_uniq.cc ├── coverage_uniq.hh ├── covlang.g ├── d │ ├── 4calc.g │ ├── 4calc.in │ ├── BUILD_VERSION │ ├── C.g │ ├── CHANGES │ ├── COPYRIGHT │ ├── Makefile │ ├── README │ ├── arg.c │ ├── arg.h │ ├── baseline │ ├── calc │ ├── d.h │ ├── dparse.h │ ├── dparse_tables.h │ ├── dparse_tree.c │ ├── dparse_tree.h │ ├── driver_parsetree.c │ ├── dsymtab.h │ ├── faq.html │ ├── gram.c │ ├── gram.h │ ├── gramgram.h │ ├── grammar.g │ ├── grammar.g.c │ ├── index.html │ ├── lex.c │ ├── lex.h │ ├── lr.c │ ├── lr.h │ ├── make_dparser.1 │ ├── make_dparser.c │ ├── make_dparser.cat │ ├── manual.html │ ├── mkdparse.c │ ├── mkdparse.h │ ├── my.c │ ├── my.g │ ├── parse.c │ ├── parse.h │ ├── parser_tests │ ├── python │ │ ├── Makefile │ │ ├── README │ │ ├── contrib │ │ │ ├── dparserpy-syntax_error.py │ │ │ └── dparserpy.el │ │ ├── dparser.i │ │ ├── dparser.py │ │ ├── index.html │ │ ├── make_tables.c │ │ ├── py_dparser_manual.html │ │ ├── pydparser.c │ │ ├── pydparser.h │ │ ├── setup.py │ │ └── tests │ │ │ ├── test.py │ │ │ ├── test2.py │ │ │ ├── test3.py │ │ │ ├── test4.py │ │ │ ├── test5.py │ │ │ ├── test6.py │ │ │ └── test7.py │ ├── read_binary.c │ ├── read_binary.h │ ├── sample.g │ ├── sample_parser.c │ ├── scan.c │ ├── scan.h │ ├── symtab.c │ ├── test_parser.c │ ├── tests │ │ ├── 1.g │ │ ├── ansic.test.g │ │ ├── ansic.test.g.1 │ │ ├── ansic.test.g.1.check │ │ ├── ansic.test.g.1.out │ │ ├── ansic.test.g.2.check │ │ ├── bnf.g │ │ ├── bnf.g.1 │ │ ├── g1.test.g │ │ ├── g1.test.g.1 │ │ ├── g1.test.g.1.check │ │ ├── g1.test.g.1.out │ │ ├── g10.test.g │ │ ├── g10.test.g.1 │ │ ├── g10.test.g.1.check │ │ ├── g10.test.g.1.out │ │ ├── g11.test.g │ │ ├── g11.test.g.1 │ │ ├── g11.test.g.1.check │ │ ├── g11.test.g.1.out │ │ ├── g11.test.g.2 │ │ ├── g11.test.g.2.check │ │ ├── g11.test.g.2.out │ │ ├── g11.test.g.3 │ │ ├── g11.test.g.3.check │ │ ├── g11.test.g.3.out │ │ ├── g12.test.g │ │ ├── g12.test.g.1 │ │ ├── g12.test.g.1.check │ │ ├── g12.test.g.1.out │ │ ├── g13.test.g │ │ ├── g13.test.g.1 │ │ ├── g13.test.g.1.check │ │ ├── g13.test.g.1.out │ │ ├── g14.test.g │ │ ├── g14.test.g.1 │ │ ├── g14.test.g.1.check │ │ ├── g14.test.g.1.out │ │ ├── g15.test.g │ │ ├── g15.test.g.1 │ │ ├── g15.test.g.1.check │ │ ├── g15.test.g.1.out │ │ ├── g16.test.g │ │ ├── g16.test.g.1 │ │ ├── g16.test.g.1.check │ │ ├── g16.test.g.1.out │ │ ├── g17.test.g │ │ ├── g17.test.g.1 │ │ ├── g17.test.g.1.check │ │ ├── g17.test.g.1.out │ │ ├── g18.test.g │ │ ├── g18.test.g.1 │ │ ├── g18.test.g.1.check │ │ ├── g18.test.g.1.out │ │ ├── g19.test.g │ │ ├── g19.test.g.1 │ │ ├── g19.test.g.1.check │ │ ├── g19.test.g.1.out │ │ ├── g2.test.g │ │ ├── g2.test.g.1 │ │ ├── g2.test.g.1.check │ │ ├── g2.test.g.1.out │ │ ├── g20.test.g │ │ ├── g20.test.g.1 │ │ ├── g20.test.g.1.check │ │ ├── g20.test.g.1.out │ │ ├── g21.test.g │ │ ├── g21.test.g.1 │ │ ├── g21.test.g.1.check │ │ ├── g21.test.g.1.out │ │ ├── g22.test.g │ │ ├── g22.test.g.1 │ │ ├── g22.test.g.1.check │ │ ├── g22.test.g.1.out │ │ ├── g23.test.g │ │ ├── g23.test.g.1 │ │ ├── g23.test.g.1.check │ │ ├── g23.test.g.1.out │ │ ├── g24.test.g │ │ ├── g24.test.g.1 │ │ ├── g24.test.g.1.check │ │ ├── g24.test.g.1.out │ │ ├── g25.test.g │ │ ├── g25.test.g.1 │ │ ├── g25.test.g.1.check │ │ ├── g25.test.g.1.out │ │ ├── g26.test.g │ │ ├── g26.test.g.1 │ │ ├── g26.test.g.1.check │ │ ├── g26.test.g.1.out │ │ ├── g27.test.g │ │ ├── g27.test.g.1 │ │ ├── g27.test.g.1.check │ │ ├── g27.test.g.1.out │ │ ├── g28.test.g │ │ ├── g28.test.g.1 │ │ ├── g28.test.g.1.check │ │ ├── g28.test.g.1.out │ │ ├── g28.test.g.2 │ │ ├── g28.test.g.2.check │ │ ├── g28.test.g.2.out │ │ ├── g29.test.g │ │ ├── g29.test.g.1 │ │ ├── g29.test.g.1.check │ │ ├── g29.test.g.1.out │ │ ├── g3.test.g │ │ ├── g3.test.g.1 │ │ ├── g3.test.g.1.check │ │ ├── g3.test.g.1.out │ │ ├── g30.test.g │ │ ├── g30.test.g.1 │ │ ├── g30.test.g.1.check │ │ ├── g30.test.g.1.out │ │ ├── g31.test.g │ │ ├── g31.test.g.1 │ │ ├── g31.test.g.1.check │ │ ├── g31.test.g.1.out │ │ ├── g32.test.g │ │ ├── g32.test.g.1 │ │ ├── g32.test.g.1.check │ │ ├── g32.test.g.1.out │ │ ├── g33.test.g │ │ ├── g33.test.g.1 │ │ ├── g33.test.g.1.check │ │ ├── g33.test.g.1.out │ │ ├── g34.test.g │ │ ├── g34.test.g.1 │ │ ├── g34.test.g.1.check │ │ ├── g34.test.g.1.out │ │ ├── g35.test.g │ │ ├── g35.test.g.1 │ │ ├── g35.test.g.1.check │ │ ├── g35.test.g.1.out │ │ ├── g36.test.g │ │ ├── g36.test.g.1 │ │ ├── g36.test.g.1.check │ │ ├── g36.test.g.1.out │ │ ├── g37.test.g │ │ ├── g37.test.g.1 │ │ ├── g37.test.g.1.check │ │ ├── g37.test.g.1.out │ │ ├── g38.test.g │ │ ├── g38.test.g.1 │ │ ├── g38.test.g.1.check │ │ ├── g38.test.g.1.flags │ │ ├── g38.test.g.1.out │ │ ├── g38.test.g.flags │ │ ├── g39.test.g │ │ ├── g39.test.g.1 │ │ ├── g39.test.g.1.check │ │ ├── g39.test.g.1.out │ │ ├── g4.test.g │ │ ├── g4.test.g.1 │ │ ├── g4.test.g.1.check │ │ ├── g4.test.g.1.out │ │ ├── g40.test.g │ │ ├── g40.test.g.1 │ │ ├── g40.test.g.1.check │ │ ├── g40.test.g.1.out │ │ ├── g41.test.g │ │ ├── g41.test.g.1 │ │ ├── g41.test.g.1.check │ │ ├── g41.test.g.1.out │ │ ├── g42.include.g │ │ ├── g42.test.g │ │ ├── g42.test.g.1 │ │ ├── g42.test.g.1.check │ │ ├── g42.test.g.1.out │ │ ├── g43.test.g │ │ ├── g43.test.g.1 │ │ ├── g43.test.g.1.check │ │ ├── g43.test.g.1.out │ │ ├── g43.test.g.2 │ │ ├── g43.test.g.2.check │ │ ├── g43.test.g.2.flags │ │ ├── g43.test.g.2.out │ │ ├── g43.test.g.3 │ │ ├── g43.test.g.3.check │ │ ├── g43.test.g.3.flags │ │ ├── g43.test.g.3.out │ │ ├── g44.test.g │ │ ├── g44.test.g.1 │ │ ├── g44.test.g.1.check │ │ ├── g44.test.g.1.out │ │ ├── g45.test.g │ │ ├── g45.test.g.1 │ │ ├── g45.test.g.1.check │ │ ├── g45.test.g.1.out │ │ ├── g46.test.g │ │ ├── g46.test.g.1 │ │ ├── g46.test.g.1.check │ │ ├── g46.test.g.1.out │ │ ├── g47.test.g │ │ ├── g47.test.g.1 │ │ ├── g47.test.g.1.check │ │ ├── g47.test.g.1.out │ │ ├── g48.test.g │ │ ├── g48.test.g.1 │ │ ├── g48.test.g.1.check │ │ ├── g48.test.g.1.out │ │ ├── g49.test.g │ │ ├── g49.test.g.1 │ │ ├── g49.test.g.1.check │ │ ├── g49.test.g.1.out │ │ ├── g5.test.g │ │ ├── g5.test.g.1 │ │ ├── g5.test.g.1.check │ │ ├── g5.test.g.1.out │ │ ├── g50.test.g │ │ ├── g50.test.g.1 │ │ ├── g50.test.g.1.check │ │ ├── g50.test.g.1.out │ │ ├── g6.test.g │ │ ├── g6.test.g.1 │ │ ├── g6.test.g.1.check │ │ ├── g6.test.g.1.out │ │ ├── g7.test.g │ │ ├── g7.test.g.1 │ │ ├── g7.test.g.1.check │ │ ├── g7.test.g.1.out │ │ ├── g7.test.g.2 │ │ ├── g7.test.g.2.check │ │ ├── g7.test.g.2.out │ │ ├── g8.test.g │ │ ├── g8.test.g.1 │ │ ├── g8.test.g.1.check │ │ ├── g8.test.g.1.out │ │ ├── g9.test.g │ │ ├── g9.test.g.1 │ │ ├── g9.test.g.1.check │ │ ├── g9.test.g.1.out │ │ ├── python.test.g │ │ ├── python.test.g.1 │ │ ├── python.test.g.1.check │ │ ├── python.test.g.1.out │ │ ├── sample.test.g │ │ ├── sample.test.g.0 │ │ ├── sample.test.g.0.check │ │ ├── sample.test.g.0.out │ │ ├── sample.test.g.1 │ │ ├── sample.test.g.1.check │ │ ├── sample.test.g.1.out │ │ ├── sample.test.g.10 │ │ ├── sample.test.g.10.check │ │ ├── sample.test.g.10.out │ │ ├── sample.test.g.11 │ │ ├── sample.test.g.11.check │ │ ├── sample.test.g.11.out │ │ ├── sample.test.g.12 │ │ ├── sample.test.g.12.check │ │ ├── sample.test.g.12.out │ │ ├── sample.test.g.13 │ │ ├── sample.test.g.13.check │ │ ├── sample.test.g.13.out │ │ ├── sample.test.g.14 │ │ ├── sample.test.g.14.check │ │ ├── sample.test.g.14.out │ │ ├── sample.test.g.15 │ │ ├── sample.test.g.15.check │ │ ├── sample.test.g.15.out │ │ ├── sample.test.g.16 │ │ ├── sample.test.g.16.check │ │ ├── sample.test.g.16.out │ │ ├── sample.test.g.17 │ │ ├── sample.test.g.17.check │ │ ├── sample.test.g.17.out │ │ ├── sample.test.g.18 │ │ ├── sample.test.g.18.check │ │ ├── sample.test.g.18.out │ │ ├── sample.test.g.19 │ │ ├── sample.test.g.19.check │ │ ├── sample.test.g.19.out │ │ ├── sample.test.g.2 │ │ ├── sample.test.g.2.check │ │ ├── sample.test.g.2.out │ │ ├── sample.test.g.20 │ │ ├── sample.test.g.20.check │ │ ├── sample.test.g.20.out │ │ ├── sample.test.g.21 │ │ ├── sample.test.g.21.check │ │ ├── sample.test.g.21.out │ │ ├── sample.test.g.22 │ │ ├── sample.test.g.22.check │ │ ├── sample.test.g.22.out │ │ ├── sample.test.g.23 │ │ ├── sample.test.g.23.check │ │ ├── sample.test.g.23.out │ │ ├── sample.test.g.24 │ │ ├── sample.test.g.24.check │ │ ├── sample.test.g.24.out │ │ ├── sample.test.g.25 │ │ ├── sample.test.g.25.check │ │ ├── sample.test.g.25.out │ │ ├── sample.test.g.26 │ │ ├── sample.test.g.26.check │ │ ├── sample.test.g.26.out │ │ ├── sample.test.g.27 │ │ ├── sample.test.g.27.check │ │ ├── sample.test.g.27.out │ │ ├── sample.test.g.28 │ │ ├── sample.test.g.28.check │ │ ├── sample.test.g.28.out │ │ ├── sample.test.g.29 │ │ ├── sample.test.g.29.check │ │ ├── sample.test.g.29.out │ │ ├── sample.test.g.3 │ │ ├── sample.test.g.3.check │ │ ├── sample.test.g.3.out │ │ ├── sample.test.g.30 │ │ ├── sample.test.g.30.check │ │ ├── sample.test.g.30.out │ │ ├── sample.test.g.31 │ │ ├── sample.test.g.31.check │ │ ├── sample.test.g.31.out │ │ ├── sample.test.g.32 │ │ ├── sample.test.g.32.check │ │ ├── sample.test.g.32.out │ │ ├── sample.test.g.33 │ │ ├── sample.test.g.33.check │ │ ├── sample.test.g.33.out │ │ ├── sample.test.g.4 │ │ ├── sample.test.g.4.check │ │ ├── sample.test.g.4.out │ │ ├── sample.test.g.5 │ │ ├── sample.test.g.5.check │ │ ├── sample.test.g.5.out │ │ ├── sample.test.g.6 │ │ ├── sample.test.g.6.check │ │ ├── sample.test.g.6.out │ │ ├── sample.test.g.7 │ │ ├── sample.test.g.7.check │ │ ├── sample.test.g.7.out │ │ ├── sample.test.g.8 │ │ ├── sample.test.g.8.check │ │ ├── sample.test.g.8.out │ │ ├── sample.test.g.9 │ │ ├── sample.test.g.9.check │ │ ├── sample.test.g.9.out │ │ ├── utf8.test.g │ │ ├── utf8.test.g.1 │ │ ├── utf8.test.g.1.check │ │ └── utf8.test.g.1.out │ ├── util.c │ ├── util.h │ ├── verilog │ │ ├── Makefile │ │ ├── README │ │ ├── ambig.c │ │ ├── main.c │ │ ├── verilog.g │ │ ├── verilog_tests │ │ ├── vparse.c │ │ └── vparse.h │ ├── version.c │ ├── write_tables.c │ └── write_tables.h ├── date.g ├── date_node.h ├── end_condition.cc ├── end_condition.hh ├── endhook.cc ├── endhook.hh ├── error.hh ├── factory.cc ├── factory.hh ├── filter.g ├── fmbt.cc ├── function.cc ├── function.hh ├── function_array.cc ├── function_array.hh ├── function_cast.cc ├── function_cast.hh ├── function_const.cc ├── function_const.hh ├── function_export.hh ├── function_pid.cc ├── function_pid.hh ├── function_random.cc ├── function_random.hh ├── function_supported.cc ├── function_supported.hh ├── function_time.cc ├── function_time.hh ├── function_ustime.cc ├── function_ustime.hh ├── helper.cc ├── helper.hh ├── heuristic.cc ├── heuristic.hh ├── heuristic_coverage_random.cc ├── heuristic_coverage_random.hh ├── heuristic_greedy.cc ├── heuristic_greedy.hh ├── heuristic_include.cc ├── heuristic_include.hh ├── heuristic_minerror.cc ├── heuristic_minerror.hh ├── heuristic_mrandom.cc ├── heuristic_mrandom.hh ├── heuristic_proxy.cc ├── heuristic_proxy.hh ├── heuristic_random.cc ├── heuristic_random.hh ├── heuristic_weight.cc ├── heuristic_weight.hh ├── history.cc ├── history.hh ├── history_glob.cc ├── history_glob.hh ├── history_log.cc ├── history_log.hh ├── history_multi.cc ├── history_multi.hh ├── history_remote.cc ├── history_remote.hh ├── image_helper.cc ├── image_helper.hh ├── lang.cc ├── lang.g ├── learn_action.cc ├── learn_action.hh ├── learn_function.cc ├── learn_function.hh ├── learn_proxy.cc ├── learn_proxy.hh ├── learn_time.cc ├── learn_time.hh ├── learning.cc ├── learning.hh ├── log.cc ├── log.hh ├── log2lsts.cc ├── log_aalremote.hh ├── log_null.hh ├── lts.cc ├── lts.g ├── lts.hh ├── lts_remote.cc ├── lts_remote.hh ├── lts_trace.cc ├── lts_trace.hh ├── lts_xrules.cc ├── lts_xrules.hh ├── model.cc ├── model.hh ├── model_cshared.hh ├── model_filter.hh ├── model_lib.cc ├── model_remote.cc ├── model_remote.hh ├── model_yes.cc ├── model_yes.hh ├── mrules.g ├── mwrapper.cc ├── mwrapper.hh ├── null.cc ├── null.hh ├── of.cc ├── of.hh ├── of_csv.cc ├── of_csv.hh ├── of_html.cc ├── of_html.hh ├── of_null.cc ├── of_null.hh ├── params.cc ├── params.hh ├── paths.g ├── policy.cc ├── policy.hh ├── proxy.hh ├── random.cc ├── random.hh ├── random_c.cc ├── random_c.hh ├── random_devrandom.cc ├── random_devrandom.hh ├── random_intel_hw.cc ├── random_intel_hw.hh ├── random_supported.cc ├── random_supported.hh ├── readline_wrapper.cc ├── reffable.hh ├── remote.cc ├── remote.hh ├── remote_aal_loader.ll ├── remote_adapter_loader.cc ├── remote_adapter_v4l2.c ├── remote_pymodel ├── rules.hh ├── set.g ├── test_engine.cc ├── test_engine.hh ├── uc.cc ├── uconf.g ├── verdict.cc ├── verdict.hh ├── weight.g ├── windows_helper.cc ├── writable.hh ├── xrules.g ├── xrules_remote.cc └── xrules_remote.hh ├── test ├── Makefile.am ├── aalpython │ ├── adapter_exceptions.aal │ ├── adapter_exceptions.conf │ ├── changing_model_in_adapter.aal │ ├── changing_model_in_adapter.conf │ ├── changing_model_in_adapter.expected │ ├── controlflow.aal │ ├── controlflow.conf │ ├── fmbt_call_test.aal │ ├── fmbt_call_test.conf │ ├── mycounter.py │ ├── nested.aal │ ├── nested.conf │ ├── outputs.aal │ ├── run.sh │ ├── serpa.aal │ ├── serpa.conf │ ├── tags-allfail.conf │ ├── tags-fail.conf │ ├── tags.aal │ ├── tags.conf │ └── test1.py.aal ├── adapters │ ├── dlopen │ │ ├── Makefile │ │ ├── abc.lsts │ │ ├── dlopen.conf │ │ ├── mylocaladapter.cc │ │ └── mylocaladapter.hh │ ├── run.sh │ └── timer │ │ ├── run.sh │ │ ├── timer.conf │ │ ├── timer.gt │ │ └── timer.mrules ├── all-builds │ ├── run.sh │ └── test-configurations.sh ├── build │ └── run.sh ├── coverage │ ├── abc.gt │ ├── abc_reg.gt │ ├── coffee.gt │ ├── run.sh │ ├── t1.gt │ ├── t2.gt │ ├── t3.gt │ ├── twocounters.aal │ ├── usecase-tags-1.conf │ └── usecase-tags.aal ├── coverage_shared │ ├── run.sh │ ├── shared.conf │ ├── two.aal │ └── two.conf ├── deadlocks │ ├── run.sh │ └── teststeps.py ├── editor │ ├── editor.aal │ ├── monkey.aal │ ├── monkey.conf │ ├── run.sh │ └── test.conf ├── examples │ └── run.sh ├── exitvalue │ ├── broken-adapter.aal │ ├── broken-body.aal │ ├── broken-guard.aal │ ├── broken-initial_state.aal │ ├── broken-language.aal │ ├── broken-requiredvalue.gt │ ├── run.sh │ └── run_new.sh ├── eyenfinger │ ├── run.sh │ ├── screenshot2-icon.png │ ├── screenshot2.png │ ├── test.aal.conf │ └── test.py.aal ├── fmbt-stats │ ├── model.gt │ ├── run.sh │ ├── seeded-errors.conf │ └── teststeps.py ├── fmbttestutils.py ├── functions.sh ├── git-HEAD │ └── run.sh ├── heuristic_exclude │ ├── run.sh │ └── t1.gt ├── heuristic_mrandom │ ├── run.sh │ ├── t1.conf │ └── t1.gt ├── history │ ├── abc.gt │ ├── history_test.aal │ ├── history_test.conf │ ├── one-step-tests.conf │ ├── one-step-tests.sh │ ├── one-step-tests_old.sh │ └── run.sh ├── interactivemode │ ├── breakpoints.aal │ ├── breakpoints.conf │ ├── create-model.sh │ ├── dummys.mrules │ ├── fmbt-i.mrules │ ├── fmbt_i.py │ ├── run.sh │ ├── simple.conf │ ├── simple.gt │ ├── singledummy.mrules │ └── test.conf ├── learn │ ├── run.sh │ └── times.aal ├── log2lsts │ ├── run.sh │ └── t1.gt ├── mlang │ ├── bf2gt.c │ ├── brainfuck.conf │ ├── brainfuck_memory.cc.aal │ ├── helloworld.bf │ ├── mkrmdir.lang │ ├── run.sh │ ├── test.lang │ └── test_py.lang ├── multiaal │ ├── Makefile │ ├── mycounter.cc │ ├── mycounter.h │ ├── mycountertest.cc │ ├── mycountertest1.cc.aal │ ├── mycountertest2.cc.aal │ ├── run.sh │ ├── test.conf │ ├── test_fail.conf │ └── testmodel.xrules ├── remoteerror │ ├── crashingsteps.py │ ├── crashraise.aal │ └── run.sh ├── reporting │ ├── mplayertest.aal │ └── run.sh ├── set │ ├── arguments.conf │ ├── arguments.gt │ ├── run.sh │ └── t2.gt ├── tema_seq │ ├── mkrmdir.conf │ ├── mkrmdir.log │ ├── mkrmdir.lsts │ └── run.sh ├── tutorial │ └── run.sh └── weight │ ├── model.gt │ ├── run.sh │ ├── t2.gt │ ├── test-allzeros.weight │ ├── test-fiftyfifty.weight │ ├── test-noheur.conf │ └── test-onlyone.weight ├── utils ├── Makefile.am ├── aalmodel.py ├── eye4graphics.cc ├── eye4graphics.h ├── eyenfinger.py ├── fmbt-debug ├── fmbt-editor ├── fmbt-gt ├── fmbt-gteditor ├── fmbt-log ├── fmbt-parallel ├── fmbt-scripter ├── fmbt-stats ├── fmbt-trace-share ├── fmbt-traces2dfa ├── fmbt-view ├── fmbt.py ├── fmbt_config.py.in ├── fmbtandroid.py ├── fmbtchromiumos.py ├── fmbtgti.py ├── fmbtlogger.py ├── fmbtparsers.py ├── fmbtpng.py ├── fmbtrdp.py ├── fmbttizen-agent.py ├── fmbttizen.py ├── fmbtuinput.py ├── fmbtvnc.py ├── fmbtweb.py ├── fmbtwindows.py ├── fmbtwindows_agent.py ├── fmbtx11.py ├── fmbtx11_conn.py ├── libhook ├── lsts.py ├── lsts2dot ├── pycosh.py ├── recb.py ├── relax2.py ├── remote_exec.sh ├── remote_pyaal ├── remote_python └── setup.py └── utils3 ├── Makefile.am ├── README ├── aalmodel.py ├── eyenfinger.py ├── fmbt-scripter ├── fmbt.py ├── fmbt3-editor ├── fmbt3-log ├── fmbt3-view ├── fmbt_config.py.in ├── fmbtandroid.py ├── fmbtgti.py ├── fmbtpng.py ├── fmbtwindows.py ├── fmbtwindows_agent.py ├── lsts3.py ├── lsts32dot ├── pycosh.py ├── remote_py3aal └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | fmbt 2 | fmbt_droid 3 | fmbt-aalc 4 | fmbt-aalp 5 | fmbt-ucheck 6 | remote_adapter_v4l2 7 | remote_adapter_loader 8 | make_dparser 9 | sample_parser 10 | test_parser 11 | fMBT.spec 12 | ar-lib 13 | *~ 14 | *.o 15 | *.a 16 | *.lo 17 | *.la 18 | *.pyc 19 | *.log 20 | *.debhelper 21 | *.substvars 22 | *.html 23 | *.stderr 24 | *.stdout 25 | *.stderr 26 | src/.deps 27 | autom4te.cache 28 | aclocal.m4 29 | /Makefile 30 | config.* 31 | configure 32 | depcomp 33 | install-sh 34 | missing 35 | libtool 36 | ltmain.sh 37 | py-compile 38 | ylwrap 39 | stamp-* 40 | \#.*\# 41 | Makefile.in 42 | examples/Makefile 43 | src/Makefile 44 | test/Makefile 45 | utils/Makefile 46 | case-connman/*.lsts 47 | case-connman/*rules 48 | test/interactivemode/*.txt 49 | test/interactivemode/*.xrules 50 | test/interactivemode/*.lsts 51 | test/remoteerror/*.txt 52 | test/remoteerror/*.conf 53 | *.g.d_parser.cc 54 | d/*parser 55 | src/.libs 56 | src/android 57 | src/aalp.cc -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/fMBT/37706c8302abfb4e679082678d0b17d3fc897a3c/.gitmodules -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Adam Cozzette 2 | Aleksi Häkli 3 | Antti Kervinen 4 | Calin Cosmin 5 | Cesare Di Mauro 6 | David Weinehall 7 | Ed Bartosh 8 | Heikki Virtanen 9 | Igor Stoppa 10 | Jukka Laukkanen 11 | Kaisa Taipale 12 | Kärkkäinen Tuomo 13 | Lassi I Vaatamoinen 14 | Mikko Mattila 15 | Moritz Lipp 16 | Pablo Virolainen 17 | Rich Seymour 18 | Rupesh Dev 19 | Saija Sorsa 20 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /HACKING: -------------------------------------------------------------------------------- 1 | Building from git 2 | ----------------- 3 | 4 | autoreconf --install 5 | ./configure 6 | make 7 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation. 3 | 4 | ## Reporting a Vulnerability 5 | Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html). 6 | -------------------------------------------------------------------------------- /autodebug/examples/buggy/Makefile: -------------------------------------------------------------------------------- 1 | AUTODEBUG=../../bin/autodebug 2 | VALGRIND_AUTODEBUG=../../bin/valgrind-autodebug 3 | 4 | buggy: buggy.c 5 | gcc -O0 -g -o $@ $^ 6 | buggy-s: buggy.c 7 | gcc -O0 -g -fsanitize=address -fsanitize-recover=address -o $@ $^ 8 | 9 | autodebug-pointer: buggy 10 | $(AUTODEBUG) ./buggy p 11 | autodebug-uninit: buggy 12 | $(VALGRIND_AUTODEBUG) ./buggy u 13 | autodebug-stack: buggy-s 14 | $(AUTODEBUG) ./buggy-s s 15 | 16 | check: autodebug-pointer autodebug-uninit autodebug-stack 17 | 18 | clean: 19 | $(RM) buggy buggy-s *~ 20 | -------------------------------------------------------------------------------- /autodebug/examples/buggy/buggy.c: -------------------------------------------------------------------------------- 1 | /* file: buggy.c */ 2 | #include 3 | int example_bad_ptr(long i) { 4 | int* memory_at_address_i = (int*)i; 5 | return *memory_at_address_i; 6 | } 7 | void example_stack(int i) { 8 | int array_in_stack[2]; 9 | array_in_stack[0-i] = i; 10 | } 11 | void example_uninit(int i) { 12 | char* s = (char*)malloc(4); 13 | if (s[i] == 0) return; 14 | free(s); 15 | } 16 | int main(int argc, char** argv) { 17 | switch (argv[1][0]) { 18 | case 'p': example_bad_ptr(argc); break; 19 | case 's': example_stack(argc); break; 20 | case 'u': example_uninit(argc); break; 21 | } 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /autodebug/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import glob 4 | import time 5 | import subprocess 6 | 7 | from distutils.core import setup 8 | 9 | try: 10 | git_hash = subprocess.check_output(["git", "describe", "--always"]).strip() 11 | except: 12 | git_hash = "_" 13 | try: 14 | timestamp = subprocess.check_output(["tinytime", "epoch"]).strip()[:3] 15 | except: 16 | timestamp = "zzz" 17 | 18 | setup(name = 'autodebug', 19 | version = '0.%s.g%s' % (timestamp, git_hash), 20 | description = 'gdb-based verbose backtrace printer', 21 | author = 'Antti Kervinen', 22 | author_email = 'antti.kervinen@intel.com', 23 | packages = [], 24 | scripts = [f for f in glob.glob("bin/*") 25 | if not f.endswith("~")] 26 | ) 27 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | autoreconf -i -f 3 | -------------------------------------------------------------------------------- /bogus: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/fMBT/37706c8302abfb4e679082678d0b17d3fc897a3c/bogus -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /debian/fmbt-adapter-android.install: -------------------------------------------------------------------------------- 1 | usr/lib/python*/*packages/fmbtandroid.py 2 | -------------------------------------------------------------------------------- /debian/fmbt-adapter-chromiumos.install: -------------------------------------------------------------------------------- 1 | usr/lib/python*/*packages/fmbtchromiumos.py 2 | -------------------------------------------------------------------------------- /debian/fmbt-adapter-eyenfinger.install: -------------------------------------------------------------------------------- 1 | usr/lib/python*/*packages/eye* 2 | usr/lib/python*/*packages/fmbtpng* 3 | -------------------------------------------------------------------------------- /debian/fmbt-adapter-tizen.install: -------------------------------------------------------------------------------- 1 | usr/lib/python*/*packages/fmbttizen.py 2 | usr/lib/python*/*packages/fmbttizen-agent.py 3 | -------------------------------------------------------------------------------- /debian/fmbt-adapter-vnc.install: -------------------------------------------------------------------------------- 1 | usr/lib/python*/*packages/fmbtvnc.py 2 | -------------------------------------------------------------------------------- /debian/fmbt-adapter-windows.install: -------------------------------------------------------------------------------- 1 | usr/lib/python*/*packages/fmbtwindows.py* 2 | usr/lib/python*/*packages/fmbtwindows_agent.py* 3 | -------------------------------------------------------------------------------- /debian/fmbt-adapter-x11.install: -------------------------------------------------------------------------------- 1 | usr/lib/python*/*packages/fmbtx11.py 2 | usr/lib/python*/*packages/fmbtx11_conn.py 3 | -------------------------------------------------------------------------------- /debian/fmbt-adapters-remote.install: -------------------------------------------------------------------------------- 1 | usr/bin/remote_aal_loader 2 | usr/bin/remote_adapter_loader 3 | usr/bin/remote_exec.sh 4 | usr/bin/remote_pyaal 5 | usr/bin/remote_python 6 | usr/lib/python*/*packages/fmbtweb.py* 7 | -------------------------------------------------------------------------------- /debian/fmbt-core.install: -------------------------------------------------------------------------------- 1 | usr/bin/fmbt 2 | -------------------------------------------------------------------------------- /debian/fmbt-coreutils.install: -------------------------------------------------------------------------------- 1 | usr/bin/fmbt-aalc 2 | usr/bin/fmbt-aalp 3 | usr/bin/fmbt-debug 4 | usr/bin/fmbt-gt 5 | usr/bin/fmbt-log2lsts 6 | usr/bin/fmbt-trace-share 7 | -------------------------------------------------------------------------------- /debian/fmbt-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/fmbt/* 2 | -------------------------------------------------------------------------------- /debian/fmbt-doc.install: -------------------------------------------------------------------------------- 1 | usr/share/doc/fmbt/README 2 | usr/share/doc/fmbt/*.txt 3 | usr/share/man/man1/fmbt*.1* 4 | usr/share/man/man1/remote_pyaal.1* 5 | -------------------------------------------------------------------------------- /debian/fmbt-editor.install: -------------------------------------------------------------------------------- 1 | usr/bin/fmbt-editor 2 | usr/bin/fmbt-scripter 3 | -------------------------------------------------------------------------------- /debian/fmbt-examples.install: -------------------------------------------------------------------------------- 1 | usr/share/doc/fmbt/examples/* 2 | -------------------------------------------------------------------------------- /debian/fmbt-python.install: -------------------------------------------------------------------------------- 1 | usr/lib/python*/*packages/fmbt.py* 2 | usr/lib/python*/*packages/fmbtgti.py* 3 | usr/lib/python*/*packages/fmbtlogger.py* 4 | usr/lib/python*/*packages/fmbtuinput.py* 5 | usr/lib/python*/*packages/lsts.py* 6 | usr/lib/python*/*packages/pycosh.py* 7 | usr/lib/python*/*packages/aalmodel.py* 8 | usr/lib/python*/*packages/fmbt_config.py* 9 | -------------------------------------------------------------------------------- /debian/fmbt-pythonshare.install: -------------------------------------------------------------------------------- 1 | usr/lib/python*/*packages/pythonshare/* 2 | usr/bin/pythonshare-* 3 | usr/share/man/man1/pythonshare-*.1* 4 | -------------------------------------------------------------------------------- /debian/fmbt-utils.install: -------------------------------------------------------------------------------- 1 | usr/bin/fmbt-view 2 | usr/bin/fmbt-log 3 | usr/bin/fmbt-stats 4 | usr/bin/lsts2dot 5 | usr/bin/fmbt-ucheck 6 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | build: configure 4 | 5 | configure: 6 | ./autogen.sh 7 | 8 | override_dh_python2: 9 | dh_python2 --no-guessing-versions 10 | 11 | override_dh_auto_install: 12 | dh_auto_install 13 | find $(CURDIR)/debian -name \*.la -exec rm -f {} \; 14 | 15 | %: 16 | dh $@ --parallel --with python2 17 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 1.0 2 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | # pull official base image 2 | FROM debian:latest 3 | 4 | # set environment variables 5 | ENV PYTHONDONTWRITEBYTECODE 1 6 | ENV PYTHONUNBUFFERED 1 7 | ENV DEBIAN_FRONTEND=noninteractive 8 | 9 | # tzdata hack 10 | RUN ln -fs /usr/share/zoneinfo/Europe/Rome /etc/localtime 11 | 12 | # update system 13 | RUN apt-get update && apt-get dist-upgrade -y 14 | RUN apt-get install git build-essential libglib2.0-dev libboost-regex-dev libedit-dev libmagickcore-dev \ 15 | python-dev python-pexpect python-dbus python-gobject gawk libtool autoconf automake debhelper \ 16 | libboost-dev flex libpng16-16 libxml2-dev graphviz imagemagick gnuplot python-pyside* tesseract-ocr --yes 17 | 18 | # build project 19 | WORKDIR /opt 20 | RUN git clone --branch v0.42 --single-branch --depth 1 https://github.com/intel/fMBT 21 | WORKDIR /opt/fMBT 22 | RUN ./autogen.sh; ./configure; make; make install 23 | 24 | -------------------------------------------------------------------------------- /docker/build_fmbt_windows_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$1" == "32" ]; then 4 | ARCH=32 5 | elif [ "$1" == "64" ]; then 6 | ARCH=64 7 | else 8 | echo "Usage: $0 <32|64>" 9 | echo "builds 32 or 64-bit Windows installer" 10 | exit 1 11 | fi 12 | 13 | mkdir -p build-win$ARCH 14 | docker build --no-cache=true -t fmbt_fedora . 15 | docker run -i -v ${PWD}/build-win$ARCH:/build-win$ARCH fmbt_fedora sh << COMMANDS 16 | export http_proxy=$http_proxy 17 | export https_proxy=$https_proxy 18 | export ftp_proxy=$ftp_proxy 19 | echo Building $ARCH-bit fMBT installer 20 | cd fMBT; ./build-fMBT-installer-winXX.exe.sh $ARCH 21 | echo Copying binaries to host 22 | cp build-win$ARCH/fMBT-installer-*.exe /build-win$ARCH 23 | echo Changing owner from \$(id -u):\$(id -g) to $(id -u):$(id -u) 24 | chown -R $(id -u):$(id -u) /build-win$ARCH 25 | COMMANDS 26 | -------------------------------------------------------------------------------- /examples/aal-components/README: -------------------------------------------------------------------------------- 1 | This is an example of using AAL preprocessor for splitting AAL models 2 | into several files. 3 | 4 | Test model for a system is constructed from a base model and included 5 | components. The components are specified by preprocessor command line 6 | arguments -Dcalc and -Dclock, given in the test configuration file. 7 | 8 | Contents: 9 | 10 | basesystem.aal 11 | 12 | This introduces and initialises variables needed by 13 | components. It includes component actions if corresponding 14 | preprocessor flag, "calc" or "clock" is defined. 15 | 16 | clock.actions, calc.actions 17 | 18 | These files contain test step definitions for each of the 19 | components. 20 | 21 | fullsystem.conf 22 | 23 | The test configuration file. 24 | -------------------------------------------------------------------------------- /examples/aal-components/aal_lib/calc.actions: -------------------------------------------------------------------------------- 1 | action "iCalcLaunch" { 2 | guard() { return fg_app == "appgrid" } 3 | body() { fg_app = "calc" } 4 | } 5 | 6 | action "iCalcBg" { 7 | guard() { return fg_app == "calc" } 8 | body() { fg_app = "appgrid" } 9 | } 10 | 11 | action "iToggleScientific" { 12 | guard() { return fg_app == "calc" } 13 | body() { calc_sci = not calc_sci } 14 | } 15 | 16 | action "iDivideByZero" { 17 | guard() { return fg_app == "calc" } 18 | } 19 | -------------------------------------------------------------------------------- /examples/aal-components/aal_lib/clock.actions: -------------------------------------------------------------------------------- 1 | action "iClockLaunch" { 2 | guard() { return fg_app == "appgrid" } 3 | body() { fg_app = "clock" } 4 | } 5 | 6 | action "iClockBg" { 7 | guard() { return fg_app == "clock" } 8 | body() { fg_app = "appgrid" } 9 | } 10 | 11 | action "iClockStartTimer" { 12 | guard() { return fg_app == "clock" and not clock_timer_running } 13 | body() { clock_timer_running = True } 14 | } 15 | 16 | action "iClockStopTimer" { 17 | guard() { return fg_app == "clock" and clock_timer_running } 18 | body() { clock_timer_running = False } 19 | } 20 | -------------------------------------------------------------------------------- /examples/aal-components/basesystem.aal: -------------------------------------------------------------------------------- 1 | aal "basesystem" { 2 | language "python" {} 3 | 4 | # preview-depth: 6 5 | variables { 6 | fg_app, clock_timer_running, \ 7 | calc_sci 8 | } 9 | initial_state { 10 | fg_app = "appgrid" # foreground application 11 | 12 | clock_timer_running = False 13 | calc_sci = False 14 | } 15 | ^ifdef "clock" 16 | ^include "clock.actions" 17 | ^endif 18 | 19 | ^ifdef "calc" 20 | ^include "calc.actions" 21 | ^endif 22 | 23 | } 24 | -------------------------------------------------------------------------------- /examples/aal-components/fullsystem.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote(remote_pyaal -I aal_lib -l system.aal.log -Dcalc -Dclock basesystem.aal)" 2 | heuristic = "lookahead(3)" 3 | coverage = "perm(2)" 4 | pass = "steps(20)" 5 | on_pass = "exit(0)" 6 | on_fail = "exit(1)" 7 | on_inconc = "exit(2)" -------------------------------------------------------------------------------- /examples/aal_robot/browser.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This is a basic test 3 | Library SeleniumLibrary 4 | 5 | *** Keywords *** 6 | Open webpage 7 | [Arguments] ${url} ${browser} 8 | [Documentation] As a user I can open the duckduckgo page 9 | log ${url} 10 | open browser ${url} ${browser} 11 | wait until page contains DuckDuckGo 12 | 13 | Make search 14 | [Arguments] ${text} ${search_button} ${search_text} 15 | [Documentation] The user search ${search_text} 16 | input text ${text} ${search_text} 17 | click element ${search_button} 18 | wait until page contains ${search_text} 19 | 20 | Close 21 | Close Browser 22 | -------------------------------------------------------------------------------- /examples/aal_robot/test.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l "robot.aal.log" "robot.aal") 2 | adapter = aal 3 | heuristic = lookahead(4) 4 | coverage = perm(2) 5 | pass = steps(10) 6 | on_pass = exit(0) 7 | on_fail = exit(1) 8 | on_inconc = exit(2) -------------------------------------------------------------------------------- /examples/aal_robot/test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource browser.robot 3 | 4 | 5 | *** Test Cases *** 6 | 7 | Open google page 8 | Open webpage https://www.duckduckgo.com chrome -------------------------------------------------------------------------------- /examples/c++-unittest/mycounter.cc: -------------------------------------------------------------------------------- 1 | #include "mycounter.h" 2 | 3 | MyCounter::MyCounter() 4 | { 5 | #ifndef FAULTY 6 | value = 0; 7 | #endif 8 | } 9 | 10 | void MyCounter::inc() { 11 | value += 1; 12 | } 13 | 14 | void MyCounter::reset() { 15 | value = 0; 16 | } 17 | 18 | int MyCounter::count() { 19 | return value; 20 | } 21 | -------------------------------------------------------------------------------- /examples/c++-unittest/mycounter.h: -------------------------------------------------------------------------------- 1 | #ifndef __mycounter_h__ 2 | #define __mycounter_h__ 3 | 4 | class MyCounter { 5 | public: 6 | MyCounter(); 7 | void inc(); 8 | void reset(); 9 | int count(); 10 | private: 11 | int value; 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /examples/c++-unittest/test.conf: -------------------------------------------------------------------------------- 1 | model = lib(mycountertest) 2 | adapter = lib(mycountertest) 3 | heuristic = lookahead 4 | coverage = perm(2) 5 | 6 | pass = duration(1 sec) 7 | 8 | on_fail = exit 9 | -------------------------------------------------------------------------------- /examples/filesystemtest/Makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS := -O0 -g -Wall -pedantic -I../../src -I/usr/include/fmbt -fPIC 2 | 3 | all: filesystemtest.so 4 | 5 | # Link the unit under test and test steps into a shared library. 6 | %.so: %.o 7 | $(CXX) -g -shared -o $@ $^ 8 | 9 | # Generic rule for generating C++ from AAL. When make notices that it 10 | # needs mycountertest.cc due to the linking rule, this rules tells how 11 | # to create it from mycountertest.cc.aal. PRECIOUS prevents deleting 12 | # the .cc file automatically. That's nice in case you need gdb, for 13 | # instance. 14 | .PRECIOUS: %.cc 15 | %.cc: %.cc.aal 16 | fmbt-aalc -o $@ $< 17 | 18 | clean: 19 | $(RM) *.o *.so 20 | -------------------------------------------------------------------------------- /examples/filesystemtest/README: -------------------------------------------------------------------------------- 1 | This example tests filesystems by making and removing directories. It covers: 2 | 3 | - successful mkdir 4 | - successful rmdir 5 | - successful mkdir of a subdirectory 6 | - successful rmdir of a subdirectory 7 | - mkdir failing because of non-existing parent directory 8 | - mkdir failing because of already existing directory 9 | - rmdir failing because of non-existing directory 10 | - rmdir failing because of non-empty directory 11 | 12 | After each operation, it is checked that directories that are expected 13 | to exist are readable, and others are not. 14 | 15 | filesystemtest.conf tests that all possible combinations of any two 16 | operations are tested. 17 | 18 | Edit the model and configuration: 19 | 20 | $ fmbt-editor filesystemtest.aal filesystemtest.conf 21 | 22 | Run the test: 23 | 24 | $ fmbt -l test.log filesystemtest.conf 25 | 26 | Run the test and see how it exercises the filesystem: 27 | 28 | $ strace -e trace=mkdir,rmdir,access -f fmbt filesystemtest.conf >/dev/null 29 | -------------------------------------------------------------------------------- /examples/filesystemtest/filesystemtest.cc.conf: -------------------------------------------------------------------------------- 1 | model = lib(filesystemtest) 2 | adapter = lib(filesystemtest) 3 | heuristic = lookahead(6) 4 | coverage = perm(2) 5 | pass = no_progress(6) 6 | on_pass = exit(0) 7 | on_fail = exit(1) 8 | on_inconc = exit(2) 9 | -------------------------------------------------------------------------------- /examples/filesystemtest/filesystemtest.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l aal.log filesystemtest.aal) 2 | adapter = aal 3 | heuristic = lookahead(6) 4 | coverage = perm(2) 5 | pass = no_progress(6) 6 | on_pass = exit(0) 7 | on_fail = exit(1) 8 | on_inconc = exit(2) -------------------------------------------------------------------------------- /examples/filesystemtest/filesystemtest.lsts.conf: -------------------------------------------------------------------------------- 1 | model = lts_remote(remote_pyaal --lsts-depth 20 -o - filesystemtest.aal) 2 | #adapter = aal_remote(remote_pyaal -l aal.log filesystemtest.aal) 3 | adapter = dummy 4 | heuristic = lookahead(6) 5 | coverage = perm(4) 6 | pass = steps(10000) 7 | on_pass = exit(0) 8 | on_fail = exit(1) 9 | on_inconc = exit(2) 10 | -------------------------------------------------------------------------------- /examples/fmbtcourse-camera-pygt/README: -------------------------------------------------------------------------------- 1 | This example demonstrates testing a camera with a GT model and Python 2 | adapter. 3 | 4 | Files: 5 | 6 | capture-py.conf test configuration file 7 | 8 | capture-py.gt GT model 9 | 10 | teststeps.py test step implementations 11 | 12 | camera.py camera implementation 13 | -------------------------------------------------------------------------------- /examples/fmbtcourse-camera-pygt/camera.py: -------------------------------------------------------------------------------- 1 | # camera.py 2 | 3 | # This is the "camera implementation" to be tested in this example. 4 | 5 | import time 6 | 7 | g_capturedPreviewFrames = 0 8 | g_capturingVideo = False 9 | 10 | def capture(params): 11 | if not g_capturingVideo: 12 | time.sleep(1) 13 | file(params['photo'],"a").write('camera.capture\n') 14 | 15 | def startPreview(params): 16 | global g_capturedPreviewFrames 17 | if g_capturingVideo: 18 | g_capturedPreviewFrames += 15 19 | else: 20 | g_capturedPreviewFrames += 25 21 | 22 | def stopPreview(): 23 | global g_capturedPreviewFrames 24 | g_capturedPreviewFrames = 0 25 | pass 26 | 27 | def previewing(): 28 | return g_capturedPreviewFrames != 0 29 | 30 | def previewFrameCount(): 31 | return g_capturedPreviewFrames 32 | 33 | def startVideoCapture(): 34 | global g_capturingVideo 35 | g_capturingVideo = True 36 | 37 | def stopVideoCapture(): 38 | global g_capturingVideo 39 | g_capturingVideo = False 40 | -------------------------------------------------------------------------------- /examples/fmbtcourse-camera-pygt/capture-py.conf: -------------------------------------------------------------------------------- 1 | model = "lsts_remote:fmbt-gt -f capture-py.gt" 2 | adapter = "remote: remote_python -c 'from teststeps import *'" 3 | pass = "steps:10" 4 | -------------------------------------------------------------------------------- /examples/fmbtcourse-camera-pygt/capture-py.gt: -------------------------------------------------------------------------------- 1 | P(not-capturing, "gt:istate") -> 2 | T(not-capturing, "iPreview() > 20", not-capturing) 3 | T(not-capturing, "iCaptureImage()", not-capturing) 4 | T(not-capturing, "iStartVideocapt()", capturing) 5 | T(not-capturing, "iStopVideocapt()", not-capturing) 6 | 7 | T(capturing, "iPreview() > 10", capturing) 8 | T(capturing, "iStopVideocapt()", not-capturing) 9 | T(capturing, "iCaptureImage() == Error('.*No file.')", capturing) -------------------------------------------------------------------------------- /examples/fmbtcourse-camera-pygt/teststeps.py: -------------------------------------------------------------------------------- 1 | # Test step implementations 2 | import camera 3 | import time 4 | import os 5 | from os.path import exists 6 | 7 | P = {'resolution': '640x480', 8 | 'photo': 'noname.jpg'} 9 | 10 | def iCaptureImage(): 11 | if exists(P['photo']): 12 | os.remove(P['photo']) 13 | camera.capture(P) 14 | assert exists(P['photo']), "No file." 15 | 16 | def iPreview(): 17 | assert camera.previewFrameCount() == 0 18 | assert camera.previewing() == False 19 | camera.startPreview(P) 20 | time.sleep(1) 21 | frames = camera.previewFrameCount() 22 | assert camera.previewing() == True 23 | camera.stopPreview() 24 | return frames 25 | 26 | def iStartVideocapt(): 27 | camera.startVideoCapture() 28 | 29 | def iStopVideocapt(): 30 | camera.stopVideoCapture() 31 | -------------------------------------------------------------------------------- /examples/gt-components/README: -------------------------------------------------------------------------------- 1 | This example demonstrates how fmbt-aalp can be used for splitting a GT 2 | model into several files, and how wanted GT model components can be 3 | picked up into the model in the test configuration. 4 | 5 | Run the example as follows: 6 | 7 | $ fmbt-editor meeting.gt meeting.conf 8 | -------------------------------------------------------------------------------- /examples/gt-components/endmeeting.gt.inc: -------------------------------------------------------------------------------- 1 | T(meeting, "iEndMeeting", start) 2 | -------------------------------------------------------------------------------- /examples/gt-components/meeting.conf: -------------------------------------------------------------------------------- 1 | # Try different model configurations by giving different 2 | # combinations of following parameters to fmbt-aalp 3 | # -D chat 4 | # Add chatting before meeting. 5 | # -D present 6 | # Add possibility to keep presentations in the meeting, 7 | # read transitions from present.gt.inc, uses the same 8 | # state naming as meeting.gt. 9 | # -D qa 10 | # Add questions to all states with AllowQuestions tag. Read 11 | # a *GT rule* (not only transitions) from question.gt. 12 | # Uses separate state naming. 13 | model = "lsts_remote(sh -c 'fmbt-aalp -D present meeting.gt | fmbt-gt -f -')" 14 | heuristic = "lookahead(4)" 15 | coverage = "perm(2)" 16 | pass = "steps(20)" 17 | on_pass = "exit(0)" 18 | on_fail = "exit(1)" 19 | on_inconc = "exit(2)" -------------------------------------------------------------------------------- /examples/gt-components/present.gt.inc: -------------------------------------------------------------------------------- 1 | T(meeting, "iStartPresentation", presenting) 2 | 3 | T(presenting, "iEndPresentation", meeting) 4 | 5 | P(presenting, "AllowQuestions") -------------------------------------------------------------------------------- /examples/gt-components/question.gt: -------------------------------------------------------------------------------- 1 | P(s, "AllowQuestions") 2 | -> 3 | T(s, "iAskQuestion", asked) 4 | T(asked, "iGetAnswer", s) 5 | T(asked, "iContinueWithoutAnswer", s) 6 | -------------------------------------------------------------------------------- /examples/input-devices/xmodmap-capsnumpad: -------------------------------------------------------------------------------- 1 | remove Lock = Caps_Lock 2 | keycode 66 = Mode_switch Caps_Lock 3 | 4 | keycode 38 = a A VoidSymbol VoidSymbol NoSymbol NoSymbol 5 | keycode 39 = s S VoidSymbol VoidSymbol ssharp U1E9E 6 | keycode 40 = d D VoidSymbol VoidSymbol NoSymbol NoSymbol 7 | 8 | keycode 79 = KP_Home KP_7 VoidSymbol VoidSymbol VoidSymbol VoidSymbol 9 | keycode 80 = KP_Up KP_8 VoidSymbol VoidSymbol VoidSymbol VoidSymbol 10 | keycode 81 = KP_Prior KP_9 VoidSymbol VoidSymbol VoidSymbol VoidSymbol 11 | keycode 83 = KP_Left KP_4 VoidSymbol VoidSymbol VoidSymbol VoidSymbol 12 | keycode 84 = KP_Begin KP_5 VoidSymbol VoidSymbol VoidSymbol VoidSymbol 13 | keycode 85 = KP_Right KP_6 VoidSymbol VoidSymbol VoidSymbol VoidSymbol 14 | keycode 88 = KP_Down KP_2 VoidSymbol VoidSymbol VoidSymbol VoidSymbol 15 | 16 | keycode 111 = Up Up VoidSymbol VoidSymbol Up Up 17 | keycode 113 = Left Left VoidSymbol VoidSymbol Left Left 18 | keycode 114 = Right Right VoidSymbol VoidSymbol Right Right 19 | keycode 116 = Down Down VoidSymbol VoidSymbol Down Down 20 | -------------------------------------------------------------------------------- /examples/java-unittest/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | all: testfalse.log testtrue.log 3 | # Faulty MyCounter.java does not initialise counter 4 | # value in its constructor. 5 | 6 | # Rule for running the test, that is, producing the log file. 7 | # fmbt exits with an error value in case the test fails, we use 8 | # "... || true" to suppress Make error message. 9 | test%.log: test%.conf mycountertest%.class MyCounter.class 10 | fmbt -l$@ $< || true 11 | 12 | %.class: %.java 13 | javac $(filter %.java,$^) 14 | 15 | # Generic rule for generating java from AAL. When make notices that it 16 | # needs mycountertest[true|false].java, this rules tells how 17 | # to create it from mycountertest[true|false].java.aal. PRECIOUS prevents deleting 18 | # the .java and .class file automatically. 19 | 20 | .PRECIOUS: %.java %.class 21 | %.java: %.java.aal 22 | fmbt-aalc -o $@ $< 23 | 24 | clean: 25 | $(RM) *.class mycountertest*.java test*.log 26 | -------------------------------------------------------------------------------- /examples/java-unittest/MyCounter.java: -------------------------------------------------------------------------------- 1 | import java.util.Random; 2 | 3 | class MyCounter { 4 | public static boolean faulty = false; 5 | 6 | private Random r = new Random(); 7 | 8 | public MyCounter() { 9 | if (!faulty) { 10 | value = 0; 11 | } else { 12 | value = r.nextInt(); 13 | } 14 | } 15 | 16 | public void inc() { 17 | value++; 18 | } 19 | 20 | public void reset() { 21 | value = 0; 22 | } 23 | 24 | public int count() { 25 | return value; 26 | } 27 | 28 | private int value; 29 | }; 30 | -------------------------------------------------------------------------------- /examples/java-unittest/README: -------------------------------------------------------------------------------- 1 | This is an example of a unit test for a java class. 2 | 3 | The unit to be tested is implemented in mycounter.java. 4 | 5 | TODO. Write more documentation. -------------------------------------------------------------------------------- /examples/java-unittest/testfalse.conf: -------------------------------------------------------------------------------- 1 | model = "java(mycountertestfalse)" 2 | adapter = "java(mycountertestfalse)" 3 | heuristic = "lookahead" 4 | coverage = "perm(2)" 5 | 6 | pass = "duration:1 sec" 7 | 8 | on_fail = "exit" 9 | -------------------------------------------------------------------------------- /examples/java-unittest/testtrue.conf: -------------------------------------------------------------------------------- 1 | model = "java(mycountertesttrue)" 2 | adapter = "java(mycountertesttrue)" 3 | heuristic = "lookahead" 4 | coverage = "perm(2)" 5 | 6 | pass = "duration:1 sec" 7 | 8 | on_fail = "exit" 9 | -------------------------------------------------------------------------------- /examples/javascript-unittest/mycounter.js: -------------------------------------------------------------------------------- 1 | function mycounter(initial_value) 2 | { 3 | this.value = initial_value 4 | 5 | this.inc = function () { 6 | this.value += 1 7 | } 8 | 9 | this.reset = function () { 10 | // Reset to zero in a not-that-funny way. 11 | // Let's see if any test can detect this bug. 12 | this.value = (this.value / this.value) - 1 13 | } 14 | 15 | this.count = function () { 16 | return this.value 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/javascript-unittest/regressiontest.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l aal.log -c "BROWSER='firefox'" mycountertest.aal) 2 | adapter = aal 3 | coverage = perm(2) 4 | heuristic = lookahead(5) 5 | 6 | pass = steps(100) 7 | 8 | on_fail = exit 9 | -------------------------------------------------------------------------------- /examples/javascript-unittest/reliabilitytest.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l aal.log -c "BROWSER='firefox'" mycountertest.aal) 2 | adapter = aal 3 | 4 | coverage = perm(3) 5 | heuristic = lookahead(5) 6 | 7 | pass = steps(10000) 8 | 9 | on_fail = exit 10 | -------------------------------------------------------------------------------- /examples/javascript-unittest/smoketest.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l aal.log -c 'BROWSER="firefox"' mycountertest.aal) 2 | adapter = aal 3 | heuristic = lookahead(5) 4 | coverage = perm(1) 5 | pass = steps(20) 6 | on_pass = exit(0) 7 | on_fail = exit(1) 8 | on_inconc = exit(2) -------------------------------------------------------------------------------- /examples/javascript-unittest/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

fMBT JavaScript API test example

8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/link-layer-protocol/abp.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal abp.aal) 2 | heuristic = lookahead(8b) 3 | coverage = usecase("i.*" [".*ERROR"]) 4 | pass = steps(20) -------------------------------------------------------------------------------- /examples/offline-test-suite/weakly-connected.conf: -------------------------------------------------------------------------------- 1 | model = "lsts_remote(fmbt-gt -f 'weakly-connected.gt')" 2 | heuristic = "lookahead(5)" 3 | coverage = "perm(2)" 4 | 5 | inconc = "no_progress(5)" 6 | inconc = "deadlock" 7 | pass = "coverage(1.0)" 8 | 9 | on_pass = "exit(0)" 10 | on_fail = "exit(1)" 11 | on_inconc = "exit(2)" 12 | -------------------------------------------------------------------------------- /examples/offline-test-suite/weakly-connected.gt: -------------------------------------------------------------------------------- 1 | P(start, "gt:istate") 2 | -> 3 | T(start, "iLoop", start) 4 | T(start, "iBranch1", branch1) 5 | T(start, "iBranch2", branch2) 6 | T(start, "iBranch3", branch3) 7 | 8 | T(branch1, "iLoop", branch1) 9 | 10 | T(branch2, "iLoop", branch2) 11 | T(branch2, "iBranch2.1", branch1) 12 | T(branch2, "iBranch2.2", branch2.2) 13 | -------------------------------------------------------------------------------- /examples/python-unittest/mycounter.py: -------------------------------------------------------------------------------- 1 | class MyCounter: 2 | def __init__(self): 3 | self.value = 0 4 | 5 | def inc(self): 6 | self.value += 1 7 | 8 | def reset(self): 9 | # self.value = self.value / self.value - 1 10 | self.value = 0 11 | 12 | def count(self): 13 | return self.value 14 | -------------------------------------------------------------------------------- /examples/python-unittest/test.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote(remote_pyaal -l pyaal.log mycountertest.py.aal)" 2 | adapter = "aal_remote(remote_pyaal -l pyaal.log mycountertest.py.aal)" 3 | pass = steps(1000) 4 | fail = duration(2 secs) 5 | on_fail = exit(42) 6 | -------------------------------------------------------------------------------- /examples/shortener/mycounter.cc: -------------------------------------------------------------------------------- 1 | #include "mycounter.h" 2 | 3 | int MyCounter::counter=0; 4 | 5 | MyCounter::MyCounter() 6 | { 7 | if ((counter%7)!=0 || counter==0) 8 | value = 0; 9 | counter ++; 10 | } 11 | 12 | void MyCounter::inc() { 13 | value += 1; 14 | } 15 | 16 | void MyCounter::reset() { 17 | value = 0; 18 | } 19 | 20 | int MyCounter::count() { 21 | return value; 22 | } 23 | -------------------------------------------------------------------------------- /examples/shortener/mycounter.h: -------------------------------------------------------------------------------- 1 | #ifndef __mycounter_h__ 2 | #define __mycounter_h__ 3 | 4 | class MyCounter { 5 | public: 6 | MyCounter(); 7 | void inc(); 8 | void reset(); 9 | int count(); 10 | private: 11 | int value; 12 | static int counter; 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /examples/shortener/test.conf: -------------------------------------------------------------------------------- 1 | model = "lib(mycountertest)" 2 | adapter = "lib(mycountertest)" 3 | # We can't use other lookahead than 1, because mycountertest library doesn't support push/pop 4 | heuristic = "lookahead(1)" 5 | coverage = "perm(3)" 6 | pass = "duration(1 sec)" 7 | 8 | on_fail = "exit" 9 | -------------------------------------------------------------------------------- /examples/shortener/test.crules: -------------------------------------------------------------------------------- 1 | 1 = "lsts%3aout.lsts:short" 2 | 3 | "(.*)" -> (1, "($1)") 4 | -------------------------------------------------------------------------------- /examples/shortener/test_shortener.conf: -------------------------------------------------------------------------------- 1 | 2 | model = "lts:testmodel.lsts" 3 | adapter = "lib:mycountertest" 4 | heuristic = "lookahead:1" 5 | 6 | coverage = "mapper:test.crules" 7 | pass = "coverage:1.0" 8 | inconclusive = "steps:32" 9 | 10 | on_fail = "exit:1" 11 | on_pass = "exit:2" 12 | on_inconc = "exit:3" 13 | on_error = "exit:4" 14 | -------------------------------------------------------------------------------- /examples/shortener/testmodel.gt: -------------------------------------------------------------------------------- 1 | P(no_counter, p) -> 2 | 3 | T(no_counter, "iCreate", counter_exists) 4 | 5 | T(counter_exists, "iIncrement", counter_exists) 6 | T(counter_exists, "iReset", counter_exists) 7 | T(counter_exists, "iCount", counter_exists) 8 | T(counter_exists, "iDestroy", no_counter) 9 | -------------------------------------------------------------------------------- /examples/uc/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: out.html 3 | 4 | out.html: ../c++-unittest/test.log test.uc 5 | LD_LIBRARY_PATH=../c++-unittest/ ../../src/fmbt-ucheck -u test.uc -f html -o out.html ../c++-unittest/test.log 6 | 7 | 8 | ../c++-unittest/test.log: 9 | make -C ../c++-unittest test.log 10 | 11 | -------------------------------------------------------------------------------- /examples/uc/test.uc: -------------------------------------------------------------------------------- 1 | model = "lib(mycountertest)" 2 | 3 | report "calling" from "launch phone" to "call answeder" "call canceled" drop "quitting phone" 4 | 5 | report "Calucaltion create and destroy" from "iCreate" to "iDestroy" 6 | 7 | notice "destroyed" "perm(1)" 8 | 9 | "foo1" = "perm(1)" 10 | "foo2" = "perm(2)" 11 | "foo3" = "perm(3)" 12 | -------------------------------------------------------------------------------- /fmbt.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/fMBT/37706c8302abfb4e679082678d0b17d3fc897a3c/fmbt.ico -------------------------------------------------------------------------------- /m4/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /man/fmbt-log.1: -------------------------------------------------------------------------------- 1 | .TH FMBT-LOG 1 "Jan 2014" Linux "User Manuals" 2 | .SH NAME 3 | fmbt-log \- parse and print fMBT test logs 4 | .SH SYNOPSIS 5 | .SY fmbt-log 6 | .OP \-f FORMAT 7 | .OP \-t TIME-FORMAT 8 | .OP \-o OUTFILE 9 | [\fILOGFILE\fR]... 10 | . 11 | .SY fmbt-log 12 | .B \-h 13 | | 14 | .B \-\-help 15 | .SH DESCRIPTION 16 | Print selected fields from LOGFILEs written by \fBfmbt\fR. 17 | .SH OPTIONS 18 | .TP 19 | \fB\-h\fR, \fB\-\-help\fR 20 | print help, then exit 21 | .TP 22 | .B \-f \fIFORMAT\fR 23 | defines how the output is formatted. See \fB\-\-help\fR for available 24 | fields. 25 | .TP 26 | .B \-t \fITIME-FORMAT\fR 27 | defines format for printing time values. See \fBstrftime\fR(3) for 28 | valid time formats. 29 | .TP 30 | \fB\-o\fR \fIOUTFILE\fR 31 | write formatted output to OUTFILE, the default is stdout 32 | .SH AUTHOR 33 | Written by Antti Kervinen. 34 | .SH "REPORTING BUGS" 35 | Report bugs to https://github.com/01org/fMBT/issues 36 | .SH COPYRIGHT 37 | Copyright \(co 2014 Intel Corporation. 38 | .SH "SEE ALSO" 39 | .BR fmbt (1) 40 | -------------------------------------------------------------------------------- /man/fmbt-scripter.1: -------------------------------------------------------------------------------- 1 | .TH FMBT-SCRIPTER 1 "Jan 2014" Linux "User Manuals" 2 | .SH NAME 3 | fmbt\-scripter \- grab bitmaps, edit, record and run Python UI tests 4 | .SH SYNOPSIS 5 | .SY fmbt\-scripter 6 | .OP \-h 7 | .OP \-V 8 | [\fIFILE\fR] 9 | .SH DESCRIPTION 10 | Tool for writing UI test scripts using fMBT's GUI test interfaces, 11 | that is, fmbtandroid, fmbttizen, fmbtvnc or fmbtx11 Python 12 | libraries. Selects bitmaps from screenshots, records tests, executes 13 | test code line-by-line and selected block at a time. 14 | 15 | If FILE is given, it will be opened. FILE can be anything that 16 | contains Python, for instance a Python script or an AAL/Python model. 17 | .SH OPTIONS 18 | .TP 19 | \fB\-h\fR, \fB\-\-help\fR 20 | print help, then exit 21 | .TP 22 | \fB\-V\fR, \fB\-\-version\fR 23 | print version, then exit 24 | .SH AUTHOR 25 | Written by Antti Kervinen. 26 | .SH "REPORTING BUGS" 27 | Report bugs to https://github.com/01org/fMBT/issues 28 | .SH COPYRIGHT 29 | Copyright \(co 2014 Intel Corporation. 30 | -------------------------------------------------------------------------------- /packaging/fmbt.dsc.in: -------------------------------------------------------------------------------- 1 | Format: 1.0 2 | Source: fmbt 3 | Binary: fmbt 4 | Architecture: any 5 | Version: TEMPLATE-VERSION 6 | Maintainer: Antti Kervinen 7 | Standards-Version: 3.9.0 8 | Build-Depends: debhelper (>= 7.3.8), libglib2.0-dev, libboost-dev, libedit-dev, python (>= 2.6), automake, libtool, libxml2-dev, libmagickcore-dev, libboost-regex-dev, flex | flex-old, dbus, python-dev, python-pexpect, python-dbus, python-gobject, graphviz, imagemagick 9 | Files: 10 | TEMPLATE-MD5SUM-SIZE-TARBALL 11 | -------------------------------------------------------------------------------- /python3-remotedevices/debian/changelog: -------------------------------------------------------------------------------- 1 | python3-remotedevices (0.3) unstable; urgency=low 2 | 3 | * Initial release for Python 3, ported from Python 2 4 | 5 | -- Antti Kervinen Wed, 24 Jun 2020 15:42:00 +0300 6 | -------------------------------------------------------------------------------- /python3-remotedevices/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /python3-remotedevices/debian/control: -------------------------------------------------------------------------------- 1 | Source: python3-remotedevices 2 | Maintainer: Antti Kervinen 3 | Priority: optional 4 | Standards-Version: 4.1.4 5 | Build-Depends: debhelper (>= 7.3.8), dh-python, python3 6 | X-Python3-Version: >= 3.0 7 | 8 | Package: python3-remotedevices 9 | Architecture: all 10 | Depends: ${python3:Depends}, python3share 11 | Description: Remote device sharing and access 12 | Server, command line client and Python API for 13 | sharing and accessing fMBT GUI test devices remotely. 14 | -------------------------------------------------------------------------------- /python3-remotedevices/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ --with python3 --buildsystem pybuild 4 | -------------------------------------------------------------------------------- /python3-remotedevices/remotedevices_plugins/__init__.py: -------------------------------------------------------------------------------- 1 | # fMBT, free Model Based Testing tool 2 | # Copyright (c) Intel Corporation. 3 | # 4 | # This program is free software; you can redistribute it and/or modify it 5 | # under the terms and conditions of the GNU Lesser General Public License, 6 | # version 2.1, as published by the Free Software Foundation. 7 | # 8 | # This program is distributed in the hope it will be useful, but WITHOUT 9 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 11 | # more details. 12 | # 13 | # You should have received a copy of the GNU Lesser General Public License along with 14 | # this program; if not, write to the Free Software Foundation, Inc., 15 | # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 16 | 17 | """ 18 | remotedevices_plugins package 19 | """ 20 | -------------------------------------------------------------------------------- /python3share/Makefile.am: -------------------------------------------------------------------------------- 1 | dist_man_MANS = \ 2 | man/python3share-server.1 \ 3 | man/python3share-client.1 4 | 5 | dist_noinst_SCRIPTS = \ 6 | setup.py \ 7 | python3share-client \ 8 | python3share-server \ 9 | python3share/__init__.py \ 10 | python3share/client.py \ 11 | python3share/server.py \ 12 | python3share/messages.py 13 | 14 | install-exec-local: 15 | $(PYTHON) setup.py install --root=$(DESTDIR)/ --prefix=$(PYTHON_PREFIX) --install-layout=deb 16 | 17 | pythonshare_installer: $(dist_noinst_SCRIPTS) 18 | cp $? . || true 19 | touch $@ 20 | -------------------------------------------------------------------------------- /python3share/debian/changelog: -------------------------------------------------------------------------------- 1 | python3share (0.42) unstable; urgency=low 2 | 3 | * Initial release. 4 | 5 | -- Antti Kervinen Wed, 23 Oct 2019 20:21:00 +0300 6 | -------------------------------------------------------------------------------- /python3share/debian/compat: -------------------------------------------------------------------------------- 1 | 9 -------------------------------------------------------------------------------- /python3share/debian/control: -------------------------------------------------------------------------------- 1 | Source: python3share 2 | Maintainer: Antti Kervinen 3 | Section: misc 4 | Priority: optional 5 | Standards-Version: 3.9.3 6 | Build-Depends: dh-python (>= 2.2), python3 (>= 3.5) 7 | X-Python3-Version: >= 3.5 8 | 9 | Package: python3share 10 | Architecture: any 11 | Depends: ${python3:Depends}, ${misc:Depends} 12 | Description: Persistent, shared and distributed Python namespaces 13 | Python3share enables executing Python code and evaluating 14 | Python3 expressions in namespaces in pythonshare-servers. 15 | Includes 16 | - python3share-server (daemon, host and proxy namespaces) 17 | - python3share-client (commandline utility for using namespaces 18 | on pythonshare-servers) 19 | - Python API for using pythonshare namespaces. 20 | -------------------------------------------------------------------------------- /python3share/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | export PYBUILD_NAME = python3share 3 | %: 4 | dh $@ --with python3 --buildsystem=pybuild 5 | -------------------------------------------------------------------------------- /python3share/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from distutils.core import setup 4 | 5 | setup(name = 'python3share', 6 | version = '0.42', 7 | description = 'Persistent, shared and distributed Python 3 namespaces', 8 | author = 'Antti Kervinen', 9 | author_email = 'antti.kervinen@intel.com', 10 | packages = ['python3share'], 11 | scripts = ['python3share-client', 'python3share-server'], 12 | package_data = {'python3share': ['__init__.py', 13 | 'client.py', 14 | 'messages.py', 15 | 'server.py']} 16 | ) 17 | -------------------------------------------------------------------------------- /python3share/tests/ps-win.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_py3aal -c "PS_CLIENT=\"python3share-client.bat\"" -c "PS_SERVER=\"python3share-server.bat\"" -l "ps.aal.log" "ps.aal") 2 | adapter = aal 3 | heuristic = lookahead(5) 4 | coverage = sum(perm(2), uinputs(from "i:launch_server" to "i:kill_server.*")) 5 | pass = steps(200) 6 | pass = no_progress(8) 7 | pass = coverage(50) 8 | on_pass = exit(0) 9 | on_fail = exit(1) 10 | on_inconc = exit(2) 11 | -------------------------------------------------------------------------------- /python3share/tests/ps.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_py3aal -c 'PS_CLIENT="../python3share-client"' -c 'PS_SERVER="../python3share-server"' -l "ps.aal.log" "ps.aal") 2 | adapter = aal 3 | heuristic = lookahead(5) 4 | coverage = sum(perm(2), uinputs(from "i:launch_server" to "i:kill_server.*")) 5 | pass = steps(200) 6 | pass = no_progress(8) 7 | pass = coverage(50) 8 | on_pass = exit(0) 9 | on_fail = exit(1) 10 | on_inconc = exit(2) -------------------------------------------------------------------------------- /python3share/tests/python3share-client.bat: -------------------------------------------------------------------------------- 1 | @c:\python37\python.exe %~dp0\..\python3share-client %* 2 | -------------------------------------------------------------------------------- /python3share/tests/python3share-server.bat: -------------------------------------------------------------------------------- 1 | @c:\python37\python.exe %~dp0\..\python3share-server %* 2 | -------------------------------------------------------------------------------- /pythonshare/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pythonshare-client pythonshare-server 2 | recursive-include pythonshare/*.py 3 | -------------------------------------------------------------------------------- /pythonshare/Makefile.am: -------------------------------------------------------------------------------- 1 | dist_man_MANS = \ 2 | man/pythonshare-server.1 \ 3 | man/pythonshare-client.1 4 | 5 | dist_noinst_SCRIPTS = \ 6 | setup.py \ 7 | pythonshare-client \ 8 | pythonshare-server \ 9 | pythonshare/__init__.py \ 10 | pythonshare/client.py \ 11 | pythonshare/server.py \ 12 | pythonshare/messages.py 13 | 14 | install-exec-local: 15 | $(PYTHON) setup.py install --root=$(DESTDIR)/ --prefix=$(PYTHON_PREFIX) 16 | 17 | pythonshare_installer: $(dist_noinst_SCRIPTS) 18 | cp $? . || true 19 | touch $@ 20 | -------------------------------------------------------------------------------- /pythonshare/debian/changelog: -------------------------------------------------------------------------------- 1 | pythonshare (0.42) unstable; urgency=low 2 | 3 | * Initial release. 4 | 5 | -- Antti Kervinen Mon, 16 Dec 2013 15:42:00 +0300 6 | -------------------------------------------------------------------------------- /pythonshare/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /pythonshare/debian/control: -------------------------------------------------------------------------------- 1 | Source: pythonshare 2 | Maintainer: Antti Kervinen 3 | Section: misc 4 | Priority: optional 5 | Standards-Version: 3.9.3 6 | Build-Depends: dh-python (>= 3.2), python (>= 2.6) 7 | X-Python-Version: >= 2.6 8 | 9 | Package: pythonshare 10 | Architecture: any 11 | Depends: ${python:Depends}, ${misc:Depends} 12 | Description: Persistent, shared and distributed Python namespaces 13 | Pythonshare enables executing Python code and evaluating 14 | Python expressions in namespaces in pythonshare-servers. 15 | Includes 16 | - pythonshare-server (daemon, host and proxy namespaces) 17 | - pythonshare-client (commandline utility for using namespaces 18 | on pythonshare-servers) 19 | - Python API for using pythonshare namespaces. 20 | -------------------------------------------------------------------------------- /pythonshare/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ --with python2 4 | -------------------------------------------------------------------------------- /pythonshare/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | COPY usr/ /usr/ 3 | ENV PYTHONPATH=/usr/lib/python27.zip 4 | ENV PYTHONHOME=/usr 5 | EXPOSE 8089 6 | ENTRYPOINT ["/usr/bin/pythonshare-server", "-d", "--interface=all", "--password=xyz"] 7 | -------------------------------------------------------------------------------- /pythonshare/packaging/pythonshare.dsc.in: -------------------------------------------------------------------------------- 1 | Format: 1.0 2 | Source: pythonshare 3 | Binary: pythonshare 4 | Architecture: any 5 | Version: TEMPLATE-VERSION 6 | Maintainer: Antti Kervinen 7 | Standards-Version: 3.9.0 8 | Build-Depends: debhelper (>= 7.3.8), python (>= 2.6) 9 | Files: 10 | TEMPLATE-MD5SUM-SIZE-TARBALL 11 | -------------------------------------------------------------------------------- /pythonshare/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | from distutils.core import setup 4 | 5 | setup(name = 'pythonshare', 6 | version = '0.42', 7 | description = 'Persistent, shared and distributed Python namespaces', 8 | author = 'Antti Kervinen', 9 | author_email = 'antti.kervinen@intel.com', 10 | packages = ['pythonshare'], 11 | scripts = ['pythonshare-client', 'pythonshare-server'], 12 | package_data = {'pythonshare': ['__init__.py', 13 | 'client.py', 14 | 'messages.py', 15 | 'server.py']} 16 | ) 17 | -------------------------------------------------------------------------------- /pythonshare/tests/README.txt: -------------------------------------------------------------------------------- 1 | Run tests: 2 | 3 | $ fmbt ps.conf 4 | -------------------------------------------------------------------------------- /pythonshare/tests/onlinetests.py: -------------------------------------------------------------------------------- 1 | ### Online tests for pythonshare 2 | ### 3 | ### Copyright Jukka Laukkanen / Dashing Test Automation 4 | ### jukka@dashing.fi 5 | ### 6 | 7 | import os 8 | import sys 9 | import pythonshare 10 | 11 | HUB_CONNSPEC = os.getenv("HUB_CONNSPEC", "xyz@localhost") 12 | HUB_NS = os.getenv("HUB_NS", "logger") 13 | TEST_ENV = os.getenv("TEST_ENV", "na") 14 | 15 | password = HUB_CONNSPEC.split("@")[0] 16 | 17 | # don't catch the exception, all failures needs to fail the test 18 | print "Trying to connect to %s/%s" % (HUB_CONNSPEC, HUB_NS) 19 | hub = pythonshare.connect(HUB_CONNSPEC, password, HUB_NS) 20 | data_in = "data = '%s'" % (TEST_ENV,) 21 | print "writing to hub: %s" % (data_in,) 22 | hub.exec_in(HUB_NS, data_in) 23 | print "reading value of 'data' from hub" 24 | ret = hub.eval_in(HUB_NS, "data") 25 | print "value read from hub: %s" % (ret,) 26 | assert ret == TEST_ENV 27 | print "Great success" -------------------------------------------------------------------------------- /pythonshare/tests/ps.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -c 'PS_CLIENT="pythonshare-client"' -c 'PS_SERVER="pythonshare-server"' -l "ps.aal.log" "ps.aal") 2 | adapter = aal 3 | heuristic = lookahead(4) 4 | coverage = perm(3) 5 | pass = steps(200) 6 | pass = no_progress(5) 7 | on_pass = exit(0) 8 | on_fail = exit(1) 9 | on_inconc = exit(2) -------------------------------------------------------------------------------- /remotedevices/debian/changelog: -------------------------------------------------------------------------------- 1 | remotedevices (0.1) unstable; urgency=low 2 | 3 | * Plugin support. 4 | 5 | -- Antti Kervinen Wed, 1 Oct 2014 16:42:00 +0300 6 | 7 | remotedevices (0.0) unstable; urgency=low 8 | 9 | * Initial release. 10 | 11 | -- Antti Kervinen Fri, 29 Aug 2014 15:42:00 +0300 12 | -------------------------------------------------------------------------------- /remotedevices/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /remotedevices/debian/control: -------------------------------------------------------------------------------- 1 | Source: remotedevices 2 | Maintainer: Antti Kervinen 3 | Priority: optional 4 | Standards-Version: 3.9.3 5 | Build-Depends: debhelper (>= 7.3.8), python (>= 2.6) 6 | X-Python-Version: >= 2.6 7 | 8 | Package: remotedevices 9 | Architecture: all 10 | Depends: ${shlibs:Depends}, ${misc:Depends}, python, fmbt-pythonshare, fmbt-adapter-android 11 | Description: Remote device sharing and access 12 | Server, command line client and Python API for 13 | sharing and accessing fMBT GUI test devices remotely. 14 | -------------------------------------------------------------------------------- /remotedevices/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ --with python2 4 | -------------------------------------------------------------------------------- /remotedevices/remotedevices_plugins/__init__.py: -------------------------------------------------------------------------------- 1 | # fMBT, free Model Based Testing tool 2 | # Copyright (c) Intel Corporation. 3 | # 4 | # This program is free software; you can redistribute it and/or modify it 5 | # under the terms and conditions of the GNU Lesser General Public License, 6 | # version 2.1, as published by the Free Software Foundation. 7 | # 8 | # This program is distributed in the hope it will be useful, but WITHOUT 9 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 11 | # more details. 12 | # 13 | # You should have received a copy of the GNU Lesser General Public License along with 14 | # this program; if not, write to the Free Software Foundation, Inc., 15 | # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 16 | 17 | """ 18 | remotedevices_plugins package 19 | """ 20 | -------------------------------------------------------------------------------- /remotedevices/tests/perms-parallel.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(OVERRIDE-MODEL-ON-CMDLINE) 2 | adapter = aal 3 | heuristic = mrandom(4, lookahead(3), 1, random) 4 | coverage = shared(fmbt-trace-share, perm(2)) 5 | 6 | pass = steps(1000) 7 | pass = noprogress(5) 8 | 9 | on_pass = exit(0) 10 | on_fail = exit(1) 11 | on_inconc = exit(2) -------------------------------------------------------------------------------- /remotedevices/tests/perms.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l "rd.aal.log" "rd.aal") 2 | adapter = aal 3 | heuristic = lookahead(3) 4 | coverage = perm(2) 5 | 6 | pass = steps(1000) 7 | pass = noprogress(5) 8 | 9 | on_pass = exit(0) 10 | on_fail = exit(1) 11 | on_inconc = exit(2) -------------------------------------------------------------------------------- /remotedevices/tests/run-parallel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname "$0")" 4 | TESTHOME=$(pwd) 5 | 6 | cd .. 7 | export PATH=$(pwd):$PATH 8 | export PYTHONPATH=$(pwd):$PYTHONPATH 9 | cd "$TESTHOME" 10 | 11 | fmbt-trace-share -K 12 | fmbt-trace-share -S 13 | 14 | FMBT_PIDS="" 15 | 16 | for RD_TEST_PORT in 64440 64441 64442 64443 64444 64445 64446 64447 64448 64449; do 17 | export RD_TEST_PORT 18 | export REMOTEDEVICES_SERVER=localhost:$RD_TEST_PORT 19 | fmbt \ 20 | -o "model=aal_remote(remote_pyaal -l rd.aal.$RD_TEST_PORT.log rd.aal)" \ 21 | -l perms-parallel.$RD_TEST_PORT.log \ 22 | perms-parallel.conf & 23 | FMBT_PID=$! 24 | FMBT_PIDS="$FMBT_PIDS $FMBT_PID" 25 | echo "launched: $FMBT_PID" 26 | sleep 4 27 | done 28 | 29 | echo "waiting: $FMBT_PIDS" 30 | eval wait $FMBT_PIDS 31 | -------------------------------------------------------------------------------- /remotedevices/tests/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname "$0")" 4 | TESTHOME=$(pwd) 5 | 6 | cd .. 7 | export PATH=$(pwd):$PATH 8 | export PYTHONPATH=$(pwd):$PYTHONPATH 9 | cd "$TESTHOME" 10 | 11 | ( fmbt smoke.conf | tee smoke.log ) && ( fmbt perms.conf | tee perms.log ) 12 | -------------------------------------------------------------------------------- /remotedevices/tests/smoke.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l "rd.aal.log" "rd.aal") 2 | adapter = aal 3 | heuristic = lookahead(3) 4 | coverage = perm(1) 5 | pass = steps(60) 6 | pass = lookahead_noprogress 7 | on_pass = exit(0) 8 | on_fail = exit(1) 9 | on_inconc = exit(2) -------------------------------------------------------------------------------- /src/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := stlport_static 2 | -------------------------------------------------------------------------------- /src/aal_loader.cc: -------------------------------------------------------------------------------- 1 | #include "log.hh" 2 | #include "aal.hh" 3 | #include "config.h" 4 | #include "log_aalremote.hh" 5 | #include "verdict.hh" 6 | #include "helper.hh" 7 | 8 | class aal_loader { 9 | public: 10 | 11 | virtual aal* load(std::string& name,Log& l); 12 | }; 13 | aal* aal_loader::load(std::string& name,Log& l) 14 | { 15 | 16 | Model* _model = new_model(l,name); 17 | 18 | if (_model == NULL) 19 | return NULL; 20 | 21 | if (!_model->status) 22 | return NULL; 23 | 24 | Adapter* _adapter = new_adapter(l,"aal"); 25 | 26 | if (_adapter == NULL) 27 | return NULL; 28 | 29 | // We know that aal needs to be not null 30 | return aal::storage->begin()->second; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/aalang_tag.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * fMBT, free Model Based Testing tool 3 | * Copyright (c) 2011, 2013 Intel Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms and conditions of the GNU Lesser General Public License, 7 | * version 2.1, as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | * more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 | * 18 | */ 19 | 20 | -------------------------------------------------------------------------------- /src/coverage_const.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * fMBT, free Model Based Testing tool 3 | * Copyright (c) 2011,2012 Intel Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms and conditions of the GNU Lesser General Public License, 7 | * version 2.1, as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | * more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 | * 18 | */ 19 | 20 | #include "coverage_const.hh" 21 | #include "model.hh" 22 | #include "helper.hh" 23 | 24 | FACTORY_DEFAULT_CREATOR(Coverage, Coverage_Const, "const") 25 | -------------------------------------------------------------------------------- /src/coverage_end_condition.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * fMBT, free Model Based Testing tool 3 | * Copyright (c) 2012, Intel Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms and conditions of the GNU Lesser General Public License, 7 | * version 2.1, as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | * more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 | * 18 | */ 19 | 20 | 21 | #include "coverage_end_condition.hh" 22 | 23 | FACTORY_DEFAULT_CREATOR(Coverage, Coverage_Steps, "steps") 24 | -------------------------------------------------------------------------------- /src/coverage_nohistory.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * fMBT, free Model Based Testing tool 3 | * Copyright (c) 2013, Intel Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms and conditions of the GNU Lesser General Public License, 7 | * version 2.1, as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | * more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 | * 18 | */ 19 | 20 | #include "coverage_nohistory.hh" 21 | 22 | FACTORY_DEFAULT_CREATOR(Coverage, Coverage_nohistory, "no_history") 23 | -------------------------------------------------------------------------------- /src/d/4calc.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | #include 4 | 5 | typedef struct My_ParseNode { 6 | int value; 7 | } My_ParseNode; 8 | #define D_ParseNode_User My_ParseNode 9 | } 10 | 11 | translation_unit : 12 | statement* 13 | ; 14 | 15 | statement : 16 | expr ';' { printf("%d\n", $0.value); } 17 | ; 18 | 19 | expr : 20 | integer { $$.value = atoi($n0.start_loc.s); } 21 | | expr '+' expr $right 10 { $$.value = $0.value + $2.value; } 22 | | expr '-' expr $right 10 { $$.value = $0.value - $2.value; } 23 | | expr '*' expr $right 20 { $$.value = $0.value * $2.value; } 24 | | expr '/' expr $right 20 { $$.value = $0.value / $2.value; } 25 | | '(' expr ')' { $$.value = $1.value; } 26 | ; 27 | 28 | integer : 29 | "-?[0-9]+" 30 | ; 31 | -------------------------------------------------------------------------------- /src/d/4calc.in: -------------------------------------------------------------------------------- 1 | (2 + 2) * 2 ; 2 ; 2 | 3 | -------------------------------------------------------------------------------- /src/d/BUILD_VERSION: -------------------------------------------------------------------------------- 1 | d4ca837bff645291b8a12ade29fdaaab8b70b325 2 | -------------------------------------------------------------------------------- /src/d/README: -------------------------------------------------------------------------------- 1 | This is DParser, a scannerless GLR parser. It uses to Tomita algorithm, 2 | and incorporates BNF production syntax, regular expression terminals, 3 | and a state-specific symbol table. 4 | 5 | It can be compiled to work with or without the Boehm Garbage Collector. 6 | To compile with GC, uncomment the line D_USE_GC=1 in the Makefile. 7 | 8 | The result is natural grammars and powerful parsing. 9 | 10 | To build: 'gmake' (only available with source code package) 11 | To test: 'gmake test' (only available with source code package) 12 | To install: 'gmake install' (binary or source code packages) 13 | 14 | For python support, '(cd python; gmake install)' 15 | 16 | Refer to the manual for more information. 17 | -------------------------------------------------------------------------------- /src/d/arg.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1994-2004 John Plevyak, All Rights Reserved 3 | */ 4 | #include 5 | #include 6 | #include 7 | 8 | #ifndef __alpha 9 | #define atoll atol 10 | #endif 11 | 12 | /* Argument Handling 13 | */ 14 | struct ArgumentState; 15 | 16 | typedef void ArgumentFunction(struct ArgumentState *arg_state, char *arg); 17 | 18 | typedef struct { 19 | char *name; 20 | char key; 21 | char *description; 22 | char *type; 23 | void *location; 24 | char *env; 25 | ArgumentFunction *pfn; 26 | } ArgumentDescription; 27 | 28 | typedef struct ArgumentState { 29 | char **file_argument; 30 | int nfile_arguments; 31 | char *program_name; 32 | ArgumentDescription *desc; 33 | } ArgumentState; 34 | 35 | void usage(ArgumentState *arg_state, char *arg_unused); 36 | void process_args(ArgumentState *arg_state, char **argv); 37 | void free_args(ArgumentState *arg_state); 38 | -------------------------------------------------------------------------------- /src/d/baseline: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/tcsh 2 | 3 | setenv MAKE gmake 4 | parser_tests 5 | foreach f (tests/*.out) 6 | cp $f $f:r.check 7 | end 8 | -------------------------------------------------------------------------------- /src/d/calc: -------------------------------------------------------------------------------- 1 | 10 + 33 - 12; 2 | 1 + 2; 3 | -------------------------------------------------------------------------------- /src/d/driver_parsetree.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/fMBT/37706c8302abfb4e679082678d0b17d3fc897a3c/src/d/driver_parsetree.c -------------------------------------------------------------------------------- /src/d/gramgram.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2002-2004 John Plevyak, All Rights Reserved 3 | */ 4 | struct Production; 5 | struct Rule; 6 | struct Elem; 7 | 8 | typedef struct ParseNode_User { 9 | struct Production *p; 10 | struct Rule *r; 11 | struct Elem *e; 12 | unsigned int kind; 13 | } ParseNode_User; 14 | 15 | #define D_ParseNode_User ParseNode_User 16 | 17 | #define D_ParseNode_Globals struct Grammar 18 | 19 | -------------------------------------------------------------------------------- /src/d/lex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2002-2004 John Plevyak, All Rights Reserved 3 | */ 4 | 5 | #ifndef _lex_H_ 6 | #define _lex_H_ 7 | 8 | /* #define LIVE_DIFF_IN_TRANSITIONS */ 9 | 10 | struct Grammar; 11 | 12 | typedef struct ScanStateTransition { 13 | uint index; 14 | VecAction live_diff; 15 | VecAction accepts_diff; 16 | } ScanStateTransition; 17 | 18 | typedef struct ScanState { 19 | uint index; 20 | struct ScanState *chars[256]; 21 | VecAction accepts; 22 | VecAction live; 23 | ScanStateTransition *transition[256]; 24 | } ScanState; 25 | 26 | void build_scanners(struct Grammar *g); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/d/lr.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2002-2004 John Plevyak, All Rights Reserved 3 | */ 4 | 5 | #ifndef _lr_H_ 6 | #define _lr_H_ 7 | 8 | void build_LR_tables(Grammar *g); 9 | void sort_VecAction(VecAction *v); 10 | uint elem_symbol(Grammar *g, Elem *e); 11 | State *goto_State(State *s, Elem *e); 12 | void free_Action(Action *a); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/d/mkdparse.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2002-2004 John Plevyak, All Rights Reserved 3 | */ 4 | 5 | #include "gramgram.h" 6 | #include "d.h" 7 | #include "mkdparse.h" 8 | 9 | static void 10 | mkdparse_internal(Grammar *g, char *grammar_pathname, char *str) { 11 | if (!grammar_pathname) 12 | grammar_pathname = "-"; 13 | if (parse_grammar(g, grammar_pathname, str) < 0) 14 | d_fail("unable to parse grammar '%s'", grammar_pathname); 15 | if (g->productions.n < 2) 16 | d_fail("no productions in grammar '%s'", grammar_pathname); 17 | if (build_grammar(g) < 0) 18 | d_fail("unable to load grammar '%s'", grammar_pathname); 19 | } 20 | 21 | void 22 | mkdparse(Grammar *g, char *grammar_pathname) { 23 | mkdparse_internal(g, grammar_pathname, 0); 24 | } 25 | 26 | void 27 | mkdparse_from_string(Grammar *g, char *str) { 28 | mkdparse_internal(g, 0, str); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /src/d/mkdparse.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2002-2004 John Plevyak, All Rights Reserved 3 | */ 4 | #ifndef _mkdparse_H_ 5 | #define _mkdparse_H_ 6 | 7 | #include 8 | #if defined(__cplusplus) 9 | extern "C" { 10 | #endif 11 | 12 | struct Grammar; 13 | 14 | void mkdparse(struct Grammar *g, char *grammar_pathname); 15 | void mkdparse_from_string(struct Grammar *g, char *str); 16 | 17 | #if defined(__cplusplus) 18 | } 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/d/my.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "dparse.h" 3 | extern D_ParserTables parser_tables_gram; 4 | int 5 | main(int argc, char *argv[]) { 6 | char s[256], *ss; 7 | D_Parser *p = new_D_Parser(&parser_tables_gram, sizeof(D_ParseNode_User)); 8 | if (fgets(s,255,stdin) && dparse(p, s, strlen(s)) && !p->syntax_errors) 9 | printf("success\n"); 10 | else 11 | printf("failure\n"); 12 | } 13 | -------------------------------------------------------------------------------- /src/d/my.g: -------------------------------------------------------------------------------- 1 | phrase : words ( ABC | AB | A ) words; 2 | words : word*; 3 | word : "[a-z]+"; 4 | A : "a[a-z]*"; 5 | AB : A "b[a-z]*"; 6 | ABC : AB "c[a-z]*"; 7 | -------------------------------------------------------------------------------- /src/d/python/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | swig -python -external-runtime 4 | swig -python dparser.i 5 | python setup.py build 6 | echo "type 'sudo make install' to install" 7 | 8 | install: 9 | python setup.py install 10 | 11 | clean: 12 | rm -rf build dparser.pyc dparser_swigc.* dparser_wrap.c swigpyrun.h tests/d_parser_mach_gen.* 13 | 14 | test: 15 | python tests/test.py 16 | python tests/test2.py 17 | python tests/test3.py 18 | python tests/test4.py 19 | python tests/test5.py 20 | python tests/test6.py 21 | python tests/test7.py 22 | -------------------------------------------------------------------------------- /src/d/python/README: -------------------------------------------------------------------------------- 1 | This module was created by Brian Sabbey (sabbey at u.washington.edu). 2 | 3 | See index.html for details. 4 | 5 | Swig: 6 | make swig 7 | 8 | made with SWIG Version 1.3 9 | 10 | Thanks to: 11 | 12 | Brennan Evans for more general unix support. 13 | 14 | Milosz Krajewski for non-unix support (mostly superseded by binary table support in d parser) and directory independence. 15 | 16 | Yves Forkl for bugs, usability suggestions, and emacs lisp code to jump to syntax error location. 17 | 18 | -------------------------------------------------------------------------------- /src/d/python/dparser.i: -------------------------------------------------------------------------------- 1 | %module dparser_swigc 2 | %{ 3 | #include "pydparser.h" 4 | %} 5 | 6 | %include "pydparser.h" 7 | 8 | typedef struct d_loc_t { 9 | long int s; 10 | char *pathname, *ws; 11 | int col, line; 12 | } d_loc_t; 13 | 14 | typedef struct D_ParseNode { 15 | int symbol; 16 | d_loc_t start_loc; 17 | D_ParseNode_Globals *globals; 18 | user_pyobjects user; 19 | } D_ParseNode; 20 | 21 | D_ParseNode *d_get_child(D_ParseNode *pn, int child); 22 | D_ParseNode *d_find_in_tree(D_ParseNode *pn, int symbol); 23 | int d_get_number_of_children(D_ParseNode *pn); 24 | 25 | -------------------------------------------------------------------------------- /src/d/python/tests/test.py: -------------------------------------------------------------------------------- 1 | from dparser import Parser 2 | 3 | def d_S(t): 4 | '''S : d '+' d''' 5 | return t[0] + t[2] 6 | 7 | def d_number(t): 8 | '''d : "[0-9]+" ''' 9 | return int(t[0]) 10 | 11 | def skip_space(loc): 12 | while loc.s < len(loc.buf) and loc.buf[loc.s:loc.s+len('hello')] == 'hello': 13 | loc.s = loc.s + len('hello') 14 | 15 | parser = Parser(make_grammar_file=1) 16 | 17 | buf = 'hi10hello+3hellohi' 18 | 19 | if parser.parse(buf, buf_offset=2, partial_parses=1, initial_skip_space_fn = skip_space).getStructure() != 13: 20 | print 'fail' 21 | 22 | buf = '87+5' 23 | if parser.parse(buf, initial_skip_space_fn = skip_space).getStructure() != 92: 24 | print 'fail' 25 | -------------------------------------------------------------------------------- /src/d/python/tests/test3.py: -------------------------------------------------------------------------------- 1 | from dparser import Parser 2 | 3 | def d_add1(t): 4 | '''add : add '+' mul''' 5 | return t[0] + t[2] 6 | 7 | def d_add2(t, nodes): 8 | '''add : mul''' 9 | return nodes[0].user.t 10 | 11 | def d_mul1(t): 12 | '''mul : mul '*' exp''' 13 | return t[0]*t[2] 14 | 15 | def d_mul2(t): 16 | '''mul : exp''' 17 | return t[0] 18 | 19 | def d_exp1(t): 20 | '''exp : "[0-9]+"''' 21 | return int(t[0]) 22 | 23 | def d_exp2(t): 24 | '''exp : '(' add ')' ''' 25 | return t[1] 26 | 27 | if Parser().parse('''3*(3+4)''').getStructure() != 21: 28 | print 'fail' 29 | -------------------------------------------------------------------------------- /src/d/python/tests/test4.py: -------------------------------------------------------------------------------- 1 | import dparser 2 | 3 | def d_S(t): 4 | "S: a | b" 5 | return 'S' 6 | 7 | def d_a(t): 8 | "a : x1 x1 'y'" 9 | 10 | def d_b(t): 11 | "b : x2 x2 'y'" 12 | 13 | def d_x1(t, spec): 14 | "x1 : 'x'" 15 | 16 | def d_x2(t, spec): 17 | "x2 : 'x'" 18 | if spec: 19 | return dparser.Reject 20 | 21 | def syntax_error(t): 22 | print 'fail' 23 | 24 | parser = dparser.Parser() 25 | parser.parse('xxy', syntax_error_fn = syntax_error).getStructure() 26 | -------------------------------------------------------------------------------- /src/d/python/tests/test5.py: -------------------------------------------------------------------------------- 1 | import dparser 2 | 3 | def d_h(t): 4 | 'h : h1 | h2' # uh oh, h1 and h2 are both matched by the letter a 5 | return t[0] 6 | 7 | def d_h1(t, spec_only): # h1 will be called for speculative parses only 8 | "h1 : 'a'" 9 | return 1 # This parse will be accepted since dparser.Reject is not returned. Its return value for the final parse will also be 1. 10 | 11 | def d_h2(t, spec): 12 | "h2 : 'a'" 13 | if spec: 14 | return dparser.Reject # don't let h2 match. If this were not here, a dparser.AmbiguityException exception would result 15 | return 2 16 | 17 | parser = dparser.Parser() 18 | if parser.parse('a').getStructure() != 1: 19 | print 'error' 20 | -------------------------------------------------------------------------------- /src/d/python/tests/test6.py: -------------------------------------------------------------------------------- 1 | # replaces the '%' symbol with '+', leaving the return values of actions usable for other things, such as type information, 2 | # and leaving whitespace intact. 3 | 4 | from dparser import Parser 5 | 6 | # turn a tree of strings into a single string (slowly): 7 | def stringify(s): 8 | if type(s) == str: 9 | return s 10 | out = '' 11 | for c in s: 12 | out += stringify(c) 13 | return out 14 | 15 | def d_add1(t, s): 16 | "add : add '%' exp" 17 | s[1] = '+ ' # replace the % with + 18 | 19 | def d_add2(t, s): 20 | "add : exp" 21 | 22 | def d_exp(t): 23 | 'exp : "[0-9]+" ' 24 | 25 | # if the start action specifies the 's' argument, then parser 26 | # will contain a member, s, 27 | 28 | parser = Parser() 29 | parsedmessage = parser.parse('1 % 2 % 3') 30 | if stringify(parsedmessage.getStringLeft()) != '1 + 2 + 3': 31 | print 'error' 32 | -------------------------------------------------------------------------------- /src/d/read_binary.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2002-2004 John Plevyak, All Rights Reserved 3 | */ 4 | #ifndef _read_binary_H_ 5 | #define _read_binary_H_ 6 | 7 | typedef struct BinaryTablesHead { 8 | int n_relocs; 9 | int n_strings; 10 | int d_parser_tables_loc; 11 | int tables_size; 12 | int strings_size; 13 | } BinaryTablesHead; 14 | 15 | typedef struct BinaryTables { 16 | D_ParserTables *parser_tables_gram; 17 | char *tables; 18 | } BinaryTables; 19 | 20 | 21 | BinaryTables * read_binary_tables(char *file_name, D_ReductionCode spec_code, D_ReductionCode final_code); 22 | BinaryTables * read_binary_tables_from_file(FILE *fp, D_ReductionCode spec_code, D_ReductionCode final_code); 23 | BinaryTables * read_binary_tables_from_string(unsigned char *buf, D_ReductionCode spec_code, D_ReductionCode final_code); 24 | void free_BinaryTables(BinaryTables * binary_tables); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/d/scan.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2002-2004 John Plevyak, All Rights Reserved 3 | */ 4 | 5 | #ifndef _scan_H_ 6 | #define _scan_H_ 7 | 8 | #include "d.h" 9 | 10 | typedef struct ShiftResult { 11 | struct SNode *snode; 12 | D_Shift *shift; 13 | d_loc_t loc; 14 | } ShiftResult; 15 | 16 | int scan_buffer(d_loc_t *loc, D_State *st, ShiftResult *result); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/d/tests/1.g: -------------------------------------------------------------------------------- 1 | S: C* 2 | C: A B? { printf("%d" 3 | A: 'a' 4 | B: 'b' 5 | -------------------------------------------------------------------------------- /src/d/tests/ansic.test.g.1: -------------------------------------------------------------------------------- 1 | int i = 1; 2 | int x = &; 3 | int j = 2; 4 | -------------------------------------------------------------------------------- /src/d/tests/ansic.test.g.1.check: -------------------------------------------------------------------------------- 1 | ansic.test.g.1:2: syntax error after '&' 2 | 153 states 59 scans 58 shifts 97 reductions 0 compares 0 ambiguities 3 | (( int ((( i )( = ((((((((((((( 1 )))))))))))))))) ; )( int ((( j )( = ((((((((((((( 2 )))))))))))))))) ; )) 4 | -------------------------------------------------------------------------------- /src/d/tests/ansic.test.g.1.out: -------------------------------------------------------------------------------- 1 | ansic.test.g.1:2: syntax error after '&' 2 | 153 states 59 scans 58 shifts 97 reductions 0 compares 0 ambiguities 3 | (( int ((( i )( = ((((((((((((( 1 )))))))))))))))) ; )( int ((( j )( = ((((((((((((( 2 )))))))))))))))) ; )) 4 | -------------------------------------------------------------------------------- /src/d/tests/g1.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | S: A S 'b' | 'x'; 5 | A: [ printf("speculative e-reduce A\n"); ] 6 | { printf("final e-reduce A\n"); }; 7 | -------------------------------------------------------------------------------- /src/d/tests/g1.test.g.1: -------------------------------------------------------------------------------- 1 | xbbb 2 | -------------------------------------------------------------------------------- /src/d/tests/g1.test.g.1.check: -------------------------------------------------------------------------------- 1 | speculative e-reduce A 2 | final e-reduce A 3 | final e-reduce A 4 | final e-reduce A 5 | 14 states 6 scans 5 shifts 4 reductions 0 compares 0 ambiguities 6 | ((( x b ) b ) b ) 7 | -------------------------------------------------------------------------------- /src/d/tests/g1.test.g.1.out: -------------------------------------------------------------------------------- 1 | speculative e-reduce A 2 | final e-reduce A 3 | final e-reduce A 4 | final e-reduce A 5 | 14 states 6 scans 5 shifts 4 reductions 0 compares 0 ambiguities 6 | ((( x b ) b ) b ) 7 | -------------------------------------------------------------------------------- /src/d/tests/g10.test.g: -------------------------------------------------------------------------------- 1 | S: 'a' 'b' 'c'; 2 | whitespace: "[ \t\n]*"; 3 | -------------------------------------------------------------------------------- /src/d/tests/g10.test.g.1: -------------------------------------------------------------------------------- 1 | a b c 2 | -------------------------------------------------------------------------------- /src/d/tests/g10.test.g.1.check: -------------------------------------------------------------------------------- 1 | 5 states 3 scans 3 shifts 1 reductions 0 compares 0 ambiguities 2 | ( a b c ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g10.test.g.1.out: -------------------------------------------------------------------------------- 1 | 5 states 3 scans 3 shifts 1 reductions 0 compares 0 ambiguities 2 | ( a b c ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g11.test.g: -------------------------------------------------------------------------------- 1 | S: A B C; 2 | A: 'a'?; 3 | B: 'b'*; 4 | C: 'c'+; 5 | -------------------------------------------------------------------------------- /src/d/tests/g11.test.g.1: -------------------------------------------------------------------------------- 1 | abc 2 | -------------------------------------------------------------------------------- /src/d/tests/g11.test.g.1.check: -------------------------------------------------------------------------------- 1 | 17 states 8 scans 3 shifts 10 reductions 0 compares 0 ambiguities 2 | ( a b c ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g11.test.g.1.out: -------------------------------------------------------------------------------- 1 | 17 states 8 scans 3 shifts 10 reductions 0 compares 0 ambiguities 2 | ( a b c ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g11.test.g.2: -------------------------------------------------------------------------------- 1 | cc 2 | -------------------------------------------------------------------------------- /src/d/tests/g11.test.g.2.check: -------------------------------------------------------------------------------- 1 | 13 states 5 scans 2 shifts 8 reductions 0 compares 0 ambiguities 2 | (( c c )) 3 | -------------------------------------------------------------------------------- /src/d/tests/g11.test.g.2.out: -------------------------------------------------------------------------------- 1 | 13 states 5 scans 2 shifts 8 reductions 0 compares 0 ambiguities 2 | (( c c )) 3 | -------------------------------------------------------------------------------- /src/d/tests/g11.test.g.3: -------------------------------------------------------------------------------- 1 | c 2 | -------------------------------------------------------------------------------- /src/d/tests/g11.test.g.3.check: -------------------------------------------------------------------------------- 1 | 9 states 4 scans 1 shifts 5 reductions 0 compares 0 ambiguities 2 | ( c ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g11.test.g.3.out: -------------------------------------------------------------------------------- 1 | 9 states 4 scans 1 shifts 5 reductions 0 compares 0 ambiguities 2 | ( c ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g12.test.g: -------------------------------------------------------------------------------- 1 | P: | 'a' P 'a' | 'b' P 'b'; 2 | -------------------------------------------------------------------------------- /src/d/tests/g12.test.g.1: -------------------------------------------------------------------------------- 1 | a a a a b a b b a b a a a a 2 | -------------------------------------------------------------------------------- /src/d/tests/g12.test.g.1.check: -------------------------------------------------------------------------------- 1 | 48 states 34 scans 24 shifts 15 reductions 0 compares 0 ambiguities 2 | ( a ( a ( a ( a ( b ( a ( b b ) a ) b ) a ) a ) a ) a ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g12.test.g.1.out: -------------------------------------------------------------------------------- 1 | 48 states 34 scans 24 shifts 15 reductions 0 compares 0 ambiguities 2 | ( a ( a ( a ( a ( b ( a ( b b ) a ) b ) a ) a ) a ) a ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g13.test.g: -------------------------------------------------------------------------------- 1 | S : 'i' S ('e' S)? | 'x'; 2 | -------------------------------------------------------------------------------- /src/d/tests/g13.test.g.1: -------------------------------------------------------------------------------- 1 | i i x e x 2 | -------------------------------------------------------------------------------- /src/d/tests/g13.test.g.1.check: -------------------------------------------------------------------------------- 1 | 14 states 6 scans 5 shifts 10 reductions 1 compares 0 ambiguities 2 | ( i ( i x ( e x ))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g13.test.g.1.out: -------------------------------------------------------------------------------- 1 | 14 states 6 scans 5 shifts 10 reductions 1 compares 0 ambiguities 2 | ( i ( i x ( e x ))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g14.test.g: -------------------------------------------------------------------------------- 1 | S : 'i' S | 'i' S 'e' S | 'x'; 2 | -------------------------------------------------------------------------------- /src/d/tests/g14.test.g.1: -------------------------------------------------------------------------------- 1 | i i x e x 2 | -------------------------------------------------------------------------------- /src/d/tests/g14.test.g.1.check: -------------------------------------------------------------------------------- 1 | 11 states 6 scans 5 shifts 7 reductions 1 compares 0 ambiguities 2 | ( i ( i x e x )) 3 | -------------------------------------------------------------------------------- /src/d/tests/g14.test.g.1.out: -------------------------------------------------------------------------------- 1 | 11 states 6 scans 5 shifts 7 reductions 1 compares 0 ambiguities 2 | ( i ( i x e x )) 3 | -------------------------------------------------------------------------------- /src/d/tests/g15.test.g: -------------------------------------------------------------------------------- 1 | S : A | B; 2 | A : 'a'; 3 | B : 'a'; 4 | -------------------------------------------------------------------------------- /src/d/tests/g15.test.g.1: -------------------------------------------------------------------------------- 1 | a 2 | -------------------------------------------------------------------------------- /src/d/tests/g15.test.g.1.check: -------------------------------------------------------------------------------- 1 | 5 states 1 scans 1 shifts 4 reductions 1 compares 1 ambiguities 2 | a 3 | -------------------------------------------------------------------------------- /src/d/tests/g15.test.g.1.out: -------------------------------------------------------------------------------- 1 | 5 states 1 scans 1 shifts 4 reductions 1 compares 1 ambiguities 2 | a 3 | -------------------------------------------------------------------------------- /src/d/tests/g16.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | S : 'a' ('b' { printf("(b)\n"); })* 'c'; 5 | -------------------------------------------------------------------------------- /src/d/tests/g16.test.g.1: -------------------------------------------------------------------------------- 1 | a b b b c 2 | -------------------------------------------------------------------------------- /src/d/tests/g16.test.g.1.check: -------------------------------------------------------------------------------- 1 | (b) 2 | (b) 3 | (b) 4 | 14 states 5 scans 5 shifts 7 reductions 0 compares 0 ambiguities 5 | ( a ( b b b ) c ) 6 | -------------------------------------------------------------------------------- /src/d/tests/g16.test.g.1.out: -------------------------------------------------------------------------------- 1 | (b) 2 | (b) 3 | (b) 4 | 14 states 5 scans 5 shifts 7 reductions 0 compares 0 ambiguities 5 | ( a ( b b b ) c ) 6 | -------------------------------------------------------------------------------- /src/d/tests/g17.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | A: ID moreIDs* ';' ; 5 | moreIDs: ',' ID { printf( "moreIDs\n" ); } ; 6 | ID: "[a-z]+" { printf( "ID\n" ); } ; 7 | -------------------------------------------------------------------------------- /src/d/tests/g17.test.g.1: -------------------------------------------------------------------------------- 1 | abc,def,ghi; 2 | -------------------------------------------------------------------------------- /src/d/tests/g17.test.g.1.check: -------------------------------------------------------------------------------- 1 | ID 2 | ID 3 | moreIDs 4 | ID 5 | moreIDs 6 | 16 states 6 scans 6 shifts 8 reductions 0 compares 0 ambiguities 7 | ( abc (( , def )( , ghi )) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/g17.test.g.1.out: -------------------------------------------------------------------------------- 1 | ID 2 | ID 3 | moreIDs 4 | ID 5 | moreIDs 6 | 16 states 6 scans 6 shifts 8 reductions 0 compares 0 ambiguities 7 | ( abc (( , def )( , ghi )) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/g18.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | A: ID ( ',' ID { printf( "moreIDs\n" ); } )* ';' ; 5 | ID: "[a-z]+" { printf( "ID\n" ); } ; 6 | -------------------------------------------------------------------------------- /src/d/tests/g18.test.g.1: -------------------------------------------------------------------------------- 1 | abc,def,ghi; 2 | -------------------------------------------------------------------------------- /src/d/tests/g18.test.g.1.check: -------------------------------------------------------------------------------- 1 | ID 2 | ID 3 | moreIDs 4 | ID 5 | moreIDs 6 | 16 states 6 scans 6 shifts 8 reductions 0 compares 0 ambiguities 7 | ( abc (( , def )( , ghi )) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/g18.test.g.1.out: -------------------------------------------------------------------------------- 1 | ID 2 | ID 3 | moreIDs 4 | ID 5 | moreIDs 6 | 16 states 6 scans 6 shifts 8 reductions 0 compares 0 ambiguities 7 | ( abc (( , def )( , ghi )) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/g19.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | ${declare all_matches A} 5 | A: ID moreIDs* ';' ; 6 | moreIDs: ',' ID { printf( "moreIDs\n" ); } ; 7 | ID: "[a-z]+" { printf( "ID\n" ); } ; 8 | -------------------------------------------------------------------------------- /src/d/tests/g19.test.g.1: -------------------------------------------------------------------------------- 1 | abc,def,ghi; 2 | -------------------------------------------------------------------------------- /src/d/tests/g19.test.g.1.check: -------------------------------------------------------------------------------- 1 | ID 2 | ID 3 | moreIDs 4 | ID 5 | moreIDs 6 | 16 states 6 scans 6 shifts 8 reductions 0 compares 0 ambiguities 7 | ( abc (( , def )( , ghi )) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/g19.test.g.1.out: -------------------------------------------------------------------------------- 1 | ID 2 | ID 3 | moreIDs 4 | ID 5 | moreIDs 6 | 16 states 6 scans 6 shifts 8 reductions 0 compares 0 ambiguities 7 | ( abc (( , def )( , ghi )) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/g2.test.g: -------------------------------------------------------------------------------- 1 | A: 'd' | B; 2 | B: A; 3 | -------------------------------------------------------------------------------- /src/d/tests/g2.test.g.1: -------------------------------------------------------------------------------- 1 | d 2 | -------------------------------------------------------------------------------- /src/d/tests/g2.test.g.1.check: -------------------------------------------------------------------------------- 1 | 4 states 1 scans 1 shifts 3 reductions 1 compares 0 ambiguities 2 | d 3 | -------------------------------------------------------------------------------- /src/d/tests/g2.test.g.1.out: -------------------------------------------------------------------------------- 1 | 4 states 1 scans 1 shifts 3 reductions 1 compares 0 ambiguities 2 | d 3 | -------------------------------------------------------------------------------- /src/d/tests/g20.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | ${tokenize all_matches A} 5 | A: ID ( ',' ID { printf( "moreIDs\n" ); } )* ';' ; 6 | ID: "[a-z]+" { printf( "ID\n" ); } ; 7 | -------------------------------------------------------------------------------- /src/d/tests/g20.test.g.1: -------------------------------------------------------------------------------- 1 | abc,def,ghi; 2 | -------------------------------------------------------------------------------- /src/d/tests/g20.test.g.1.check: -------------------------------------------------------------------------------- 1 | ID 2 | ID 3 | moreIDs 4 | ID 5 | moreIDs 6 | 16 states 6 scans 6 shifts 8 reductions 0 compares 0 ambiguities 7 | ( abc (( , def )( , ghi )) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/g20.test.g.1.out: -------------------------------------------------------------------------------- 1 | ID 2 | ID 3 | moreIDs 4 | ID 5 | moreIDs 6 | 16 states 6 scans 6 shifts 8 reductions 0 compares 0 ambiguities 7 | ( abc (( , def )( , ghi )) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/g21.test.g: -------------------------------------------------------------------------------- 1 | S : S bop S | uop S | 'x'; 2 | bop : '+' $binary_op_left 2 3 | | $binary_op_left 1; 4 | uop : '+' $unary_op_right 3; 5 | -------------------------------------------------------------------------------- /src/d/tests/g21.test.g.1: -------------------------------------------------------------------------------- 1 | x + x 2 | -------------------------------------------------------------------------------- /src/d/tests/g21.test.g.1.check: -------------------------------------------------------------------------------- 1 | 12 states 7 scans 4 shifts 5 reductions 0 compares 0 ambiguities 2 | ( x + x ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g21.test.g.1.out: -------------------------------------------------------------------------------- 1 | 12 states 7 scans 4 shifts 5 reductions 0 compares 0 ambiguities 2 | ( x + x ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g22.test.g: -------------------------------------------------------------------------------- 1 | E : E bop F | F; 2 | bop: '+' $binary_op_left 2 | $binary_op_left 1; 3 | F : uop F | 'x'; 4 | uop: '+' $unary_op_right 3; 5 | -------------------------------------------------------------------------------- /src/d/tests/g22.test.g.1: -------------------------------------------------------------------------------- 1 | x + x 2 | -------------------------------------------------------------------------------- /src/d/tests/g22.test.g.1.check: -------------------------------------------------------------------------------- 1 | 14 states 7 scans 5 shifts 8 reductions 1 compares 0 ambiguities 2 | ( x + x ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g22.test.g.1.out: -------------------------------------------------------------------------------- 1 | 14 states 7 scans 5 shifts 8 reductions 1 compares 0 ambiguities 2 | ( x + x ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g23.test.g: -------------------------------------------------------------------------------- 1 | ${declare set_op_priority_from_rule} 2 | S : S '+' S $left 2 | S S $left 1 | '+' S $unary_right 3 | 'x'; 3 | -------------------------------------------------------------------------------- /src/d/tests/g23.test.g.1: -------------------------------------------------------------------------------- 1 | x + x 2 | -------------------------------------------------------------------------------- /src/d/tests/g23.test.g.1.check: -------------------------------------------------------------------------------- 1 | 10 states 8 scans 5 shifts 5 reductions 1 compares 0 ambiguities 2 | ( x + x ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g23.test.g.1.out: -------------------------------------------------------------------------------- 1 | 10 states 8 scans 5 shifts 5 reductions 1 compares 0 ambiguities 2 | ( x + x ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g24.test.g: -------------------------------------------------------------------------------- 1 | S: number*; 2 | number ::= integer | longinteger | floatnumber | imagnumber; 3 | integer ::= decimalinteger | octinteger | hexinteger; 4 | decimalinteger ::= nonzerodigit digit* | '0'; 5 | octinteger ::= '0' octdigit+; 6 | hexinteger ::= '0' ('x' | 'X') hexdigit+; 7 | floatnumber ::= pointfloat | exponentfloat; 8 | pointfloat ::= intpart? fraction | intpart '.'; 9 | exponentfloat ::= (intpart | pointfloat) exponent; 10 | intpart ::= digit+; 11 | fraction ::= "." digit+; 12 | exponent ::= ("e" | "E") ("+" | "-")? digit+; 13 | imagnumber ::= (floatnumber | intpart) ("j" | "J"); 14 | longinteger ::= integer ("l" | "L"); 15 | nonzerodigit ::= "[1-9]"; 16 | digit ::= "[0-9]"; 17 | octdigit ::= "[0-7]"; 18 | hexdigit ::= digit | "[a-fA-F]"; 19 | 20 | -------------------------------------------------------------------------------- /src/d/tests/g24.test.g.1: -------------------------------------------------------------------------------- 1 | 123.456e-10 2 | 123.456e-10J 3 | 01234 4 | 234L 5 | 0xBADFEED 6 | -------------------------------------------------------------------------------- /src/d/tests/g24.test.g.1.check: -------------------------------------------------------------------------------- 1 | 18 states 6 scans 5 shifts 11 reductions 0 compares 0 ambiguities 2 | ( 123.456e-10 123.456e-10J 01234 234L 0xBADFEED ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g24.test.g.1.out: -------------------------------------------------------------------------------- 1 | 18 states 6 scans 5 shifts 11 reductions 0 compares 0 ambiguities 2 | ( 123.456e-10 123.456e-10J 01234 234L 0xBADFEED ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g25.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include "dparse_tables.h" 3 | 4 | void mywhite(struct D_Parser *p, d_loc_t *loc, void **p_globals) { 5 | while (*loc->s == ' ') loc->s++; 6 | } 7 | 8 | } 9 | 10 | ${declare whitespace mywhite} 11 | S: '\n' '\t' '\n'; 12 | -------------------------------------------------------------------------------- /src/d/tests/g25.test.g.1: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/d/tests/g25.test.g.1.check: -------------------------------------------------------------------------------- 1 | 5 states 3 scans 3 shifts 1 reductions 0 compares 0 ambiguities 2 | ( 3 | 4 | ) 5 | -------------------------------------------------------------------------------- /src/d/tests/g25.test.g.1.out: -------------------------------------------------------------------------------- 1 | 5 states 3 scans 3 shifts 1 reductions 0 compares 0 ambiguities 2 | ( 3 | 4 | ) 5 | -------------------------------------------------------------------------------- /src/d/tests/g26.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | 5 | S: a [ printf("S\n"); ]; 6 | a ::= 'a' [ printf("a\n"); ]; 7 | -------------------------------------------------------------------------------- /src/d/tests/g26.test.g.1: -------------------------------------------------------------------------------- 1 | a 2 | -------------------------------------------------------------------------------- /src/d/tests/g26.test.g.1.check: -------------------------------------------------------------------------------- 1 | a 2 | S 3 | 3 states 1 scans 1 shifts 1 reductions 0 compares 0 ambiguities 4 | a 5 | -------------------------------------------------------------------------------- /src/d/tests/g26.test.g.1.out: -------------------------------------------------------------------------------- 1 | a 2 | S 3 | 3 states 1 scans 1 shifts 1 reductions 0 compares 0 ambiguities 4 | a 5 | -------------------------------------------------------------------------------- /src/d/tests/g27.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | S: A+; 5 | A: 'a' B* { 6 | int i; 7 | printf("["); 8 | for (i = 0; i < d_get_number_of_children(&$n1); i++) 9 | printf("(%c)", *d_get_child(&$n1, i)->start_loc.s); 10 | printf("]\n"); 11 | }; 12 | B: 'b' | 'B'; 13 | -------------------------------------------------------------------------------- /src/d/tests/g27.test.g.1: -------------------------------------------------------------------------------- 1 | a b B b 2 | a 3 | a b 4 | -------------------------------------------------------------------------------- /src/d/tests/g27.test.g.1.check: -------------------------------------------------------------------------------- 1 | [(b)(B)(b)] 2 | [] 3 | [(b)] 4 | 40 states 15 scans 7 shifts 29 reductions 0 compares 0 ambiguities 5 | (( a ( b B b ))( a )( a b )) 6 | -------------------------------------------------------------------------------- /src/d/tests/g27.test.g.1.out: -------------------------------------------------------------------------------- 1 | [(b)(B)(b)] 2 | [] 3 | [(b)] 4 | 40 states 15 scans 7 shifts 29 reductions 0 compares 0 ambiguities 5 | (( a ( b B b ))( a )( a b )) 6 | -------------------------------------------------------------------------------- /src/d/tests/g28.test.g.1: -------------------------------------------------------------------------------- 1 | a: 1; 2 | a; 3 | { 4 | a: 2; 5 | a; 6 | } 7 | a; 8 | -------------------------------------------------------------------------------- /src/d/tests/g28.test.g.1.check: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 2 4 | 2 5 | 1 6 | 52 states 24 scans 16 shifts 33 reductions 0 compares 0 ambiguities 7 | ((( a : 1 ) ; )( a ; )( { ((( a : 2 ) ; )( a ; )) } )( a ; )) 8 | -------------------------------------------------------------------------------- /src/d/tests/g28.test.g.1.out: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 2 4 | 2 5 | 1 6 | 52 states 24 scans 16 shifts 33 reductions 0 compares 0 ambiguities 7 | ((( a : 1 ) ; )( a ; )( { ((( a : 2 ) ; )( a ; )) } )( a ; )) 8 | -------------------------------------------------------------------------------- /src/d/tests/g28.test.g.2: -------------------------------------------------------------------------------- 1 | a: 1; 2 | { 3 | a: 2; 4 | a; 5 | a: 3; 6 | { 7 | a; 8 | a: 4; 9 | a; 10 | a = 5; 11 | a; 12 | } 13 | a; 14 | { 15 | a = 6; 16 | } 17 | a; 18 | } 19 | a; 20 | -------------------------------------------------------------------------------- /src/d/tests/g28.test.g.2.check: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 2 4 | 3 5 | 3 6 | 4 7 | 4 8 | 5 9 | 5 10 | 3 11 | 6 12 | 6 13 | 1 14 | 129 states 64 scans 44 shifts 80 reductions 0 compares 0 ambiguities 15 | ((( a : 1 ) ; )( { ((( a : 2 ) ; )( a ; )(( a : 3 ) ; )( { (( a ; )(( a : 4 ) ; )( a ; )(( a = 5 ) ; )( a ; )) } )( a ; )( { (( a = 6 ) ; ) } )( a ; )) } )( a ; )) 16 | -------------------------------------------------------------------------------- /src/d/tests/g28.test.g.2.out: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 2 4 | 3 5 | 3 6 | 4 7 | 4 8 | 5 9 | 5 10 | 3 11 | 6 12 | 6 13 | 1 14 | 129 states 64 scans 44 shifts 80 reductions 0 compares 0 ambiguities 15 | ((( a : 1 ) ; )( { ((( a : 2 ) ; )( a ; )(( a : 3 ) ; )( { (( a ; )(( a : 4 ) ; )( a ; )(( a = 5 ) ; )( a ; )) } )( a ; )( { (( a = 6 ) ; ) } )( a ; )) } )( a ; )) 16 | -------------------------------------------------------------------------------- /src/d/tests/g29.test.g.1: -------------------------------------------------------------------------------- 1 | a: 1; 2 | { 3 | a: 2; 4 | a; 5 | a: 3; 6 | { 7 | a; 8 | a: 4; 9 | a; 10 | a = 5; 11 | a; 12 | } 13 | a; 14 | { 15 | a = 6; 16 | } 17 | a: 7; 18 | a; 19 | } 20 | a; 21 | -------------------------------------------------------------------------------- /src/d/tests/g29.test.g.1.check: -------------------------------------------------------------------------------- 1 | duplicate identifier line 5 2 | duplicate identifier line 17 3 | 1 4 | 2 5 | 2 6 | 3 7 | 3 8 | 4 9 | 4 10 | 5 11 | 5 12 | 3 13 | 6 14 | 7 15 | 7 16 | 1 17 | 143 states 70 scans 48 shifts 87 reductions 0 compares 0 ambiguities 18 | ((( a : 1 ) ; )( { ((( a : 2 ) ; )( a ; )(( a : 3 ) ; )( { (( a ; )(( a : 4 ) ; )( a ; )(( a = 5 ) ; )( a ; )) } )( a ; )( { (( a = 6 ) ; ) } )(( a : 7 ) ; )( a ; )) } )( a ; )) 19 | -------------------------------------------------------------------------------- /src/d/tests/g29.test.g.1.out: -------------------------------------------------------------------------------- 1 | duplicate identifier line 5 2 | duplicate identifier line 17 3 | 1 4 | 2 5 | 2 6 | 3 7 | 3 8 | 4 9 | 4 10 | 5 11 | 5 12 | 3 13 | 6 14 | 7 15 | 7 16 | 1 17 | 143 states 70 scans 48 shifts 87 reductions 0 compares 0 ambiguities 18 | ((( a : 1 ) ; )( { ((( a : 2 ) ; )( a ; )(( a : 3 ) ; )( { (( a ; )(( a : 4 ) ; )( a ; )(( a = 5 ) ; )( a ; )) } )( a ; )( { (( a = 6 ) ; ) } )(( a : 7 ) ; )( a ; )) } )( a ; )) 19 | -------------------------------------------------------------------------------- /src/d/tests/g3.test.g: -------------------------------------------------------------------------------- 1 | E: E '+' E | "[abc]"; 2 | -------------------------------------------------------------------------------- /src/d/tests/g3.test.g.1: -------------------------------------------------------------------------------- 1 | b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b 2 | -------------------------------------------------------------------------------- /src/d/tests/g3.test.g.1.check: -------------------------------------------------------------------------------- 1 | 103 states 77 scans 75 shifts 9322 reductions 8419 compares 0 ambiguities 2 | ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + b ))))))))))))))))))))))))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g3.test.g.1.out: -------------------------------------------------------------------------------- 1 | 103 states 77 scans 75 shifts 9322 reductions 8419 compares 0 ambiguities 2 | ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + ( b + b ))))))))))))))))))))))))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g30.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include "stdio.h" 3 | } 4 | 5 | S: A { printf("."); } B; 6 | A: 'a' { printf("a"); }; 7 | B: 'b' { printf("b"); }; 8 | -------------------------------------------------------------------------------- /src/d/tests/g30.test.g.1: -------------------------------------------------------------------------------- 1 | ab 2 | -------------------------------------------------------------------------------- /src/d/tests/g30.test.g.1.check: -------------------------------------------------------------------------------- 1 | a.b7 states 2 scans 2 shifts 3 reductions 0 compares 0 ambiguities 2 | ( a b ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g30.test.g.1.out: -------------------------------------------------------------------------------- 1 | a.b7 states 2 scans 2 shifts 3 reductions 0 compares 0 ambiguities 2 | ( a b ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g31.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | 5 | ${pass sym for_all postorder} 6 | ${pass gen for_all postorder} 7 | 8 | translation_unit: statement*; 9 | 10 | statement 11 | : expression ';' 12 | { 13 | printf("final expression\n"); 14 | d_pass(${parser}, &$n, ${pass sym}); 15 | d_pass(${parser}, &$n, ${pass gen}); 16 | } 17 | ; 18 | 19 | expression 20 | : identifier '=' expression $right 1 21 | sym: { printf("sym =\n"); } 22 | gen: { printf("gen =\n"); } 23 | | integer 24 | gen: { printf("gen integer\n"); } 25 | sym: { printf("sym integer\n"); } 26 | | expression '+' expression $right 2 27 | sym: { printf("sym +\n"); } 28 | ; 29 | 30 | integer: "-?([0-9]|0(x|X))[0-9]*(u|U|b|B|w|W|L|l)*" $term -1; 31 | identifier: "[a-zA-Z_][a-zA-Z_0-9]*"; 32 | -------------------------------------------------------------------------------- /src/d/tests/g31.test.g.1: -------------------------------------------------------------------------------- 1 | 1; 2 | 2 + 3; 3 | b = 3 + 4; 4 | -------------------------------------------------------------------------------- /src/d/tests/g31.test.g.1.check: -------------------------------------------------------------------------------- 1 | final expression 2 | sym integer 3 | gen integer 4 | final expression 5 | sym integer 6 | sym integer 7 | sym + 8 | gen integer 9 | gen integer 10 | final expression 11 | sym integer 12 | sym integer 13 | sym + 14 | sym = 15 | gen integer 16 | gen integer 17 | gen = 18 | 39 states 17 scans 13 shifts 26 reductions 0 compares 0 ambiguities 19 | (( 1 ; )(( 2 + 3 ) ; )(( b = ( 3 + 4 )) ; )) 20 | -------------------------------------------------------------------------------- /src/d/tests/g31.test.g.1.out: -------------------------------------------------------------------------------- 1 | final expression 2 | sym integer 3 | gen integer 4 | final expression 5 | sym integer 6 | sym integer 7 | sym + 8 | gen integer 9 | gen integer 10 | final expression 11 | sym integer 12 | sym integer 13 | sym + 14 | sym = 15 | gen integer 16 | gen integer 17 | gen = 18 | 39 states 17 scans 13 shifts 26 reductions 0 compares 0 ambiguities 19 | (( 1 ; )(( 2 + 3 ) ; )(( b = ( 3 + 4 )) ; )) 20 | -------------------------------------------------------------------------------- /src/d/tests/g32.test.g.1: -------------------------------------------------------------------------------- 1 | /* start */ 2 | a /*some a*/ = /*after = before 1 */ 1 /* after 1 before ; */ ; 3 | /* end */ 4 | -------------------------------------------------------------------------------- /src/d/tests/g32.test.g.1.check: -------------------------------------------------------------------------------- 1 | (/* start */ 2 | )identifier( /*some a*/ )( /*after = before 1 */ )expression: integer( /* after 1 before ; */ )( /*some a*/ )= in expression( /*after = before 1 */ )(/* start */ 3 | )expression ;( 4 | /* end */ 5 | )14 states 6 scans 4 shifts 8 reductions 0 compares 0 ambiguities 6 | (( a = 1 ) ; ) 7 | -------------------------------------------------------------------------------- /src/d/tests/g32.test.g.1.out: -------------------------------------------------------------------------------- 1 | (/* start */ 2 | )identifier( /*some a*/ )( /*after = before 1 */ )expression: integer( /* after 1 before ; */ )( /*some a*/ )= in expression( /*after = before 1 */ )(/* start */ 3 | )expression ;( 4 | /* end */ 5 | )14 states 6 scans 4 shifts 8 reductions 0 compares 0 ambiguities 6 | (( a = 1 ) ; ) 7 | -------------------------------------------------------------------------------- /src/d/tests/g33.test.g.1: -------------------------------------------------------------------------------- 1 | 1; 2 | 2 + 3; 3 | b = 3 + 4; 4 | -------------------------------------------------------------------------------- /src/d/tests/g34.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | 5 | ${declare longest_match identifier} 6 | 7 | P: S*; 8 | 9 | S: 'do' identifier 10 | { printf("do identifier\n"); } 11 | | identifier 12 | { printf("identifier\n"); } 13 | | identifierX 14 | { printf("identifierX\n"); } 15 | ; 16 | 17 | identifier: "[a-z]+" $term -1; 18 | identifierX: "[a-z]+X" $term -1; 19 | -------------------------------------------------------------------------------- /src/d/tests/g34.test.g.1: -------------------------------------------------------------------------------- 1 | dont 2 | thinkX 3 | do thinkit 4 | -------------------------------------------------------------------------------- /src/d/tests/g34.test.g.1.check: -------------------------------------------------------------------------------- 1 | identifier 2 | identifierX 3 | do identifier 4 | 19 states 5 scans 4 shifts 13 reductions 0 compares 0 ambiguities 5 | ( dont thinkX ( do thinkit )) 6 | -------------------------------------------------------------------------------- /src/d/tests/g34.test.g.1.out: -------------------------------------------------------------------------------- 1 | identifier 2 | identifierX 3 | do identifier 4 | 19 states 5 scans 4 shifts 13 reductions 0 compares 0 ambiguities 5 | ( dont thinkX ( do thinkit )) 6 | -------------------------------------------------------------------------------- /src/d/tests/g35.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | 5 | S: identifier* 6 | { printf("identifier\n"); } 7 | ; 8 | 9 | identifier: "[a-z<>=+]+"; 10 | -------------------------------------------------------------------------------- /src/d/tests/g35.test.g.1: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /src/d/tests/g35.test.g.1.check: -------------------------------------------------------------------------------- 1 | identifier 2 | 7 states 2 scans 1 shifts 4 reductions 0 compares 0 ambiguities 3 | asdf 4 | -------------------------------------------------------------------------------- /src/d/tests/g35.test.g.1.out: -------------------------------------------------------------------------------- 1 | identifier 2 | 7 states 2 scans 1 shifts 4 reductions 0 compares 0 ambiguities 3 | asdf 4 | -------------------------------------------------------------------------------- /src/d/tests/g36.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include 3 | } 4 | 5 | ${declare all_matches S} 6 | ${declare longest_match do} 7 | 8 | P: S*; 9 | 10 | S: do identifier 11 | { printf("do identifier\n"); } 12 | | identifier 13 | { printf("identifier\n"); } 14 | | identifierX 15 | { printf("identifierX\n"); } 16 | ; 17 | 18 | do ::= 'do'; 19 | identifier: "[a-z]+" $term -1; 20 | identifierX: "[a-z]+X" $term -1; 21 | -------------------------------------------------------------------------------- /src/d/tests/g36.test.g.1: -------------------------------------------------------------------------------- 1 | dont 2 | formulaX 3 | formula 4 | do form 5 | -------------------------------------------------------------------------------- /src/d/tests/g36.test.g.1.check: -------------------------------------------------------------------------------- 1 | identifier 2 | identifierX 3 | identifier 4 | do identifier 5 | 32 states 8 scans 8 shifts 23 reductions 1 compares 0 ambiguities 6 | ( dont formulaX formula ( do form )) 7 | -------------------------------------------------------------------------------- /src/d/tests/g36.test.g.1.out: -------------------------------------------------------------------------------- 1 | identifier 2 | identifierX 3 | identifier 4 | do identifier 5 | 32 states 8 scans 8 shifts 23 reductions 1 compares 0 ambiguities 6 | ( dont formulaX formula ( do form )) 7 | -------------------------------------------------------------------------------- /src/d/tests/g37.test.g: -------------------------------------------------------------------------------- 1 | S: 'tHiS'/i "tH[a-z]T"/i; 2 | -------------------------------------------------------------------------------- /src/d/tests/g37.test.g.1: -------------------------------------------------------------------------------- 1 | THIS that 2 | -------------------------------------------------------------------------------- /src/d/tests/g37.test.g.1.check: -------------------------------------------------------------------------------- 1 | 4 states 2 scans 2 shifts 1 reductions 0 compares 0 ambiguities 2 | ( THIS that ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g37.test.g.1.out: -------------------------------------------------------------------------------- 1 | 4 states 2 scans 2 shifts 1 reductions 0 compares 0 ambiguities 2 | ( THIS that ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g38.test.g: -------------------------------------------------------------------------------- 1 | S: A B; 2 | A: 'this'; 3 | B: 'that'; 4 | -------------------------------------------------------------------------------- /src/d/tests/g38.test.g.1: -------------------------------------------------------------------------------- 1 | that 2 | -------------------------------------------------------------------------------- /src/d/tests/g38.test.g.1.check: -------------------------------------------------------------------------------- 1 | 3 states 1 scans 1 shifts 1 reductions 0 compares 0 ambiguities 2 | that 3 | -------------------------------------------------------------------------------- /src/d/tests/g38.test.g.1.flags: -------------------------------------------------------------------------------- 1 | -S 3 2 | -------------------------------------------------------------------------------- /src/d/tests/g38.test.g.1.out: -------------------------------------------------------------------------------- 1 | 3 states 1 scans 1 shifts 1 reductions 0 compares 0 ambiguities 2 | that 3 | -------------------------------------------------------------------------------- /src/d/tests/g38.test.g.flags: -------------------------------------------------------------------------------- 1 | -A 2 | -------------------------------------------------------------------------------- /src/d/tests/g39.test.g: -------------------------------------------------------------------------------- 1 | S: '\x74\d104\141t'; 2 | -------------------------------------------------------------------------------- /src/d/tests/g39.test.g.1: -------------------------------------------------------------------------------- 1 | that 2 | -------------------------------------------------------------------------------- /src/d/tests/g39.test.g.1.check: -------------------------------------------------------------------------------- 1 | 3 states 1 scans 1 shifts 1 reductions 0 compares 0 ambiguities 2 | that 3 | -------------------------------------------------------------------------------- /src/d/tests/g39.test.g.1.out: -------------------------------------------------------------------------------- 1 | 3 states 1 scans 1 shifts 1 reductions 0 compares 0 ambiguities 2 | that 3 | -------------------------------------------------------------------------------- /src/d/tests/g4.test.g: -------------------------------------------------------------------------------- 1 | { 2 | extern char *ops; 3 | extern void *ops_cache; 4 | #include "d.h" 5 | int ops_scan(char *ops, void *ops_cache, d_loc_t *loc, 6 | unsigned char *op_assoc, int *op_priority); 7 | 8 | } 9 | 10 | X: '1' (${scan ops_scan(ops, ops_cache)} '2')*; 11 | -------------------------------------------------------------------------------- /src/d/tests/g4.test.g.1: -------------------------------------------------------------------------------- 1 | 1 + 2 + 2 + 2 2 | -------------------------------------------------------------------------------- /src/d/tests/g4.test.g.1.check: -------------------------------------------------------------------------------- 1 | 19 states 8 scans 7 shifts 10 reductions 0 compares 0 ambiguities 2 | ( 1 (( + 2 )( + 2 )( + 2 ))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g4.test.g.1.out: -------------------------------------------------------------------------------- 1 | 19 states 8 scans 7 shifts 10 reductions 0 compares 0 ambiguities 2 | ( 1 (( + 2 )( + 2 )( + 2 ))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g40.test.g.1: -------------------------------------------------------------------------------- 1 | a b : b + b; 2 | -------------------------------------------------------------------------------- /src/d/tests/g40.test.g.1.check: -------------------------------------------------------------------------------- 1 | 59 states 41 scans 21 shifts 36 reductions 2 compares 0 ambiguities 2 | ((( a b : )( b + b )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g40.test.g.1.out: -------------------------------------------------------------------------------- 1 | 59 states 41 scans 21 shifts 36 reductions 2 compares 0 ambiguities 2 | ((( a b : )( b + b )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g41.test.g: -------------------------------------------------------------------------------- 1 | h : h1 h2; 2 | h1 : 'a'; 3 | h2 : 'b'; 4 | -------------------------------------------------------------------------------- /src/d/tests/g41.test.g.1: -------------------------------------------------------------------------------- 1 | a b 2 | -------------------------------------------------------------------------------- /src/d/tests/g41.test.g.1.check: -------------------------------------------------------------------------------- 1 | 6 states 2 scans 2 shifts 3 reductions 0 compares 0 ambiguities 2 | ( a b ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g41.test.g.1.out: -------------------------------------------------------------------------------- 1 | 6 states 2 scans 2 shifts 3 reductions 0 compares 0 ambiguities 2 | ( a b ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g42.include.g: -------------------------------------------------------------------------------- 1 | A: 'a'; 2 | -------------------------------------------------------------------------------- /src/d/tests/g42.test.g: -------------------------------------------------------------------------------- 1 | 2 | S: A B; 3 | 4 | include "g42.include.g" 5 | 6 | B: 'b'; 7 | -------------------------------------------------------------------------------- /src/d/tests/g42.test.g.1: -------------------------------------------------------------------------------- 1 | a b 2 | -------------------------------------------------------------------------------- /src/d/tests/g42.test.g.1.check: -------------------------------------------------------------------------------- 1 | 6 states 2 scans 2 shifts 3 reductions 0 compares 0 ambiguities 2 | ( a b ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g42.test.g.1.out: -------------------------------------------------------------------------------- 1 | 6 states 2 scans 2 shifts 3 reductions 0 compares 0 ambiguities 2 | ( a b ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g: -------------------------------------------------------------------------------- 1 | S: A B C D; 2 | A: ('a' '1')?; 3 | B: ('b' '1')*; 4 | C: ('c' '1')+; 5 | D: (('d' '1')('d' '2')?)*; 6 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.1: -------------------------------------------------------------------------------- 1 | a 1 b 1 b 1 c 1 c 1 d 1 d 2 d 1 2 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.1.check: -------------------------------------------------------------------------------- 1 | 63 states 27 scans 17 shifts 38 reductions 0 compares 0 ambiguities 2 | (( a 1 )(( b 1 )( b 1 ))(( c 1 )( c 1 ))((( d 1 )( d 2 ))( d 1 ))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.1.out: -------------------------------------------------------------------------------- 1 | 63 states 27 scans 17 shifts 38 reductions 0 compares 0 ambiguities 2 | (( a 1 )(( b 1 )( b 1 ))(( c 1 )( c 1 ))((( d 1 )( d 2 ))( d 1 ))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.2: -------------------------------------------------------------------------------- 1 | a 1 b 1 b 1 c 1 c 1 d 1 d 2 d 1 2 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.2.check: -------------------------------------------------------------------------------- 1 | 63 states 27 scans 17 shifts 38 reductions 0 compares 0 ambiguities 2 | (( a 1 )( b 1 b 1 )( c 1 c 1 )( d 1 d 2 d 1 )) 3 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.2.flags: -------------------------------------------------------------------------------- 1 | -e 2 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.2.out: -------------------------------------------------------------------------------- 1 | 63 states 27 scans 17 shifts 38 reductions 0 compares 0 ambiguities 2 | (( a 1 )( b 1 b 1 )( c 1 c 1 )( d 1 d 2 d 1 )) 3 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.3: -------------------------------------------------------------------------------- 1 | a 1 b 1 b 1 c 1 c 1 d 1 d 2 d 1 2 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.3.check: -------------------------------------------------------------------------------- 1 | 63 states 27 scans 17 shifts 38 reductions 0 compares 0 ambiguities 2 | (( a 1 )((( b 1 ))( b 1 ))(( c 1 )( c 1 ))(((( d 1 )( d 2 )))(( d 1 )))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.3.flags: -------------------------------------------------------------------------------- 1 | -f 2 | -------------------------------------------------------------------------------- /src/d/tests/g43.test.g.3.out: -------------------------------------------------------------------------------- 1 | 63 states 27 scans 17 shifts 38 reductions 0 compares 0 ambiguities 2 | (( a 1 )((( b 1 ))( b 1 ))(( c 1 )( c 1 ))(((( d 1 )( d 2 )))(( d 1 )))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g44.test.g: -------------------------------------------------------------------------------- 1 | S: A; 2 | A ::= B; 3 | B ::= "[0-9]+" $name "someint"; 4 | -------------------------------------------------------------------------------- /src/d/tests/g44.test.g.1: -------------------------------------------------------------------------------- 1 | 123 2 | -------------------------------------------------------------------------------- /src/d/tests/g44.test.g.1.check: -------------------------------------------------------------------------------- 1 | 3 states 1 scans 1 shifts 1 reductions 0 compares 0 ambiguities 2 | 123 3 | -------------------------------------------------------------------------------- /src/d/tests/g44.test.g.1.out: -------------------------------------------------------------------------------- 1 | 3 states 1 scans 1 shifts 1 reductions 0 compares 0 ambiguities 2 | 123 3 | -------------------------------------------------------------------------------- /src/d/tests/g45.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include "stdio.h" 3 | #include "dparse.h" 4 | D_Scope *saved = 0; 5 | } 6 | 7 | S: def use; 8 | 9 | def: 'a' { 10 | D_Scope *s = ${scope}; 11 | ${scope} = enter_D_Scope(${scope}, ${scope}); 12 | saved = ${scope}; 13 | NEW_D_SYM(${scope}, "a", 0); 14 | ${scope} = enter_D_Scope(${scope}, s); 15 | }; 16 | 17 | use: 'b' { 18 | if (find_D_Sym(${scope}, "a", 0)) 19 | printf("failed1\n"); 20 | else 21 | printf("succeed1\n"); 22 | ${scope} = scope_D_Scope(${scope}, saved); 23 | if (find_D_Sym(${scope}, "a", 0)) 24 | printf("succeed2\n"); 25 | else 26 | printf("failed2\n"); 27 | }; 28 | -------------------------------------------------------------------------------- /src/d/tests/g45.test.g.1: -------------------------------------------------------------------------------- 1 | a b 2 | -------------------------------------------------------------------------------- /src/d/tests/g45.test.g.1.check: -------------------------------------------------------------------------------- 1 | succeed1 2 | succeed2 3 | 6 states 2 scans 2 shifts 3 reductions 0 compares 0 ambiguities 4 | ( a b ) 5 | -------------------------------------------------------------------------------- /src/d/tests/g45.test.g.1.out: -------------------------------------------------------------------------------- 1 | succeed1 2 | succeed2 3 | 6 states 2 scans 2 shifts 3 reductions 0 compares 0 ambiguities 4 | ( a b ) 5 | -------------------------------------------------------------------------------- /src/d/tests/g46.test.g: -------------------------------------------------------------------------------- 1 | 2 | A : "foo/bar" "barrel"; 3 | -------------------------------------------------------------------------------- /src/d/tests/g46.test.g.1: -------------------------------------------------------------------------------- 1 | foobarrel 2 | -------------------------------------------------------------------------------- /src/d/tests/g46.test.g.1.check: -------------------------------------------------------------------------------- 1 | 4 states 2 scans 2 shifts 1 reductions 0 compares 0 ambiguities 2 | ( foo barrel ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g46.test.g.1.out: -------------------------------------------------------------------------------- 1 | 4 states 2 scans 2 shifts 1 reductions 0 compares 0 ambiguities 2 | ( foo barrel ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g47.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include "stdio.h" 3 | #include "string.h" 4 | #include "stdlib.h" 5 | char *xdup(char *s, char *e) { 6 | char *ss = malloc( e - s + 2 ); 7 | memcpy(ss, s, e-s); 8 | ss[e-s] = 0; 9 | return ss; 10 | } 11 | } 12 | top: ( block explicit_space? )+; 13 | explicit_space : "[ \n]+"; 14 | block : para { printf("BLOCK(%s)\n", xdup($n.start_loc.s, $n.end)); } 15 | | list { printf("BLOCK(%s)\n", xdup($n.start_loc.s, $n.end)); }; 16 | list : list_item+ { printf("LIST(%s)\n", xdup($n.start_loc.s, $n.end)); }; 17 | list_item : "%?---" para_within_list+ { printf("ITEM(%s)\n", xdup($n.start_loc.s, $n.end)); }; 18 | para_within_list : "[a-zA-Z0-9 ,]+\." { printf("PARA(%s)\n", xdup($n.start_loc.s, $n.end)); }; 19 | para : '%' para_within_list { printf("BARE\n"); }; 20 | whitespace: "[\t\n]"; 21 | -------------------------------------------------------------------------------- /src/d/tests/g47.test.g.1: -------------------------------------------------------------------------------- 1 | %A para.---List item 1. Item 1, para 2.%---List item 2.%---List item 3.%Final para. 2 | -------------------------------------------------------------------------------- /src/d/tests/g47.test.g.1.check: -------------------------------------------------------------------------------- 1 | PARA(A para.) 2 | BARE 3 | BLOCK(%A para.) 4 | PARA(List item 1.) 5 | PARA( Item 1, para 2.) 6 | ITEM(---List item 1. Item 1, para 2.) 7 | PARA(List item 2.) 8 | ITEM(%---List item 2.) 9 | PARA(List item 3.) 10 | ITEM(%---List item 3.) 11 | LIST(---List item 1. Item 1, para 2.%---List item 2.%---List item 3.) 12 | BLOCK(---List item 1. Item 1, para 2.%---List item 2.%---List item 3.) 13 | PARA(Final para.) 14 | BARE 15 | BLOCK(%Final para.) 16 | 82 states 30 scans 17 shifts 80 reductions 3 compares 0 ambiguities 17 | (( % A para. )(( --- ( List item 1. Item 1, para 2. ))( %--- List item 2. )( %--- List item 3. ))(( % Final para. ) 18 | )) 19 | -------------------------------------------------------------------------------- /src/d/tests/g47.test.g.1.out: -------------------------------------------------------------------------------- 1 | PARA(A para.) 2 | BARE 3 | BLOCK(%A para.) 4 | PARA(List item 1.) 5 | PARA( Item 1, para 2.) 6 | ITEM(---List item 1. Item 1, para 2.) 7 | PARA(List item 2.) 8 | ITEM(%---List item 2.) 9 | PARA(List item 3.) 10 | ITEM(%---List item 3.) 11 | LIST(---List item 1. Item 1, para 2.%---List item 2.%---List item 3.) 12 | BLOCK(---List item 1. Item 1, para 2.%---List item 2.%---List item 3.) 13 | PARA(Final para.) 14 | BARE 15 | BLOCK(%Final para.) 16 | 82 states 30 scans 17 shifts 80 reductions 3 compares 0 ambiguities 17 | (( % A para. )(( --- ( List item 1. Item 1, para 2. ))( %--- List item 2. )( %--- List item 3. ))(( % Final para. ) 18 | )) 19 | -------------------------------------------------------------------------------- /src/d/tests/g48.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include "stdio.h" 3 | #include "string.h" 4 | #include "stdlib.h" 5 | char *xdup(char *s, char *e) { 6 | char *ss = malloc( e - s + 2 ); 7 | memcpy(ss, s, e-s); 8 | ss[e-s] = 0; 9 | return ss; 10 | } 11 | } 12 | top: A ( B C { printf("%s\n", xdup($n.start_loc.s, $n.end)); } ) D; 13 | A: 'A'; 14 | B: 'B'; 15 | C: 'C'; 16 | D: 'D'; 17 | whitespace: "[\t\n ]"; 18 | -------------------------------------------------------------------------------- /src/d/tests/g48.test.g.1: -------------------------------------------------------------------------------- 1 | A B C D -------------------------------------------------------------------------------- /src/d/tests/g48.test.g.1.check: -------------------------------------------------------------------------------- 1 | B C 2 | 11 states 4 scans 4 shifts 6 reductions 0 compares 0 ambiguities 3 | ( A ( B C ) D ) 4 | -------------------------------------------------------------------------------- /src/d/tests/g48.test.g.1.out: -------------------------------------------------------------------------------- 1 | B C 2 | 11 states 4 scans 4 shifts 6 reductions 0 compares 0 ambiguities 3 | ( A ( B C ) D ) 4 | -------------------------------------------------------------------------------- /src/d/tests/g49.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include "stdio.h" 3 | #include "string.h" 4 | #include "stdlib.h" 5 | } 6 | top: A B C D; 7 | A: 'A'; 8 | B: 'B'; 9 | C: 'C' { printf("%i %i\n", $n.start_loc.line, $n.start_loc.col ); }; 10 | D: 'D'; 11 | whitespace: "[\t\n ]*"; 12 | -------------------------------------------------------------------------------- /src/d/tests/g49.test.g.1: -------------------------------------------------------------------------------- 1 | A 2 | 3 | 4 | B C 5 | D 6 | -------------------------------------------------------------------------------- /src/d/tests/g49.test.g.1.check: -------------------------------------------------------------------------------- 1 | 4 12 2 | 10 states 4 scans 4 shifts 5 reductions 0 compares 0 ambiguities 3 | ( A B C D ) 4 | -------------------------------------------------------------------------------- /src/d/tests/g49.test.g.1.out: -------------------------------------------------------------------------------- 1 | 4 12 2 | 10 states 4 scans 4 shifts 5 reductions 0 compares 0 ambiguities 3 | ( A B C D ) 4 | -------------------------------------------------------------------------------- /src/d/tests/g5.test.g: -------------------------------------------------------------------------------- 1 | A : 'i' A ('e' A)? | 'x'; 2 | -------------------------------------------------------------------------------- /src/d/tests/g5.test.g.1: -------------------------------------------------------------------------------- 1 | i i x 2 | -------------------------------------------------------------------------------- /src/d/tests/g5.test.g.1.check: -------------------------------------------------------------------------------- 1 | 7 states 4 scans 3 shifts 4 reductions 0 compares 0 ambiguities 2 | ( i ( i x )) 3 | -------------------------------------------------------------------------------- /src/d/tests/g5.test.g.1.out: -------------------------------------------------------------------------------- 1 | 7 states 4 scans 3 shifts 4 reductions 0 compares 0 ambiguities 2 | ( i ( i x )) 3 | -------------------------------------------------------------------------------- /src/d/tests/g6.test.g: -------------------------------------------------------------------------------- 1 | S: 'b' A; 2 | A : 'a' A B | ; 3 | B : ; 4 | -------------------------------------------------------------------------------- /src/d/tests/g6.test.g.1: -------------------------------------------------------------------------------- 1 | b a a 2 | -------------------------------------------------------------------------------- /src/d/tests/g6.test.g.1.check: -------------------------------------------------------------------------------- 1 | 14 states 4 scans 3 shifts 7 reductions 0 compares 0 ambiguities 2 | ( b ( a ( a ))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g6.test.g.1.out: -------------------------------------------------------------------------------- 1 | 14 states 4 scans 3 shifts 7 reductions 0 compares 0 ambiguities 2 | ( b ( a ( a ))) 3 | -------------------------------------------------------------------------------- /src/d/tests/g7.test.g: -------------------------------------------------------------------------------- 1 | { 2 | #include "dparse.h" 3 | #include "g7.test.g.d_parser.h" 4 | int myscanner(d_loc_t *loc, unsigned short *symbol, 5 | int *term_priority, unsigned char *op_assoc, int *op_priority) 6 | { 7 | if (loc->s[0] == 'a') { 8 | loc->s++; 9 | *symbol = A; 10 | return 1; 11 | } else if (loc->s[0] == 'b') { 12 | loc->s++; 13 | *symbol = BB; 14 | return 1; 15 | } else if (loc->s[0] == 'c') { 16 | loc->s++; 17 | *symbol = CCC; 18 | return 1; 19 | } else if (loc->s[0] == 'd') { 20 | loc->s++; 21 | *symbol = DDDD; 22 | return 1; 23 | } else 24 | return 0; 25 | } 26 | 27 | } 28 | ${scanner myscanner} 29 | ${token A BB CCC DDDD} 30 | 31 | S: A (BB CCC)+ SS; 32 | SS: DDDD; 33 | -------------------------------------------------------------------------------- /src/d/tests/g7.test.g.1: -------------------------------------------------------------------------------- 1 | a b c b c d 2 | -------------------------------------------------------------------------------- /src/d/tests/g7.test.g.1.check: -------------------------------------------------------------------------------- 1 | 13 states 6 scans 6 shifts 6 reductions 0 compares 0 ambiguities 2 | ( a (( b c )( b c )) d ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g7.test.g.1.out: -------------------------------------------------------------------------------- 1 | 13 states 6 scans 6 shifts 6 reductions 0 compares 0 ambiguities 2 | ( a (( b c )( b c )) d ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g7.test.g.2: -------------------------------------------------------------------------------- 1 | abcbcbcd 2 | -------------------------------------------------------------------------------- /src/d/tests/g7.test.g.2.check: -------------------------------------------------------------------------------- 1 | 17 states 8 scans 8 shifts 8 reductions 0 compares 0 ambiguities 2 | ( a (( b c )( b c )( b c )) d ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g7.test.g.2.out: -------------------------------------------------------------------------------- 1 | 17 states 8 scans 8 shifts 8 reductions 0 compares 0 ambiguities 2 | ( a (( b c )( b c )( b c )) d ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g8.test.g: -------------------------------------------------------------------------------- 1 | A: 'd' $left 2 | B $left 1; 2 | B: A; 3 | -------------------------------------------------------------------------------- /src/d/tests/g8.test.g.1: -------------------------------------------------------------------------------- 1 | d 2 | -------------------------------------------------------------------------------- /src/d/tests/g8.test.g.1.check: -------------------------------------------------------------------------------- 1 | 4 states 1 scans 1 shifts 3 reductions 1 compares 0 ambiguities 2 | d 3 | -------------------------------------------------------------------------------- /src/d/tests/g8.test.g.1.out: -------------------------------------------------------------------------------- 1 | 4 states 1 scans 1 shifts 3 reductions 1 compares 0 ambiguities 2 | d 3 | -------------------------------------------------------------------------------- /src/d/tests/g9.test.g: -------------------------------------------------------------------------------- 1 | E: E '+' E $binary_left 1 | "[abc]"; 2 | -------------------------------------------------------------------------------- /src/d/tests/g9.test.g.1: -------------------------------------------------------------------------------- 1 | b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b 2 | -------------------------------------------------------------------------------- /src/d/tests/g9.test.g.1.check: -------------------------------------------------------------------------------- 1 | 103 states 77 scans 75 shifts 2951 reductions 0 compares 0 ambiguities 2 | ((((((((((((((((((((((((( b + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) 3 | -------------------------------------------------------------------------------- /src/d/tests/g9.test.g.1.out: -------------------------------------------------------------------------------- 1 | 103 states 77 scans 75 shifts 2951 reductions 0 compares 0 ambiguities 2 | ((((((((((((((((((((((((( b + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) + b ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.0: -------------------------------------------------------------------------------- 1 | x++.y; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.0.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | 24 states 12 scans 6 shifts 13 reductions 0 compares 0 ambiguities 4 | ((( x ++ ) . y ) ; ) 5 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.0.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | 24 states 12 scans 6 shifts 13 reductions 0 compares 0 ambiguities 4 | ((( x ++ ) . y ) ; ) 5 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.1: -------------------------------------------------------------------------------- 1 | 2 + 3 * 4; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.1.check: -------------------------------------------------------------------------------- 1 | 32 states 12 scans 9 shifts 20 reductions 0 compares 0 ambiguities 2 | (( 2 + ( 3 * 4 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.1.out: -------------------------------------------------------------------------------- 1 | 32 states 12 scans 9 shifts 20 reductions 0 compares 0 ambiguities 2 | (( 2 + ( 3 * 4 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.10: -------------------------------------------------------------------------------- 1 | 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 2 + 3 + 4; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.10.check: -------------------------------------------------------------------------------- 1 | 132 states 52 scans 49 shifts 79 reductions 0 compares 0 ambiguities 2 | ((((((((((((( 1 + 2 ) + 3 ) + 4 ) + 5 ) + 6 ) + 7 ) + 8 ) + 9 ) + 1 ) + 2 ) + 3 ) + 4 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.10.out: -------------------------------------------------------------------------------- 1 | 132 states 52 scans 49 shifts 79 reductions 0 compares 0 ambiguities 2 | ((((((((((((( 1 + 2 ) + 3 ) + 4 ) + 5 ) + 6 ) + 7 ) + 8 ) + 9 ) + 1 ) + 2 ) + 3 ) + 4 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.11: -------------------------------------------------------------------------------- 1 | +++++++++++1; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.11.check: -------------------------------------------------------------------------------- 1 | 25 states 11 scans 8 shifts 19 reductions 0 compares 0 ambiguities 2 | (( ++ ( ++ ( ++ ( ++ ( ++ ( + 1 )))))) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.11.out: -------------------------------------------------------------------------------- 1 | 25 states 11 scans 8 shifts 19 reductions 0 compares 0 ambiguities 2 | (( ++ ( ++ ( ++ ( ++ ( ++ ( + 1 )))))) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.12: -------------------------------------------------------------------------------- 1 | 1 * 2 + 3; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.12.check: -------------------------------------------------------------------------------- 1 | 32 states 12 scans 9 shifts 19 reductions 0 compares 0 ambiguities 2 | ((( 1 * 2 ) + 3 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.12.out: -------------------------------------------------------------------------------- 1 | 32 states 12 scans 9 shifts 19 reductions 0 compares 0 ambiguities 2 | ((( 1 * 2 ) + 3 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.13: -------------------------------------------------------------------------------- 1 | if (x) if (y) z else q; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.13.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | ref Sym 'q' line 1: not found 5 | 33 states 20 scans 12 shifts 18 reductions 1 compares 0 ambiguities 6 | (( if ( x ) ( if ( y ) z else q )) ; ) 7 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.13.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | ref Sym 'q' line 1: not found 5 | 33 states 20 scans 12 shifts 18 reductions 1 compares 0 ambiguities 6 | (( if ( x ) ( if ( y ) z else q )) ; ) 7 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.14: -------------------------------------------------------------------------------- 1 | 1 + 2 + 3; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.14.check: -------------------------------------------------------------------------------- 1 | 32 states 12 scans 9 shifts 19 reductions 0 compares 0 ambiguities 2 | ((( 1 + 2 ) + 3 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.14.out: -------------------------------------------------------------------------------- 1 | 32 states 12 scans 9 shifts 19 reductions 0 compares 0 ambiguities 2 | ((( 1 + 2 ) + 3 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.15: -------------------------------------------------------------------------------- 1 | 1 + 2 + 3 + 4; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.15.check: -------------------------------------------------------------------------------- 1 | 42 states 16 scans 13 shifts 25 reductions 0 compares 0 ambiguities 2 | (((( 1 + 2 ) + 3 ) + 4 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.15.out: -------------------------------------------------------------------------------- 1 | 42 states 16 scans 13 shifts 25 reductions 0 compares 0 ambiguities 2 | (((( 1 + 2 ) + 3 ) + 4 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.16: -------------------------------------------------------------------------------- 1 | + + 1; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.16.check: -------------------------------------------------------------------------------- 1 | 17 states 7 scans 4 shifts 11 reductions 0 compares 0 ambiguities 2 | (( + ( + 1 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.16.out: -------------------------------------------------------------------------------- 1 | 17 states 7 scans 4 shifts 11 reductions 0 compares 0 ambiguities 2 | (( + ( + 1 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.17: -------------------------------------------------------------------------------- 1 | 1 2 + 3; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.17.check: -------------------------------------------------------------------------------- 1 | 28 states 11 scans 7 shifts 18 reductions 0 compares 0 ambiguities 2 | (( 1 ( 2 + 3 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.17.out: -------------------------------------------------------------------------------- 1 | 28 states 11 scans 7 shifts 18 reductions 0 compares 0 ambiguities 2 | (( 1 ( 2 + 3 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.18: -------------------------------------------------------------------------------- 1 | do a while b; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.18.check: -------------------------------------------------------------------------------- 1 | ref Sym 'a' line 1: not found 2 | ref Sym 'b' line 1: not found 3 | 19 states 10 scans 6 shifts 9 reductions 0 compares 0 ambiguities 4 | (( do a while b ) ; ) 5 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.18.out: -------------------------------------------------------------------------------- 1 | ref Sym 'a' line 1: not found 2 | ref Sym 'b' line 1: not found 3 | 19 states 10 scans 6 shifts 9 reductions 0 compares 0 ambiguities 4 | (( do a while b ) ; ) 5 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.19: -------------------------------------------------------------------------------- 1 | for (x = 1; x < y; x++) h; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.19.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'x' line 1: not found 3 | ref Sym 'y' line 1: not found 4 | ref Sym 'x' line 1: not found 5 | ref Sym 'h' line 1: not found 6 | 66 states 33 scans 16 shifts 37 reductions 0 compares 0 ambiguities 7 | (( for ( ( x = 1 )( ; ( x < y )( ; ( x ++ ))) ) h ) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.19.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'x' line 1: not found 3 | ref Sym 'y' line 1: not found 4 | ref Sym 'x' line 1: not found 5 | ref Sym 'h' line 1: not found 6 | 66 states 33 scans 16 shifts 37 reductions 0 compares 0 ambiguities 7 | (( for ( ( x = 1 )( ; ( x < y )( ; ( x ++ ))) ) h ) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.2: -------------------------------------------------------------------------------- 1 | 1 * 2 * 3; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.2.check: -------------------------------------------------------------------------------- 1 | 32 states 12 scans 9 shifts 19 reductions 0 compares 0 ambiguities 2 | ((( 1 * 2 ) * 3 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.2.out: -------------------------------------------------------------------------------- 1 | 32 states 12 scans 9 shifts 19 reductions 0 compares 0 ambiguities 2 | ((( 1 * 2 ) * 3 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.20: -------------------------------------------------------------------------------- 1 | x ? y : z ? d : e; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.20.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | ref Sym 'd' line 1: not found 5 | ref Sym 'e' line 1: not found 6 | 33 states 19 scans 11 shifts 18 reductions 0 compares 0 ambiguities 7 | (( x ? y : ( z ? d : e )) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.20.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | ref Sym 'd' line 1: not found 5 | ref Sym 'e' line 1: not found 6 | 33 states 19 scans 11 shifts 18 reductions 0 compares 0 ambiguities 7 | (( x ? y : ( z ? d : e )) ; ) 8 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.21: -------------------------------------------------------------------------------- 1 | a = 1 + 2 + 3 + 4 + 5 + 6; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.21.check: -------------------------------------------------------------------------------- 1 | ref Sym 'a' line 1: not found 2 | 69 states 29 scans 24 shifts 46 reductions 0 compares 0 ambiguities 3 | (( a = ((((( 1 + 2 ) + 3 ) + 4 ) + 5 ) + 6 )) ; ) 4 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.21.out: -------------------------------------------------------------------------------- 1 | ref Sym 'a' line 1: not found 2 | 69 states 29 scans 24 shifts 46 reductions 0 compares 0 ambiguities 3 | (( a = ((((( 1 + 2 ) + 3 ) + 4 ) + 5 ) + 6 )) ; ) 4 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.23: -------------------------------------------------------------------------------- 1 | 1 + --a; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.23.check: -------------------------------------------------------------------------------- 1 | ref Sym 'a' line 1: not found 2 | 24 states 10 scans 6 shifts 14 reductions 0 compares 0 ambiguities 3 | (( 1 + ( -- a )) ; ) 4 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.23.out: -------------------------------------------------------------------------------- 1 | ref Sym 'a' line 1: not found 2 | 24 states 10 scans 6 shifts 14 reductions 0 compares 0 ambiguities 3 | (( 1 + ( -- a )) ; ) 4 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.24: -------------------------------------------------------------------------------- 1 | if (x) y + z * n else q + s * t; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.24.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | ref Sym 'n' line 1: not found 5 | ref Sym 'q' line 1: not found 6 | ref Sym 's' line 1: not found 7 | ref Sym 't' line 1: not found 8 | 65 states 34 scans 26 shifts 38 reductions 0 compares 0 ambiguities 9 | (( if ( x ) ( y + ( z * n )) else ( q + ( s * t ))) ; ) 10 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.24.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | ref Sym 'n' line 1: not found 5 | ref Sym 'q' line 1: not found 6 | ref Sym 's' line 1: not found 7 | ref Sym 't' line 1: not found 8 | 65 states 34 scans 26 shifts 38 reductions 0 compares 0 ambiguities 9 | (( if ( x ) ( y + ( z * n )) else ( q + ( s * t ))) ; ) 10 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.25: -------------------------------------------------------------------------------- 1 | if (x) y else z + 5; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.25.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | 36 states 19 scans 12 shifts 19 reductions 0 compares 0 ambiguities 5 | (( if ( x ) y else ( z + 5 )) ; ) 6 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.25.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | 36 states 19 scans 12 shifts 19 reductions 0 compares 0 ambiguities 5 | (( if ( x ) y else ( z + 5 )) ; ) 6 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.26: -------------------------------------------------------------------------------- 1 | if (x) y else if (y) z else if (z) zz else zzz; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.26.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'y' line 1: not found 4 | ref Sym 'z' line 1: not found 5 | ref Sym 'z' line 1: not found 6 | ref Sym 'zz' line 1: not found 7 | ref Sym 'zzz' line 1: not found 8 | 51 states 32 scans 20 shifts 26 reductions 0 compares 0 ambiguities 9 | (( if ( x ) y else ( if ( y ) z else ( if ( z ) zz else zzz ))) ; ) 10 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.26.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'y' line 1: not found 4 | ref Sym 'z' line 1: not found 5 | ref Sym 'z' line 1: not found 6 | ref Sym 'zz' line 1: not found 7 | ref Sym 'zzz' line 1: not found 8 | 51 states 32 scans 20 shifts 26 reductions 0 compares 0 ambiguities 9 | (( if ( x ) y else ( if ( y ) z else ( if ( z ) zz else zzz ))) ; ) 10 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.27: -------------------------------------------------------------------------------- 1 | if (x) if (y) if (z) zz; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.27.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | ref Sym 'zz' line 1: not found 5 | 33 states 20 scans 14 shifts 15 reductions 0 compares 0 ambiguities 6 | (( if ( x ) ( if ( y ) ( if ( z ) zz ))) ; ) 7 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.27.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | ref Sym 'zz' line 1: not found 5 | 33 states 20 scans 14 shifts 15 reductions 0 compares 0 ambiguities 6 | (( if ( x ) ( if ( y ) ( if ( z ) zz ))) ; ) 7 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.28: -------------------------------------------------------------------------------- 1 | if (x) y z else q; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.28.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | ref Sym 'q' line 1: not found 5 | 31 states 18 scans 9 shifts 16 reductions 0 compares 0 ambiguities 6 | (( if ( x ) ( y z ) else q ) ; ) 7 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.28.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | ref Sym 'q' line 1: not found 5 | 31 states 18 scans 9 shifts 16 reductions 0 compares 0 ambiguities 6 | (( if ( x ) ( y z ) else q ) ; ) 7 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.29: -------------------------------------------------------------------------------- 1 | if (x) y z; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.29.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | 25 states 14 scans 7 shifts 13 reductions 0 compares 0 ambiguities 5 | (( if ( x ) ( y z )) ; ) 6 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.29.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'y' line 1: not found 3 | ref Sym 'z' line 1: not found 4 | 25 states 14 scans 7 shifts 13 reductions 0 compares 0 ambiguities 5 | (( if ( x ) ( y z )) ; ) 6 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.3: -------------------------------------------------------------------------------- 1 | 1 * 2 + 3 * 4; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.3.check: -------------------------------------------------------------------------------- 1 | 42 states 16 scans 13 shifts 26 reductions 0 compares 0 ambiguities 2 | ((( 1 * 2 ) + ( 3 * 4 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.3.out: -------------------------------------------------------------------------------- 1 | 42 states 16 scans 13 shifts 26 reductions 0 compares 0 ambiguities 2 | ((( 1 * 2 ) + ( 3 * 4 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.30: -------------------------------------------------------------------------------- 1 | 1 2 + 3 4 + 5 6 + 7 8 + 9 a + b; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.30.check: -------------------------------------------------------------------------------- 1 | ref Sym 'a' line 1: not found 2 | ref Sym 'b' line 1: not found 3 | 90 states 39 scans 27 shifts 60 reductions 0 compares 0 ambiguities 4 | (((((( 1 ( 2 + 3 ))( 4 + 5 ))( 6 + 7 ))( 8 + 9 ))( a + b )) ; ) 5 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.30.out: -------------------------------------------------------------------------------- 1 | ref Sym 'a' line 1: not found 2 | ref Sym 'b' line 1: not found 3 | 90 states 39 scans 27 shifts 60 reductions 0 compares 0 ambiguities 4 | (((((( 1 ( 2 + 3 ))( 4 + 5 ))( 6 + 7 ))( 8 + 9 ))( a + b )) ; ) 5 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.31: -------------------------------------------------------------------------------- 1 | 1 2 + 3 4 + 5 6 + 7; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.31.check: -------------------------------------------------------------------------------- 1 | 60 states 25 scans 17 shifts 40 reductions 0 compares 0 ambiguities 2 | (((( 1 ( 2 + 3 ))( 4 + 5 ))( 6 + 7 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.31.out: -------------------------------------------------------------------------------- 1 | 60 states 25 scans 17 shifts 40 reductions 0 compares 0 ambiguities 2 | (((( 1 ( 2 + 3 ))( 4 + 5 ))( 6 + 7 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.32: -------------------------------------------------------------------------------- 1 | 1 + 1.1 + 0.1 + -0.1 + -.1 + 1.0e10; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.32.check: -------------------------------------------------------------------------------- 1 | 62 states 24 scans 21 shifts 37 reductions 0 compares 0 ambiguities 2 | (((((( 1 + 1.1 ) + 0.1 ) + -0.1 ) + -.1 ) + 1.0e10 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.32.out: -------------------------------------------------------------------------------- 1 | 62 states 24 scans 21 shifts 37 reductions 0 compares 0 ambiguities 2 | (((((( 1 + 1.1 ) + 0.1 ) + -0.1 ) + -.1 ) + 1.0e10 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.33: -------------------------------------------------------------------------------- 1 | for (x = 1) h; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.33.check: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'h' line 1: not found 3 | 29 states 16 scans 8 shifts 14 reductions 0 compares 0 ambiguities 4 | (( for ( ( x = 1 ) ) h ) ; ) 5 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.33.out: -------------------------------------------------------------------------------- 1 | ref Sym 'x' line 1: not found 2 | ref Sym 'h' line 1: not found 3 | 29 states 16 scans 8 shifts 14 reductions 0 compares 0 ambiguities 4 | (( for ( ( x = 1 ) ) h ) ; ) 5 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.4: -------------------------------------------------------------------------------- 1 | 1 2 + 3 * 4 5; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.4.check: -------------------------------------------------------------------------------- 1 | 44 states 18 scans 12 shifts 30 reductions 0 compares 0 ambiguities 2 | ((( 1 ( 2 + ( 3 * 4 ))) 5 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.4.out: -------------------------------------------------------------------------------- 1 | 44 states 18 scans 12 shifts 30 reductions 0 compares 0 ambiguities 2 | ((( 1 ( 2 + ( 3 * 4 ))) 5 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.5: -------------------------------------------------------------------------------- 1 | 1 2 + 3; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.5.check: -------------------------------------------------------------------------------- 1 | 28 states 11 scans 7 shifts 18 reductions 0 compares 0 ambiguities 2 | (( 1 ( 2 + 3 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.5.out: -------------------------------------------------------------------------------- 1 | 28 states 11 scans 7 shifts 18 reductions 0 compares 0 ambiguities 2 | (( 1 ( 2 + 3 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.6: -------------------------------------------------------------------------------- 1 | 1 + 2; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.6.check: -------------------------------------------------------------------------------- 1 | 22 states 8 scans 5 shifts 13 reductions 0 compares 0 ambiguities 2 | (( 1 + 2 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.6.out: -------------------------------------------------------------------------------- 1 | 22 states 8 scans 5 shifts 13 reductions 0 compares 0 ambiguities 2 | (( 1 + 2 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.7: -------------------------------------------------------------------------------- 1 | 1 2 + 3; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.7.check: -------------------------------------------------------------------------------- 1 | 28 states 11 scans 7 shifts 18 reductions 0 compares 0 ambiguities 2 | (( 1 ( 2 + 3 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.7.out: -------------------------------------------------------------------------------- 1 | 28 states 11 scans 7 shifts 18 reductions 0 compares 0 ambiguities 2 | (( 1 ( 2 + 3 )) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.8: -------------------------------------------------------------------------------- 1 | 1 + 2 + 3 + 4 + 5 + 6 + 7; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.8.check: -------------------------------------------------------------------------------- 1 | 72 states 28 scans 25 shifts 43 reductions 0 compares 0 ambiguities 2 | ((((((( 1 + 2 ) + 3 ) + 4 ) + 5 ) + 6 ) + 7 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.8.out: -------------------------------------------------------------------------------- 1 | 72 states 28 scans 25 shifts 43 reductions 0 compares 0 ambiguities 2 | ((((((( 1 + 2 ) + 3 ) + 4 ) + 5 ) + 6 ) + 7 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.9: -------------------------------------------------------------------------------- 1 | 1 + 2 + 3 + 4 + 5 + 6; 2 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.9.check: -------------------------------------------------------------------------------- 1 | 62 states 24 scans 21 shifts 37 reductions 0 compares 0 ambiguities 2 | (((((( 1 + 2 ) + 3 ) + 4 ) + 5 ) + 6 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/sample.test.g.9.out: -------------------------------------------------------------------------------- 1 | 62 states 24 scans 21 shifts 37 reductions 0 compares 0 ambiguities 2 | (((((( 1 + 2 ) + 3 ) + 4 ) + 5 ) + 6 ) ; ) 3 | -------------------------------------------------------------------------------- /src/d/tests/utf8.test.g: -------------------------------------------------------------------------------- 1 | S: character+ ; 2 | 3 | character: 4 | 'φ' 5 | | U+03c9 6 | | u+61 7 | ; 8 | 9 | -------------------------------------------------------------------------------- /src/d/tests/utf8.test.g.1: -------------------------------------------------------------------------------- 1 | a φ ω 2 | -------------------------------------------------------------------------------- /src/d/tests/utf8.test.g.1.check: -------------------------------------------------------------------------------- 1 | 13 states 4 scans 3 shifts 9 reductions 0 compares 0 ambiguities 2 | ( a φ ω ) 3 | -------------------------------------------------------------------------------- /src/d/tests/utf8.test.g.1.out: -------------------------------------------------------------------------------- 1 | 13 states 4 scans 3 shifts 9 reductions 0 compares 0 ambiguities 2 | ( a φ ω ) 3 | -------------------------------------------------------------------------------- /src/d/verilog/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile 3 | # 4 | # $Revision: 1.1 $ 5 | # 6 | 7 | DPARSERDIR= .. 8 | GRAMMAR= verilog.g 9 | DPARSEFLAGS= -l -v 10 | 11 | TARGET= v 12 | CSRCS= main.c vparse.c ambig.c 13 | OBJS= $(CSRCS:.c=.o) $(GRAMMAR).d_parser.o 14 | INCDIRSS= -I$(DPARSERDIR) 15 | CFLAGS= -g $(INCDIRSS) 16 | 17 | ######### 18 | 19 | target: $(TARGET) 20 | 21 | ########## 22 | 23 | $(TARGET): $(OBJS) 24 | $(CC) $(CFLAGS) -o $@ $(OBJS) \ 25 | -L$(DPARSERDIR) -ldparse 26 | 27 | $(GRAMMAR).d_parser.c: $(GRAMMAR) 28 | $(DPARSERDIR)/make_dparser $(DPARSEFLAGS) $(GRAMMAR) 29 | 30 | lint: 31 | lint $(CFLAGS) $(CSRCS) 32 | 33 | test: $(TARGET) 34 | ./verilog_tests 35 | grep succeeded log.txt | wc -l 36 | grep failed log.txt | wc -l 37 | 38 | clean: 39 | rm -f $(GRAMMAR).d_parser.c $(TARGET) $(OBJS) log.txt 40 | -------------------------------------------------------------------------------- /src/d/verilog/README: -------------------------------------------------------------------------------- 1 | 2 | This Verilog grammar was contributed by Thomas Skibo (thanx!). 3 | 4 | To make, type 'make'. 5 | 6 | To test, get the test suite from ftp://icarus.com/pub/eda/verilog/tests 7 | 8 | and untar into this directory, then type 'make test'. 9 | 10 | The result should be: 11 | 12 | ./verilog_tests 13 | grep succeeded log.txt | wc -l 14 | 383 15 | grep failed log.txt | wc -l 16 | 8 17 | 18 | The failures represent unsupported features: 19 | 20 | testsuite/ivltests/always3.1.1K.v failed 21 | testsuite/ivltests/function3.11E.v failed 22 | testsuite/ivltests/signed1.v failed 23 | testsuite/ivltests/signed2.v failed 24 | testsuite/ivltests/signed3.v failed 25 | testsuite/ivltests/signed4.v failed 26 | testsuite/ivltests/wildsense.v failed 27 | testsuite/ivltests/specify_01.v failed 28 | 29 | see log.txt for details. 30 | -------------------------------------------------------------------------------- /src/d/verilog/ambig.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * ambig.c 4 | * 5 | * $Revision: 1.1 $ 6 | */ 7 | 8 | #include "d.h" 9 | #undef DPN_TO_PN 10 | #define DPN_TO_PN(_dpn) \ 11 | ((PNode *)(((char*)(_dpn))-(int)(&((PNode*)0)->parse_node))) 12 | 13 | extern void print_paren(PNode *); 14 | 15 | struct D_ParseNode * 16 | my_ambiguity_fn(struct D_Parser *pp, int n, struct D_ParseNode **v ) 17 | { 18 | int i; 19 | char *s; 20 | printf( "my_ambiguity_fn: %d possibilities:\n", n ); 21 | 22 | s = v[0]->start_loc.s; 23 | while (s != v[0]->end) 24 | putchar( s[0] ), s++; 25 | 26 | for (i=0; i! log.txt 5 | 6 | foreach file ( `find testsuite -name '*.v' -print` ) 7 | echo =================== $file ================ >> log.txt 8 | ./v $file >>& log.txt 9 | end 10 | 11 | -------------------------------------------------------------------------------- /src/d/verilog/vparse.h: -------------------------------------------------------------------------------- 1 | /* vparse.h 2 | * 3 | * Utilities used during parsing Verilog files. 4 | * 5 | */ 6 | 7 | extern int v_iskeyword( const char *, const char * ); 8 | extern void v_parse_init( void ); 9 | extern int v_getfile( const char *, char **, int * ); 10 | 11 | extern char *v_incdirs; 12 | -------------------------------------------------------------------------------- /src/d/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2002-2004 John Plevyak, All Rights Reserved 3 | */ 4 | #include "d.h" 5 | 6 | void 7 | d_version(char *v) { 8 | v += sprintf(v, "%d.%d", D_MAJOR_VERSION, D_MINOR_VERSION); 9 | if (strcmp("",D_BUILD_VERSION)) 10 | v += sprintf(v, ".%s", D_BUILD_VERSION); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/d/write_tables.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2002-2004 John Plevyak, All Rights Reserved 3 | */ 4 | 5 | int write_c_tables(Grammar *g); 6 | int write_binary_tables(Grammar *g); 7 | int write_binary_tables_to_file(Grammar *g, FILE *fp); 8 | int write_binary_tables_to_string(Grammar *g, 9 | unsigned char **str, unsigned int *str_len); 10 | -------------------------------------------------------------------------------- /src/factory.cc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/null.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * fMBT, free Model Based Testing tool 3 | * Copyright (c) 2011, Intel Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms and conditions of the GNU Lesser General Public License, 7 | * version 2.1, as published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | * more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 | * 18 | */ 19 | 20 | #include "null.hh" 21 | 22 | FACTORY_DEFAULT_CREATOR(Model, Null, "null") 23 | -------------------------------------------------------------------------------- /test/aalpython/adapter_exceptions.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote(remote_pyaal -l adapter_exceptions.aal.log adapter_exceptions.aal)" 2 | adapter = aal 3 | heuristic = "lookahead(3)" 4 | coverage = "perm(2)" 5 | pass = "steps(20)" 6 | on_pass = "exit(0)" 7 | on_fail = "exit(1)" 8 | on_inconc = "exit(2)" -------------------------------------------------------------------------------- /test/aalpython/changing_model_in_adapter.aal: -------------------------------------------------------------------------------- 1 | aal "enabled_actions" { 2 | language: python {} 3 | 4 | # preview-hide-vars: 5 | # preview-depth: 5 6 | variables { 7 | x 8 | } 9 | initial_state { 10 | x = 0 11 | } 12 | action "iIncSix" { 13 | guard() { return x < 3 } 14 | body() { x += 1 } 15 | adapter() { 16 | x += 5 17 | } 18 | } 19 | action "iDecOne" { 20 | guard() { return x == 6 } 21 | adapter() { 22 | x -= 1 23 | return action("iFive") 24 | } 25 | } 26 | action "iFive" { 27 | guard() { return x == 5 } 28 | adapter() { 29 | x = 4 30 | return action("iIncSix") 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/aalpython/changing_model_in_adapter.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote(remote_pyaal -l enabled_actions.aal.log 'changing_model_in_adapter.aal')" 2 | adapter = "aal" 3 | heuristic = "lookahead(4)" 4 | coverage = "perm(2)" 5 | pass = "steps(20)" 6 | on_pass = "exit(0)" 7 | on_fail = "exit(1)" 8 | on_inconc = "exit(2)" -------------------------------------------------------------------------------- /test/aalpython/changing_model_in_adapter.expected: -------------------------------------------------------------------------------- 1 | iIncSix -> iIncSix 2 | 3 | iDecOne -> iFive 4 | 5 | iFive -> iIncSix 6 | fail unexpected response to input "iFive": "iIncSix". 7 | -------------------------------------------------------------------------------- /test/aalpython/controlflow.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l controlflow.aal.log -DOUTPUTS 'controlflow.aal') 2 | adapter = aal 3 | heuristic = lookahead(6) 4 | coverage = perm(1) 5 | fail = steps(9) 6 | on_pass = exit(0) 7 | on_fail = exit(1) 8 | on_inconc = exit(2) -------------------------------------------------------------------------------- /test/aalpython/fmbt_call_test.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l fmbt_call_test.aal.log 'fmbt_call_test.aal') 2 | adapter = aal 3 | heuristic = lookahead(4) 4 | coverage = perm(1) 5 | inconc = steps(3) 6 | on_pass = exit(0) 7 | on_fail = exit(1) 8 | on_inconc = exit(2) -------------------------------------------------------------------------------- /test/aalpython/mycounter.py: -------------------------------------------------------------------------------- 1 | log_filename="/tmp/fmbt.test.aal-python.mycounter.log" 2 | file(log_filename, "w").close() 3 | def log(msg): 4 | file(log_filename, "a").write(msg + "\n") 5 | 6 | def foo(): 7 | pass 8 | 9 | def direction_changed(i): 10 | log('change direction on value %s' % (i,)) 11 | log(' dec called: %s' % (dec_called,)) 12 | 13 | -------------------------------------------------------------------------------- /test/aalpython/nested.aal: -------------------------------------------------------------------------------- 1 | aal "nested_blocks" { 2 | language: python { import time 3 | } 4 | variables { x } 5 | 6 | initial_state { x = [] } 7 | 8 | tag "x is not empty" { 9 | guard() { return len(x) > 0 } 10 | 11 | tag "the first element of x is non-zero" { 12 | guard() { return x[0] != 0 } 13 | 14 | action "iMakeFirstElementZero" { 15 | body() { x[0] = 0 } 16 | } 17 | 18 | } 19 | 20 | tag "the first element of x is zero" { 21 | guard() { return x[0] == 0 } 22 | 23 | action "iClearX" { 24 | body() { x = [] } 25 | } 26 | } 27 | 28 | } 29 | 30 | action "iAddNonzeroElement" { 31 | guard() { return len(x) < 1 } 32 | body() { x.append(42) } 33 | 34 | action "iAddZeroElement" { 35 | body() { x.append(0) } 36 | } 37 | 38 | tag "can add elements" {} 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/aalpython/nested.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l nested.aal.log 'nested.aal') 2 | adapter = aal 3 | heuristic = lookahead(4) 4 | coverage = uinputs(from "x is not empty" to "x is not empty") 5 | pass = coverage(3) 6 | fail = steps(20) 7 | on_pass = exit(0) 8 | on_fail = exit(1) 9 | on_inconc = exit(2) -------------------------------------------------------------------------------- /test/aalpython/serpa.aal: -------------------------------------------------------------------------------- 1 | aal "noname" { 2 | language "python" {} 3 | # preview-depth: 7 4 | initial_state {} 5 | serial { 6 | input "start" {} 7 | parallel { 8 | serial { 9 | input "a0" {} 10 | input "a1" {} 11 | } 12 | serial { 13 | input "b0" {} 14 | } 15 | } 16 | serial { 17 | input "c" {} 18 | } 19 | parallel { 20 | input "d0" {} 21 | input "d1" {} 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/aalpython/serpa.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l serpa.aal.log 'serpa.aal') 2 | adapter = aal 3 | heuristic = lookahead(7) 4 | coverage = uinputs(from "i:start" to "i:start") 5 | pass = steps(80) 6 | pass = coverage(80) 7 | inconc = noprogress(10) 8 | on_pass = exit(2) 9 | on_fail = exit(1) 10 | on_inconc = exit(0) -------------------------------------------------------------------------------- /test/aalpython/tags-allfail.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote(remote_pyaal -l tags.aal.log -c 'allTagsFail=1' 'tags.aal')" 2 | adapter = "aal" 3 | heuristic = "lookahead(4)" 4 | coverage = "perm(2)" 5 | 6 | pass = "no_progress(4)" 7 | 8 | on_pass = "exit(0)" 9 | on_fail = "exit(1)" 10 | on_inconc = "exit(2)" 11 | -------------------------------------------------------------------------------- /test/aalpython/tags-fail.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote(remote_pyaal -l tags.aal.log -c 'mkSubDirFails=True' 'tags.aal')" 2 | adapter = "aal" 3 | heuristic = "lookahead(4)" 4 | coverage = "perm(2)" 5 | 6 | pass = "no_progress(4)" 7 | 8 | on_pass = "exit(0)" 9 | on_fail = "exit(1)" 10 | on_inconc = "exit(2)" -------------------------------------------------------------------------------- /test/aalpython/tags.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote(remote_pyaal -l tags.aal.log 'tags.aal')" 2 | adapter = "aal" 3 | heuristic = "lookahead(4)" 4 | coverage = "perm(2)" 5 | 6 | pass = "no_progress(4)" 7 | 8 | on_pass = "exit(0)" 9 | on_fail = "exit(1)" 10 | on_inconc = "exit(2)" -------------------------------------------------------------------------------- /test/adapters/dlopen/Makefile: -------------------------------------------------------------------------------- 1 | myadapters.so: mylocaladapter.cc mylocaladapter.hh 2 | g++ -shared -fPIC -I../../../src mylocaladapter.cc -o myadapters.so 3 | -------------------------------------------------------------------------------- /test/adapters/dlopen/abc.lsts: -------------------------------------------------------------------------------- 1 | Begin Lsts 2 | 3 | Begin History 4 | End History 5 | 6 | Begin Header 7 | State_cnt = 3 8 | Action_cnt = 3 9 | Transition_cnt = 3 10 | Initial_states = 1; 11 | End Header 12 | 13 | Begin Action_names 14 | 1 = "ia" 15 | 2 = "ib" 16 | 3 = "ic" 17 | End Action_names 18 | 19 | Begin Transitions 20 | 1: 2,1; 21 | 2: 3,2; 22 | 3: 1,3; 23 | End Transitions 24 | 25 | End Lsts 26 | -------------------------------------------------------------------------------- /test/adapters/dlopen/dlopen.conf: -------------------------------------------------------------------------------- 1 | # quick test howto: 2 | # src$ g++ -fPIC -shared -o dlopen_dummy.so adapter_dummy.cc adapter.cc 3 | # src$ LD_LIBRARY_PATH=$(pwd) 4 | 5 | model = "abc.lsts" 6 | heuristic = "greedy" 7 | adapter = "dlopen(myadapters.so,mylocal)" 8 | coverage = "perm(1)" 9 | 10 | pass = "coverage:1.0" 11 | -------------------------------------------------------------------------------- /test/adapters/dlopen/mylocaladapter.cc: -------------------------------------------------------------------------------- 1 | #include "mylocaladapter.hh" 2 | #include "log.hh" 3 | 4 | MyLocalAdapter::MyLocalAdapter(Log& l, std::string params): 5 | Adapter(l) 6 | { 7 | log.print("\n", params.c_str()); 8 | } 9 | 10 | MyLocalAdapter::~MyLocalAdapter() 11 | { 12 | } 13 | 14 | void MyLocalAdapter::execute(std::vector& action) 15 | { 16 | log.push("mylocal_execute"); 17 | log.print("\n", 18 | action[0], getUActionName(action[0])); 19 | log.pop(); 20 | } 21 | 22 | int MyLocalAdapter::observe(std::vector &action, bool block) 23 | { 24 | log.push("mylocal_reader"); 25 | if (block) { 26 | action.resize(1); 27 | action[0] = 1; 28 | log.pop(); 29 | return 1; 30 | } 31 | log.pop(); 32 | return 0; 33 | } 34 | 35 | FACTORY_DEFAULT_CREATOR(Adapter, MyLocalAdapter, "mylocal"); 36 | -------------------------------------------------------------------------------- /test/adapters/dlopen/mylocaladapter.hh: -------------------------------------------------------------------------------- 1 | #include "adapter.hh" 2 | 3 | class MyLocalAdapter: public Adapter { 4 | public: 5 | MyLocalAdapter(Log& l, std::string params = ""); 6 | virtual ~MyLocalAdapter(); 7 | virtual void execute(std::vector& action); 8 | virtual int observe(std::vector &action, bool block=false); 9 | }; 10 | -------------------------------------------------------------------------------- /test/adapters/timer/timer.conf: -------------------------------------------------------------------------------- 1 | model = "lts_remote(fmbt-gt -f timer.gt)" 2 | heuristic = "lookahead(5b)" 3 | adapter = "mapper(timer.mrules)" 4 | coverage = "perm(2)" 5 | 6 | pass = "coverage:1.0" 7 | pass = "steps:50" 8 | 9 | on_fail = "exit" 10 | -------------------------------------------------------------------------------- /test/adapters/timer/timer.gt: -------------------------------------------------------------------------------- 1 | P(init, "gt:istate") -> 2 | 3 | P(init, "gt:istate") 4 | T(init, "iSetTimer 1 0.25", timer1) 5 | T(init, "iSetTimer 1 1.0", timer1) 6 | 7 | P(timer1, "timer one ticking") 8 | T(timer1, "iClearTimer 1", init) 9 | T(timer1, "oTimeout 1", init) 10 | T(timer1, "iforce", timeout1) 11 | T(timer1, "iSetTimer 2 0.5", timers12) 12 | 13 | P(timers12, "timers one and two ticking") 14 | T(timers12, "iSleep 0.5", timers12) 15 | T(timers12, "iSleep 1", timeout12) 16 | T(timers12, "oTimeout 1", timeout2) 17 | T(timers12, "iClearTimer 1", timeout2) 18 | T(timers12, "oTimeout 2", timer1) 19 | T(timers12, "iClearTimer 2", timer1) 20 | 21 | P(timeout12, "timeout either one") 22 | T(timeout12, "oTimeout 2", timer1) 23 | T(timeout12, "oTimeout 1", timeout2) 24 | 25 | P(timeout1, "timeout only timer one") 26 | T(timeout1, "oTimeout 1", init) 27 | 28 | P(timeout2, "timeout only timer two") 29 | T(timeout2, "oTimeout 2", init) 30 | -------------------------------------------------------------------------------- /test/adapters/timer/timer.mrules: -------------------------------------------------------------------------------- 1 | 2 | 1="timer" 3 | 2="dummy" 4 | 5 | "iforce" -> (2, "iforce") 6 | "(iSleep.*)" -> (1, "$1") 7 | "(.*)" -> (1, "$1") (2, "$1") 8 | -------------------------------------------------------------------------------- /test/coverage/abc.gt: -------------------------------------------------------------------------------- 1 | P(start, "gt:istate") 2 | -> 3 | T(start, "iA", start) 4 | T(start, "iB", start) 5 | T(start, "iC", start) 6 | -------------------------------------------------------------------------------- /test/coverage/abc_reg.gt: -------------------------------------------------------------------------------- 1 | P(start, "gt:istate") 2 | -> 3 | T(start, "iA", start) 4 | T(start, "iA1", start) 5 | T(start, "iA2", start) 6 | T(start, "iA3", start) 7 | T(start, "iB", start) 8 | T(start, "iC", start) 9 | -------------------------------------------------------------------------------- /test/coverage/coffee.gt: -------------------------------------------------------------------------------- 1 | P(start, "gt:istate") 2 | -> 3 | T(start, "iOrderCoffee", pay) 4 | 5 | T(pay, "iCancelOrder", start) 6 | T(pay, "iChooseCash", coins) 7 | T(pay, "iChooseCredit", card) 8 | 9 | T(coins, "iCancelPayment", pay) 10 | T(coins, "iInsertCoins", coming) 11 | 12 | T(card, "iInsertCard", card-in) 13 | T(card, "iCancelPayment", pay) 14 | T(card-in, "iTakeCard", coming) 15 | 16 | T(coming, "iCollectItem", start) 17 | -------------------------------------------------------------------------------- /test/coverage/t1.gt: -------------------------------------------------------------------------------- 1 | P(s,p)->T(s,"iFoo",s2) 2 | -------------------------------------------------------------------------------- /test/coverage/t2.gt: -------------------------------------------------------------------------------- 1 | P(s,p)-> 2 | P(s, "tag1") 3 | 4 | T(s,"iCoverSecond",s2) 5 | P(s2, "tag2") 6 | 7 | T(s2, "iCoverComb", ss) 8 | P(ss, "tag1") 9 | P(ss, "tag2") -------------------------------------------------------------------------------- /test/coverage/t3.gt: -------------------------------------------------------------------------------- 1 | P(s,p)-> 2 | P(s, "tag1") 3 | P(s, "T1") 4 | 5 | T(s,"iCoverSecond",s2) 6 | P(s2, "tag2") 7 | 8 | T(s2, "iCoverComb", ss) 9 | P(ss, "tag1") 10 | P(ss, "tag2") 11 | P(ss, "Taginput") 12 | -------------------------------------------------------------------------------- /test/coverage/usecase-tags-1.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l usecase-tags.aal.log 'usecase-tags.aal') 2 | adapter = aal 3 | heuristic = lookahead(6) 4 | # looks good already 5 | # coverage = usecase(["hear music"](".*")["hear alert" and not "hear music"]) 6 | 7 | # looks good: 8 | # coverage = usecase((".*")["hear game" and "hear music"]) 9 | 10 | # not good, "i:play alert" should not suffice covering this: 11 | #coverage = usecase((".*")["hear game" & "hear music"]) 12 | 13 | # looks good: 14 | #coverage = usecase(["hear alert"](any "i:stop.*")) 15 | 16 | # good, "hear alert" should be on before every i:stop.*: 17 | coverage = usecase(@["hear alert"](all "i:stop.*")) 18 | # Note that this is totally different than 19 | # coverage = usecase(["hear alert"](all "i:stop.*")) 20 | 21 | pass = steps(20) 22 | on_pass = exit(0) 23 | on_fail = exit(1) 24 | on_inconc = exit(2) -------------------------------------------------------------------------------- /test/coverage_shared/shared.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l controlflow.aal.log '../aalpython/controlflow.aal') 2 | adapter = aal 3 | heuristic = lookahead(6) 4 | coverage = shared(fmbt-trace-share -L /tmp/fmbt.coverage_shared.trace.log,uwalks(from 'i:0 to 1' to 'i:0 to 2')) 5 | pass = coverage(2) 6 | fail = steps(10) 7 | on_pass = exit(0) 8 | on_fail = exit(1) 9 | on_inconc = exit(2) 10 | -------------------------------------------------------------------------------- /test/coverage_shared/two.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l two.aal.log two.aal) 2 | adapter = aal 3 | heuristic = lookahead(3) 4 | coverage = perm(1) -------------------------------------------------------------------------------- /test/editor/monkey.aal: -------------------------------------------------------------------------------- 1 | aal "monkeyexample" { 2 | language: python { 3 | from eyenfinger import * 4 | import random 5 | from fmbt import fmbtlog 6 | } 7 | 8 | # preview-hide-vars: 9 | # preview-depth: 5 10 | variables { 11 | words 12 | } 13 | 14 | initial_state { 15 | words = iRead("fMBT editor") 16 | } 17 | 18 | action "iClickAnyWord" { 19 | guard() { 20 | return words != [] 21 | } 22 | adapter() { 23 | word = random.choice(words) 24 | fmbtlog("Clicking '%s'" % (word,)) 25 | iClickWord(word) 26 | words = iRead("fMBT editor") 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/editor/monkey.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote:remote_pyaal -l monkey.aal.log 'monkey.aal'" 2 | adapter = "aal_remote:remote_pyaal -l monkey.aal.log 'monkey.aal'" 3 | heuristic = "random" 4 | coverage = "perm:2" 5 | pass = "steps:50" 6 | pass = "coverage:2" 7 | on_pass = "exit:0" 8 | on_fail = "exit:1" 9 | on_inconc = "exit:2" 10 | -------------------------------------------------------------------------------- /test/editor/test.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote(remote_pyaal -l aal.log 'editor.aal')" 2 | adapter = "aal_remote(remote_pyaal -l aal.log 'editor.aal')" 3 | heuristic = "lookahead(3)" 4 | coverage = "perm(2)" 5 | pass = "steps:20" 6 | on_pass = "exit:0" 7 | on_fail = "exit:1" 8 | on_inconc = "exit:2" -------------------------------------------------------------------------------- /test/exitvalue/broken-adapter.aal: -------------------------------------------------------------------------------- 1 | aal "broken" { 2 | language: python { 3 | } 4 | 5 | # preview-hide-vars: 6 | # preview-depth: 5 7 | variables { 8 | varname1, varname2 9 | } 10 | initial_state { 11 | varname1 = 42 # comment1 12 | varname2 = 'hello' # comment2 13 | } 14 | action "iTestStep1()" { 15 | guard() { 16 | return varname1 == 42 17 | } 18 | body() { 19 | varname2 = 'bye' 20 | } 21 | adapter() { 22 | assert False, "this-is-an-error" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/exitvalue/broken-body.aal: -------------------------------------------------------------------------------- 1 | aal "broken" { 2 | language: python { 3 | } 4 | 5 | # preview-hide-vars: 6 | # preview-depth: 5 7 | variables { 8 | varname1, varname2 9 | } 10 | initial_state { 11 | varname1 = 42 # comment1 12 | varname2 = 'hello' # comment2 13 | } 14 | action "iTestStep1()" { 15 | guard() { 16 | return varname1 == 42 17 | } 18 | body() { 19 | assert False, "this-is-an-error" 20 | varname2 = 'bye' 21 | } 22 | adapter() { 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/exitvalue/broken-guard.aal: -------------------------------------------------------------------------------- 1 | aal "broken" { 2 | language: python { 3 | } 4 | 5 | # preview-hide-vars: 6 | # preview-depth: 5 7 | variables { 8 | varname1, varname2 9 | } 10 | initial_state { 11 | varname1 = 42 # comment1 12 | varname2 = 'hello' # comment2 13 | } 14 | action "iTestStep1()" { 15 | guard() { 16 | assert False, "this-is-an-error" 17 | return varname1 == 42 18 | } 19 | body() { 20 | varname2 = 'bye' 21 | } 22 | adapter() { 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/exitvalue/broken-initial_state.aal: -------------------------------------------------------------------------------- 1 | aal "broken" { 2 | language: python { 3 | } 4 | 5 | # preview-hide-vars: 6 | # preview-depth: 5 7 | variables { 8 | varname1, varname2 9 | } 10 | initial_state { 11 | assert False, "this-is-an-error" 12 | varname1 = 42 # comment1 13 | varname2 = 'hello' # comment2 14 | } 15 | action "iTestStep1()" { 16 | guard() { 17 | return varname1 == 42 18 | } 19 | body() { 20 | varname2 = 'bye' 21 | } 22 | adapter() { 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/exitvalue/broken-language.aal: -------------------------------------------------------------------------------- 1 | aal "broken" { 2 | language: python { 3 | assert False, "this-is-an-error" 4 | } 5 | 6 | # preview-hide-vars: 7 | # preview-depth: 5 8 | variables { 9 | varname1, varname2 10 | } 11 | initial_state { 12 | varname1 = 42 # comment1 13 | varname2 = 'hello' # comment2 14 | } 15 | action "iTestStep1()" { 16 | guard() { 17 | return varname1 == 42 18 | } 19 | body() { 20 | varname2 = 'bye' 21 | } 22 | adapter() { 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/exitvalue/broken-requiredvalue.gt: -------------------------------------------------------------------------------- 1 | P(start, "gt:istate") 2 | -> 3 | T(start, "iCatch('1/0') == Error('.*neveroccuring1.*')", start) 4 | T(start, "iCatch('1/0') == Error('.*neveroccuring2.*')", start) 5 | -------------------------------------------------------------------------------- /test/eyenfinger/screenshot2-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/fMBT/37706c8302abfb4e679082678d0b17d3fc897a3c/test/eyenfinger/screenshot2-icon.png -------------------------------------------------------------------------------- /test/eyenfinger/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/fMBT/37706c8302abfb4e679082678d0b17d3fc897a3c/test/eyenfinger/screenshot2.png -------------------------------------------------------------------------------- /test/eyenfinger/test.aal.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote(remote_pyaal -l aal.log test.py.aal)" 2 | adapter = "aal_remote(remote_pyaal -l aal.log test.py.aal)" 3 | heuristic = "lookahead(3)" 4 | coverage = "perm(2)" 5 | 6 | pass = "steps(15)" 7 | pass = "no_progress(3)" 8 | 9 | on_pass = "exit(0)" 10 | on_fail = "exit(1)" 11 | on_inconc = "exit(2)" 12 | -------------------------------------------------------------------------------- /test/fmbt-stats/seeded-errors.conf: -------------------------------------------------------------------------------- 1 | model = "lsts:model.lsts" 2 | adapter = "remote:remote_python -l adapter.log -c 'from teststeps import *' -c 'iSeedErrors(log=1,output=1,randomSeed=12)'" 3 | heuristic = "lookahead:4" 4 | coverage = "perm:2" 5 | inconc = "coverage:1.1" 6 | pass = "no_progress:6" 7 | on_fail = "exit:1" 8 | -------------------------------------------------------------------------------- /test/heuristic_exclude/t1.gt: -------------------------------------------------------------------------------- 1 | P(s,p)->T(s,"iFoo",s2) 2 | T(s,"iFilter",s2) 3 | T(s,"iBar",s2) 4 | T(s,"iHee",s2) 5 | T(s2,"iFoo",s) 6 | -------------------------------------------------------------------------------- /test/heuristic_mrandom/t1.conf: -------------------------------------------------------------------------------- 1 | model = lsts_remote(fmbt-gt -f 't1.gt') 2 | heuristic = mrandom(1,lookahead(2),1,lookahead(2)) 3 | coverage = usecase("iFoo" then ("iBar" and not "iFoo")) 4 | fail = steps(3) 5 | on_pass = exit(0) 6 | on_fail = exit(1) 7 | on_inconc = exit(2) -------------------------------------------------------------------------------- /test/heuristic_mrandom/t1.gt: -------------------------------------------------------------------------------- 1 | P(s,p)->T(s,"iFoo",s2) 2 | T(s2,"iBar",s) 3 | -------------------------------------------------------------------------------- /test/history/abc.gt: -------------------------------------------------------------------------------- 1 | P(start, "gt:istate") 2 | -> 3 | T(start, "iA", start) 4 | T(start, "iB", start) 5 | T(start, "iC", start) 6 | -------------------------------------------------------------------------------- /test/history/history_test.aal: -------------------------------------------------------------------------------- 1 | aal "history_test" { 2 | language: python {} 3 | variables { 4 | body_run 5 | } 6 | initial_state { 7 | body_run = False 8 | } 9 | 10 | input "action" { 11 | guard() { 12 | return not body_run 13 | } 14 | body() { 15 | body_run = True 16 | } 17 | } 18 | input "body_run" { 19 | guard() { 20 | return body_run 21 | } 22 | body() { 23 | body_run = False 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /test/history/history_test.conf: -------------------------------------------------------------------------------- 1 | model = aal_remote(remote_pyaal -l history_test.aal.log 'history_test.aal') 2 | adapter = aal 3 | heuristic = lookahead(4) 4 | coverage = perm(1) 5 | fail = steps(3) 6 | on_pass = exit(0) 7 | on_fail = exit(1) 8 | on_inconc = exit(2) -------------------------------------------------------------------------------- /test/history/one-step-tests.conf: -------------------------------------------------------------------------------- 1 | model = "lsts_remote(fmbt-gt -f 'abc.gt')" 2 | heuristic = "lookahead(1)" 3 | coverage = "perm(1)" 4 | 5 | pass = "coverage:1" 6 | inconc = "steps:1" 7 | 8 | on_pass = "exit:0" 9 | on_fail = "exit:1" 10 | on_inconc = "exit:2" 11 | -------------------------------------------------------------------------------- /test/interactivemode/breakpoints.conf: -------------------------------------------------------------------------------- 1 | model = "aal_remote(remote_pyaal -l breakpoints.aal.log 'breakpoints.aal')" 2 | adapter = "aal" 3 | heuristic = "lookahead(2)" 4 | coverage = "perm(2)" 5 | pass = "no_progress(3)" 6 | on_pass = "exit(0)" 7 | on_fail = "exit(1)" 8 | on_inconc = "exit(2)" -------------------------------------------------------------------------------- /test/interactivemode/dummys.mrules: -------------------------------------------------------------------------------- 1 | 1="dummy" 2 | 2="dummy" 3 | 3="mapper(singledummy.mrules)" 4 | 5 | "(.*)Dummy" -> (3, "($1)Road") 6 | -------------------------------------------------------------------------------- /test/interactivemode/fmbt-i.mrules: -------------------------------------------------------------------------------- 1 | 1="remote(remote_python -Ltestlog-adapter.txt)" 2 | 2="mapper(dummys.mrules)" 3 | 4 | "init" -> (1, "iCatch('import fmbt_i') == None") 5 | 6 | "iNop:(.*)" -> (1, "None # No operation: $1") 7 | 8 | "(.*)Dummy" -> (2, "($1)Dummy") 9 | 10 | "(.*) == (.*)" -> (1, "fmbt_i.($1)\(\) == ($2)") 11 | 12 | "(.*)" -> (1, "fmbt_i.($1)\(\) == True") 13 | -------------------------------------------------------------------------------- /test/interactivemode/simple.conf: -------------------------------------------------------------------------------- 1 | model = "lsts_remote(fmbt-gt -f simple.gt)" 2 | heuristic = "lookahead(4)" 3 | coverage = "perm(2)" 4 | # never pass the test 5 | pass = "coverage(2.0)" 6 | on_pass = "exit(0)" 7 | on_fail = "exit(1)" 8 | on_inconc = "exit(2)" -------------------------------------------------------------------------------- /test/interactivemode/simple.gt: -------------------------------------------------------------------------------- 1 | P(start, "gt:istate") 2 | -> 3 | T(start, "iInsertCoin", paid) 4 | T(start, "iChooseCoffeeWithoutPaying", start) 5 | 6 | P(paid, "MoneyIn") 7 | T(paid, "iCancelPayment", start) 8 | T(paid, "iChooseCoffee", cooking) 9 | 10 | P(cooking, "MakingCoffee") 11 | T(cooking, "iCoffeeReady", start) 12 | -------------------------------------------------------------------------------- /test/interactivemode/singledummy.mrules: -------------------------------------------------------------------------------- 1 | 1="dummy" 2 | "(.*)"->(1,"$1") 3 | -------------------------------------------------------------------------------- /test/interactivemode/test.conf: -------------------------------------------------------------------------------- 1 | model = "lsts(testmodel.lsts)" 2 | heuristic = "greedy(5)" 3 | coverage = "perm(1)" 4 | adapter = "mapper(fmbt-i.mrules)" 5 | 6 | pass = "coverage(1.0)" 7 | inconc = "steps(200)" 8 | on_error = "exit(1)" 9 | on_fail = "exit(1)" 10 | on_inconc = "exit(1)" -------------------------------------------------------------------------------- /test/learn/times.aal: -------------------------------------------------------------------------------- 1 | variables { 2 | x 3 | } 4 | initial_state { 5 | x = 5 6 | } 7 | adapter_init { 8 | global time 9 | import time 10 | } 11 | input "inc" { 12 | guard { return x < 10 } 13 | body { x+= 1 } 14 | } 15 | input "dec" { 16 | guard { return x > 1 } 17 | body { x-= 1 } 18 | } 19 | input "fast1" { 20 | adapter {} 21 | } 22 | input "fast2" { 23 | adapter {} 24 | } 25 | input "aslow1" { 26 | adapter { time.sleep(0.2) } 27 | } 28 | input "bslow2" { 29 | adapter { time.sleep(0.2) } 30 | } 31 | input "xslow3" { 32 | adapter { time.sleep(0.2) } 33 | } 34 | input "yslow4" { 35 | adapter { time.sleep(0.2) } 36 | } 37 | input "fast3" { 38 | adapter {} 39 | } 40 | input "fast4" { 41 | adapter {} 42 | } 43 | -------------------------------------------------------------------------------- /test/log2lsts/t1.gt: -------------------------------------------------------------------------------- 1 | P(s,p) -> 2 | T(s,"iFoo",s2) 3 | T(s2,"iBar",s3) 4 | 5 | P(s2,"tag") 6 | -------------------------------------------------------------------------------- /test/mlang/brainfuck.conf: -------------------------------------------------------------------------------- 1 | model = "program.lsts" 2 | heuristic = "random" 3 | coverage = "perm(1)" 4 | adapter = "lib(brainfuck_memory)" 5 | //adapter = "mapper(brainfuck.mrules)" 6 | 7 | pass = "coverage:2" 8 | pass = "statetag:END_TEST" 9 | pass = "duration:next monday 07 am" 10 | -------------------------------------------------------------------------------- /test/mlang/helloworld.bf: -------------------------------------------------------------------------------- 1 | ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>. 2 | -------------------------------------------------------------------------------- /test/mlang/test.lang: -------------------------------------------------------------------------------- 1 | model myModel { 2 | language: C++; 3 | // default action type: input; 4 | 5 | variables { 6 | int x; 7 | std::string foo; 8 | } 9 | 10 | initial_state { 11 | x = 0; 12 | foo = "x"; 13 | } 14 | 15 | action { 16 | name: "myFuncCall"; 17 | guard() { 18 | if (x==1||foo=="bar") return false; 19 | return true; 20 | } 21 | body() { 22 | x+=1; 23 | } 24 | adapter() { 25 | int retval=myFuncCall(x); 26 | assert(retval==0); 27 | return retval; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /test/mlang/test_py.lang: -------------------------------------------------------------------------------- 1 | model myModel { 2 | language: py; 3 | // default action type: input; 4 | 5 | action { 6 | name: "myFuncCall"; 7 | guard() { 8 | return true 9 | } 10 | body() { 11 | pass 12 | } 13 | adapter() { 14 | return 1 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/multiaal/mycounter.cc: -------------------------------------------------------------------------------- 1 | #include "mycounter.h" 2 | 3 | MyCounter::MyCounter() 4 | { 5 | #ifndef FAULTY 6 | value = 0; 7 | #endif 8 | } 9 | 10 | void MyCounter::inc() { 11 | value += 1; 12 | } 13 | 14 | void MyCounter::reset() { 15 | value = 0; 16 | } 17 | 18 | int MyCounter::count() { 19 | return value; 20 | } 21 | -------------------------------------------------------------------------------- /test/multiaal/mycounter.h: -------------------------------------------------------------------------------- 1 | #ifndef __mycounter_h__ 2 | #define __mycounter_h__ 3 | 4 | class MyCounter { 5 | public: 6 | MyCounter(); 7 | void inc(); 8 | void reset(); 9 | int count(); 10 | private: 11 | int value; 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /test/multiaal/mycountertest1.cc.aal: -------------------------------------------------------------------------------- 1 | aal "mycountertest1" { 2 | language: C++ { 3 | }; 4 | 5 | variables { 6 | } 7 | 8 | initial_state { 9 | } 10 | 11 | action "iCreate" { 12 | guard() { return true; } 13 | } 14 | 15 | action "iDestroy" { 16 | guard() { return true;} 17 | } 18 | 19 | action "iIncrement" { 20 | guard() { return true; } 21 | } 22 | 23 | action "iReset" { 24 | guard() { return true; } 25 | } 26 | 27 | action "iCount" { 28 | guard() { return true; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /test/multiaal/test.conf: -------------------------------------------------------------------------------- 1 | model = "testmodel.xrules" 2 | adapter = "lib(mycountertest2)" 3 | heuristic = "lookahead" 4 | coverage = "perm(2)" 5 | 6 | pass = "duration:1 sec" 7 | 8 | on_fail = "exit" 9 | -------------------------------------------------------------------------------- /test/multiaal/test_fail.conf: -------------------------------------------------------------------------------- 1 | model = "testmodel.xrules" 2 | adapter = "lib(mycountertest2)" 3 | heuristic = "lookahead" 4 | coverage = "perm(2)" 5 | 6 | pass = "duration:1 sec" 7 | 8 | on_fail = "exit:0" 9 | on_pass = "exit:1" 10 | on_inconc = "exit:2" 11 | -------------------------------------------------------------------------------- /test/multiaal/testmodel.xrules: -------------------------------------------------------------------------------- 1 | 1 = "lib(mycountertest1)" 2 | 2 = "lib(mycountertest2)" 3 | 4 | (1,"iCreate") (2,"iCreate") -> "iCreate" 5 | (1,"iDestroy") (2,"iDestroy") -> "iDestroy" 6 | (1,"iIncrement") (2,"iIncrement") -> "iIncrement" 7 | (1,"iReset") (2,"iReset") -> "iReset" 8 | (1,"iCount") (2,"iCount") -> "iCount" 9 | -------------------------------------------------------------------------------- /test/set/arguments.conf: -------------------------------------------------------------------------------- 1 | model = "lsts_remote:fmbt-gt -f 'arguments.gt'" 2 | heuristic = "lookahead:4" 3 | 4 | # Test every combination of arguments -h, -p, -q so that the same 5 | # argument is not added twice between iCleanArguments() and iRun(...) 6 | # and the order of added arguments is not significant. 7 | 8 | coverage = set(from "iCleanArguments()" to "iRun('fmbt-editor')" -> "iAddArgument.*") 9 | 10 | # 28 steps should be enough for going through every combination 11 | # clean -> run 12 | # clean -> add -h -> run 13 | # clean -> add -p -> run 14 | # ... 15 | # clean -> add -h -> add -p -> add -q -> run 16 | pass = "steps:28" 17 | on_pass = "exit:0" 18 | on_fail = "exit:1" 19 | on_inconc = "exit:2" 20 | -------------------------------------------------------------------------------- /test/set/arguments.gt: -------------------------------------------------------------------------------- 1 | P(start, "gt:istate") 2 | -> 3 | T(start, "iCleanArguments()", args) 4 | 5 | T(args, "iAddArgument('-h')", args) 6 | T(args, "iAddArgument('-p')", args) 7 | T(args, "iAddArgument('-q PySide')", args) 8 | 9 | T(args, "iRun('fmbt-editor')", start) 10 | 11 | -------------------------------------------------------------------------------- /test/set/t2.gt: -------------------------------------------------------------------------------- 1 | P(s,p)->T(s,"iFoo",s2) 2 | 3 | P(s2,"tag") 4 | T(s2,"iFoo",s3) 5 | 6 | T(s3,"iBar",s2) 7 | 8 | -------------------------------------------------------------------------------- /test/tema_seq/mkrmdir.conf: -------------------------------------------------------------------------------- 1 | model = "mkrmdir.lsts" 2 | heuristic = "lookahead(1)" 3 | coverage = "perm(2)" 4 | adapter = "remote:remote_python -L adapter.log" 5 | pass = "coverage:1.0" 6 | pass = "steps:100" 7 | -------------------------------------------------------------------------------- /test/tema_seq/mkrmdir.lsts: -------------------------------------------------------------------------------- 1 | Begin Lsts 2 | 3 | Begin History 4 | End History 5 | 6 | Begin Header 7 | State_cnt = 5 8 | Action_cnt = 8 9 | Transition_cnt = 10 10 | State_prop_cnt = 2 11 | Initial_states = 1; 12 | End Header 13 | 14 | Begin Action_names 15 | 1 = "iCatch('from os import mkdir, rmdir') == None" 16 | 2 = "iCatch('dname=\'/tmp/fmbt.mkrmdir\'')" 17 | 3 = "iCatch('mkdir(dname)') == None" 18 | 4 = "iCatch('mkdir(dname)') == Error('.*File exists.*')" 19 | 5 = "iCatch('rmdir(dname)') == None" 20 | 6 = "iCatch('mkdir(dname+\'/d\')') == None" 21 | 7 = "iCatch('mkdir(dname+\'/d\')') == Error('.*File exists.*')" 22 | 8 = "iCatch('rmdir(dname)') == Error('.*No such file.*')" 23 | End Action_names 24 | 25 | Begin State_props 26 | "directory" : 4; 27 | "no directory" : 5; 28 | End State_props 29 | 30 | Begin Transitions 31 | 1: 2,1; 32 | 2: 3,2; 33 | 3: 4,3 4,4; 34 | 4: 4,4 5,5 4,6 4,7; 35 | 5: 4,3 5,8; 36 | End Transitions 37 | 38 | End Lsts 39 | -------------------------------------------------------------------------------- /test/weight/model.gt: -------------------------------------------------------------------------------- 1 | P(start, "gt:istate") 2 | -> 3 | P(start, "propo") 4 | P(start, "p2") 5 | T(start, "iFoo()", start) 6 | T(start, "iBar", start) 7 | T(start, "iZoo", start) 8 | T(start, "iTryRareThings", rarethings) 9 | 10 | P(rarethings, "rare") 11 | T(rarethings, "iRareImports", rarethings) 12 | T(rarethings, "iRareExports", rarethings) 13 | T(rarethings, "iBackToBusiness", start) 14 | -------------------------------------------------------------------------------- /test/weight/t2.gt: -------------------------------------------------------------------------------- 1 | P(s,p)->T(s,"iFoo",s2) 2 | 3 | P(s2,"tag") 4 | T(s2,"iFoo",s3) 5 | 6 | T(s3,"iBar",s2) 7 | 8 | -------------------------------------------------------------------------------- /test/weight/test-allzeros.weight: -------------------------------------------------------------------------------- 1 | ,".*":0 2 | 3 | # negative weights are handled as zeroes 4 | ,"iFoo": -1000 5 | -------------------------------------------------------------------------------- /test/weight/test-fiftyfifty.weight: -------------------------------------------------------------------------------- 1 | # Match to iFoo on any state - this adds weight 5 to iFoo only once 2 | , "iFoo\(\)" "iFo.*" "iF.*" "i[A-F]oo.*": 5 3 | 4 | # Match to iFoo on any state, more convenient notation without the 5 | # comma. This adds 5 to iFoo, making its weight total 10. 6 | "iFoo()": 5 7 | 8 | # The following spec will assign weight to actions 9 | # iBar and iBackToBusiness 10 | # on states tagged with "propo". 11 | "nonexisting-propo" "propo" "pro.*", "iNonEx.*" "iB.*":10 12 | 13 | # iZoo is only available in the initial state, tagged with "propo" 14 | # only. Therefore these weights should not affect test generation. 15 | "rare", "iZoo":100 16 | "nonexist.*", "iZoo": 100 17 | 18 | "propo", "iBar": 1000 19 | "iBar": -1000 20 | -------------------------------------------------------------------------------- /test/weight/test-noheur.conf: -------------------------------------------------------------------------------- 1 | model = "lsts_remote(fmbt-gt -f model.gt)" 2 | pass = "steps(100)" 3 | pass = "coverage(2)" 4 | -------------------------------------------------------------------------------- /test/weight/test-onlyone.weight: -------------------------------------------------------------------------------- 1 | "propo","iFoo\(\)": 1 2 | -------------------------------------------------------------------------------- /utils/fmbt-gteditor: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | # 4 | # fMBT, free Model Based Testing tool 5 | # Copyright (c) 2012, Intel Corporation. 6 | # 7 | # This program is free software; you can redistribute it and/or modify it 8 | # under the terms and conditions of the GNU Lesser General Public License, 9 | # version 2.1, as published by the Free Software Foundation. 10 | # 11 | # This program is distributed in the hope it will be useful, but WITHOUT 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 14 | # more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public License along with 17 | # this program; if not, write to the Free Software Foundation, Inc., 18 | # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 19 | 20 | print "fmbt-gteditor has been renamed to fmbt-editor" 21 | print "" 22 | print "This file is deprecated and will be removed in future releases." 23 | -------------------------------------------------------------------------------- /utils/fmbt_config.py.in: -------------------------------------------------------------------------------- 1 | fmbt_version = "@VERSION@" 2 | fmbt_build_info = "@FMBTBUILDINFO@" 3 | 4 | import os 5 | if os.name == "nt": 6 | import _winreg 7 | try: 8 | key = _winreg.OpenKey( 9 | _winreg.HKEY_LOCAL_MACHINE, 10 | r"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Intel fMBT", 0, _winreg.KEY_ALL_ACCESS) 11 | fmbt_install_location = _winreg.QueryValueEx(key, "InstallLocation")[0][1:-1] 12 | except Exception: 13 | fmbt_install_location = "" 14 | imagemagick_convert = os.path.join(fmbt_install_location, "IMconvert.exe") 15 | else: 16 | fmbt_install_location = "" 17 | imagemagick_convert = "convert" 18 | -------------------------------------------------------------------------------- /utils3/README: -------------------------------------------------------------------------------- 1 | This directory contains Python 3 versions of fMBT Python 2 utils/*. 2 | 3 | Example: How to use Python 3 and fmbtwindows from the source tree on 4 | Linux: 5 | 6 | 1. Create eye4grahics.so: 7 | - python3 setup.py build 8 | - ln -s build/lib.*/eye4graphics*so eye4graphics.so 9 | 10 | 2. Launch python3share on a Windows DUT: 11 | - Copy python3share on the DUT 12 | - Launch python3share-server -d on the DUT 13 | 14 | 3. You are ready to Python 3: 15 | >>> import fmbtwindows 16 | >>> dut = fmbtwindows.Device('dut-address') 17 | >>> dut.refreshScreenshot().save("/tmp/dutscreen.png") 18 | -------------------------------------------------------------------------------- /utils3/fmbt_config.py.in: -------------------------------------------------------------------------------- 1 | fmbt_version = "@VERSION@" 2 | fmbt_build_info = "@FMBTBUILDINFO@" 3 | 4 | import os 5 | if os.name == "nt": 6 | import _winreg 7 | try: 8 | key = _winreg.OpenKey( 9 | _winreg.HKEY_LOCAL_MACHINE, 10 | r"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Intel fMBT", 0, _winreg.KEY_ALL_ACCESS) 11 | fmbt_install_location = _winreg.QueryValueEx(key, "InstallLocation")[0][1:-1] 12 | except Exception: 13 | fmbt_install_location = "" 14 | imagemagick_convert = os.path.join(fmbt_install_location, "IMconvert.exe") 15 | else: 16 | fmbt_install_location = "" 17 | imagemagick_convert = "convert" 18 | --------------------------------------------------------------------------------