1#!/bin/sh 2# -*- coding: utf-8 -*- 3# Copyright (C) 2012, 2014, 2015 Laboratoire de Recherche et 4# Développement de l'Epita (LRDE). 5# 6# This file is part of Spot, a model checking library. 7# 8# Spot is free software; you can redistribute it and/or modify it 9# under the terms of the GNU General Public License as published by 10# the Free Software Foundation; either version 3 of the License, or 11# (at your option) any later version. 12# 13# Spot is distributed in the hope that it will be useful, but WITHOUT 14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16# License for more details. 17# 18# You should have received a copy of the GNU General Public License 19# along with this program. If not, see <http://www.gnu.org/licenses/>. 20 21. ./defs 22set -e 23 24randaut a b -Q5 --hoa > aut1 25randaut a b c -Q10 --hoa > aut2 26autfilt --randomize aut1 --hoa > rand11 27autfilt --randomize --seed=1 aut1 --hoa > rand12 28autfilt --randomize --seed=2 aut1 --hoa > rand13 29autfilt --randomize aut2 --hoa > rand21 30autfilt --randomize --seed=1 aut2 --hoa > rand22 31autfilt --randomize --seed=2 aut2 --hoa > rand23 32 33cat aut1 aut2 > aut 34cat aut1 aut2 rand11 rand12 rand13 rand21 rand22 rand23 > all 35autfilt all --uniq --hoa > out 36diff aut out 37 38 39run 0 randaut -Hl -u -n 4 -Q1 a b | LC_ALL=C sort | 40 autfilt -H | grep '&' > out 41cat >expected <<EOF 42[!0&!1] 0 43[!0&1] 0 44[0&!1] 0 45[0&1] 0 46EOF 47diff out expected 48 49# This should fail: the random automaton generator can only generate 4 50# different one-state automaton with two atomic propositions. 51randaut -Hl -u -n 5 -Q1 a b >out 2>stderr && exit 1 52test $? = 2 53grep 'failed to generate a new unique automaton' stderr 54test 4 = `wc -l < out` 55