From 18dd53731d2c7246811046e7d529a40289121182 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Sun, 4 Oct 2015 19:46:17 +0200 Subject: [PATCH] adapt tests to stat binary changes --- astat2/src/AutomataStat.cpp | 155 +++++++++++++++++++++-------------- astat2/src/GrammarStat.cpp | 16 ++-- astat2/src/PrintingOptions.h | 5 +- astat2/src/RegExpStat.cpp | 8 +- astat2/src/SetStat.cpp | 17 ++-- astat2/src/StringStat.cpp | 8 +- astat2/src/TreeStat.cpp | 8 +- astat2/src/astat.cpp | 4 +- tests.aarbology.sh | 16 ++-- tests.astringology.sh | 8 +- 10 files changed, 137 insertions(+), 108 deletions(-) diff --git a/astat2/src/AutomataStat.cpp b/astat2/src/AutomataStat.cpp index 436c6ceb81..ec55e82bd8 100644 --- a/astat2/src/AutomataStat.cpp +++ b/astat2/src/AutomataStat.cpp @@ -17,165 +17,194 @@ #include <container/ObjectsMap.h> #include <iostream> -void AutomataStat::stat(const automaton::Automaton& automaton, const AutomataSettings& settings) { - getInstance().dispatch(automaton.getData(), settings); +void AutomataStat::stat ( const automaton::Automaton & automaton, const AutomataSettings & settings ) { + getInstance ( ).dispatch ( automaton.getData ( ), settings ); } -void AutomataStat::stat(const automaton::NFA& automaton, const AutomataSettings& settings) { - switch(settings.states) { +void AutomataStat::stat ( const automaton::NFA & automaton, const AutomataSettings & settings ) { + switch ( settings.states ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(automaton.getStates()); + alib::XmlDataFactory::toStdout ( automaton.getStates ( ) ); break; - case PrintingOptions::QUANTITY: - std::cout << automaton.getStates().size() << std::endl; + + case PrintingOptions::SIZE: + std::cout << automaton.getStates ( ).size ( ) << std::endl; break; + case PrintingOptions::BOTH: - std::cout << automaton.getStates().size() << std::endl; - alib::XmlDataFactory::toStdout(automaton.getStates()); + std::cout << automaton.getStates ( ).size ( ) << std::endl; + alib::XmlDataFactory::toStdout ( automaton.getStates ( ) ); break; + case PrintingOptions::NOOP: break; } - switch(settings.finalStates) { + switch ( settings.finalStates ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(automaton.getFinalStates()); + alib::XmlDataFactory::toStdout ( automaton.getFinalStates ( ) ); break; - case PrintingOptions::QUANTITY: - std::cout << automaton.getFinalStates().size() << std::endl; + + case PrintingOptions::SIZE: + std::cout << automaton.getFinalStates ( ).size ( ) << std::endl; break; + case PrintingOptions::BOTH: - std::cout << automaton.getFinalStates().size() << std::endl; - alib::XmlDataFactory::toStdout(automaton.getFinalStates()); + std::cout << automaton.getFinalStates ( ).size ( ) << std::endl; + alib::XmlDataFactory::toStdout ( automaton.getFinalStates ( ) ); break; + case PrintingOptions::NOOP: break; } - switch(settings.initialStates) { + switch ( settings.initialStates ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(automaton.getInitialState()); + alib::XmlDataFactory::toStdout ( automaton.getInitialState ( ) ); break; - case PrintingOptions::QUANTITY: + + case PrintingOptions::SIZE: std::cout << 1 << std::endl; break; + case PrintingOptions::BOTH: std::cout << 1 << std::endl; - alib::XmlDataFactory::toStdout(automaton.getInitialState()); + alib::XmlDataFactory::toStdout ( automaton.getInitialState ( ) ); break; + case PrintingOptions::NOOP: break; } - switch(settings.inputAlphabet) { + switch ( settings.inputAlphabet ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(automaton.getInputAlphabet()); + alib::XmlDataFactory::toStdout ( automaton.getInputAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: - std::cout << automaton.getInputAlphabet().size() << std::endl; + + case PrintingOptions::SIZE: + std::cout << automaton.getInputAlphabet ( ).size ( ) << std::endl; break; + case PrintingOptions::BOTH: - std::cout << automaton.getInputAlphabet().size() << std::endl; - alib::XmlDataFactory::toStdout(automaton.getInputAlphabet()); + std::cout << automaton.getInputAlphabet ( ).size ( ) << std::endl; + alib::XmlDataFactory::toStdout ( automaton.getInputAlphabet ( ) ); break; + case PrintingOptions::NOOP: break; } - switch(settings.transitions) { + switch ( settings.transitions ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(automaton.getTransitions()); + alib::XmlDataFactory::toStdout ( automaton.getTransitions ( ) ); break; - case PrintingOptions::QUANTITY: - std::cout << automaton.getTransitions().size() << std::endl; + + case PrintingOptions::SIZE: + std::cout << automaton.getTransitions ( ).size ( ) << std::endl; break; + case PrintingOptions::BOTH: - std::cout << automaton.getTransitions().size() << std::endl; - alib::XmlDataFactory::toStdout(automaton.getTransitions()); + std::cout << automaton.getTransitions ( ).size ( ) << std::endl; + alib::XmlDataFactory::toStdout ( automaton.getTransitions ( ) ); break; + case PrintingOptions::NOOP: break; } } -auto AutomataStatNFA = AutomataStat::RegistratorWrapper<void, automaton::NFA>(AutomataStat::getInstance(), AutomataStat::stat); +auto AutomataStatNFA = AutomataStat::RegistratorWrapper < void, automaton::NFA > ( AutomataStat::getInstance ( ), AutomataStat::stat ); -void AutomataStat::stat(const automaton::DFA& automaton, const AutomataSettings& settings) { - switch(settings.states) { +void AutomataStat::stat ( const automaton::DFA & automaton, const AutomataSettings & settings ) { + switch ( settings.states ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(automaton.getStates()); + alib::XmlDataFactory::toStdout ( automaton.getStates ( ) ); break; - case PrintingOptions::QUANTITY: - std::cout << automaton.getStates().size() << std::endl; + + case PrintingOptions::SIZE: + std::cout << automaton.getStates ( ).size ( ) << std::endl; break; + case PrintingOptions::BOTH: - std::cout << automaton.getStates().size() << std::endl; - alib::XmlDataFactory::toStdout(automaton.getStates()); + std::cout << automaton.getStates ( ).size ( ) << std::endl; + alib::XmlDataFactory::toStdout ( automaton.getStates ( ) ); break; + case PrintingOptions::NOOP: break; } - switch(settings.finalStates) { + switch ( settings.finalStates ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(automaton.getFinalStates()); + alib::XmlDataFactory::toStdout ( automaton.getFinalStates ( ) ); break; - case PrintingOptions::QUANTITY: - std::cout << automaton.getFinalStates().size() << std::endl; + + case PrintingOptions::SIZE: + std::cout << automaton.getFinalStates ( ).size ( ) << std::endl; break; + case PrintingOptions::BOTH: - std::cout << automaton.getFinalStates().size() << std::endl; - alib::XmlDataFactory::toStdout(automaton.getFinalStates()); + std::cout << automaton.getFinalStates ( ).size ( ) << std::endl; + alib::XmlDataFactory::toStdout ( automaton.getFinalStates ( ) ); break; + case PrintingOptions::NOOP: break; } - switch(settings.initialStates) { + switch ( settings.initialStates ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(automaton.getInitialState()); + alib::XmlDataFactory::toStdout ( automaton.getInitialState ( ) ); break; - case PrintingOptions::QUANTITY: + + case PrintingOptions::SIZE: std::cout << 1 << std::endl; break; + case PrintingOptions::BOTH: std::cout << 1 << std::endl; - alib::XmlDataFactory::toStdout(automaton.getInitialState()); + alib::XmlDataFactory::toStdout ( automaton.getInitialState ( ) ); break; + case PrintingOptions::NOOP: break; } - switch(settings.inputAlphabet) { + switch ( settings.inputAlphabet ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(automaton.getInputAlphabet()); + alib::XmlDataFactory::toStdout ( automaton.getInputAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: - std::cout << automaton.getInputAlphabet().size() << std::endl; + + case PrintingOptions::SIZE: + std::cout << automaton.getInputAlphabet ( ).size ( ) << std::endl; break; + case PrintingOptions::BOTH: - std::cout << automaton.getInputAlphabet().size() << std::endl; - alib::XmlDataFactory::toStdout(automaton.getInputAlphabet()); + std::cout << automaton.getInputAlphabet ( ).size ( ) << std::endl; + alib::XmlDataFactory::toStdout ( automaton.getInputAlphabet ( ) ); break; + case PrintingOptions::NOOP: break; } - switch(settings.transitions) { + switch ( settings.transitions ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(automaton.getTransitions()); + alib::XmlDataFactory::toStdout ( automaton.getTransitions ( ) ); break; - case PrintingOptions::QUANTITY: - std::cout << automaton.getTransitions().size() << std::endl; + + case PrintingOptions::SIZE: + std::cout << automaton.getTransitions ( ).size ( ) << std::endl; break; + case PrintingOptions::BOTH: - std::cout << automaton.getTransitions().size() << std::endl; - alib::XmlDataFactory::toStdout(automaton.getTransitions()); + std::cout << automaton.getTransitions ( ).size ( ) << std::endl; + alib::XmlDataFactory::toStdout ( automaton.getTransitions ( ) ); break; + case PrintingOptions::NOOP: break; } } -auto AutomataStatDFA = AutomataStat::RegistratorWrapper<void, automaton::DFA>(AutomataStat::getInstance(), AutomataStat::stat); - +auto AutomataStatDFA = AutomataStat::RegistratorWrapper < void, automaton::DFA > ( AutomataStat::getInstance ( ), AutomataStat::stat ); diff --git a/astat2/src/GrammarStat.cpp b/astat2/src/GrammarStat.cpp index c7bd92082e..723fb953ab 100644 --- a/astat2/src/GrammarStat.cpp +++ b/astat2/src/GrammarStat.cpp @@ -29,7 +29,7 @@ void GrammarStat::stat ( const grammar::RightRG & grammar, const GrammarSettings alib::XmlDataFactory::toStdout ( grammar.getNonterminalAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << grammar.getNonterminalAlphabet ( ).size ( ) << std::endl; break; @@ -47,7 +47,7 @@ void GrammarStat::stat ( const grammar::RightRG & grammar, const GrammarSettings alib::XmlDataFactory::toStdout ( grammar.getTerminalAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << grammar.getTerminalAlphabet ( ).size ( ) << std::endl; break; @@ -65,7 +65,7 @@ void GrammarStat::stat ( const grammar::RightRG & grammar, const GrammarSettings alib::XmlDataFactory::toStdout ( grammar.getInitialSymbol ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << 1 << std::endl; break; @@ -83,7 +83,7 @@ void GrammarStat::stat ( const grammar::RightRG & grammar, const GrammarSettings alib::XmlDataFactory::toStdout ( grammar.getRules ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << grammar.getRules ( ).size ( ) << std::endl; break; @@ -105,7 +105,7 @@ void GrammarStat::stat ( const grammar::RightLG & grammar, const GrammarSettings alib::XmlDataFactory::toStdout ( grammar.getNonterminalAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << grammar.getNonterminalAlphabet ( ).size ( ) << std::endl; break; @@ -123,7 +123,7 @@ void GrammarStat::stat ( const grammar::RightLG & grammar, const GrammarSettings alib::XmlDataFactory::toStdout ( grammar.getTerminalAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << grammar.getTerminalAlphabet ( ).size ( ) << std::endl; break; @@ -141,7 +141,7 @@ void GrammarStat::stat ( const grammar::RightLG & grammar, const GrammarSettings alib::XmlDataFactory::toStdout ( grammar.getInitialSymbol ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << 1 << std::endl; break; @@ -159,7 +159,7 @@ void GrammarStat::stat ( const grammar::RightLG & grammar, const GrammarSettings alib::XmlDataFactory::toStdout ( grammar.getRules ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << grammar.getRules ( ).size ( ) << std::endl; break; diff --git a/astat2/src/PrintingOptions.h b/astat2/src/PrintingOptions.h index 0a3c031f68..9d66a6e02c 100644 --- a/astat2/src/PrintingOptions.h +++ b/astat2/src/PrintingOptions.h @@ -9,10 +9,7 @@ #define __PRINTING_OPTIONS_H__ enum class PrintingOptions { - PRINT, - QUANTITY, - BOTH, - NOOP + PRINT, SIZE, BOTH, NOOP }; #endif /* __PRINTING_OPTIONS_H_ */ diff --git a/astat2/src/RegExpStat.cpp b/astat2/src/RegExpStat.cpp index f0c0a858f3..bb6803bb00 100644 --- a/astat2/src/RegExpStat.cpp +++ b/astat2/src/RegExpStat.cpp @@ -30,7 +30,7 @@ void RegExpStat::stat ( const regexp::FormalRegExp & regexp, const RegExpSetting alib::XmlDataFactory::toStdout ( regexp.getAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << regexp.getAlphabet ( ).size ( ) << std::endl; break; @@ -48,7 +48,7 @@ void RegExpStat::stat ( const regexp::FormalRegExp & regexp, const RegExpSetting alib::XmlDataFactory::toStdout ( & regexp.getRegExp ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << countNodes ( regexp.getRegExp ( ) ) << std::endl; break; @@ -74,7 +74,7 @@ void RegExpStat::stat ( const regexp::UnboundedRegExp & regexp, const RegExpSett alib::XmlDataFactory::toStdout ( regexp.getAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << regexp.getAlphabet ( ).size ( ) << std::endl; break; @@ -92,7 +92,7 @@ void RegExpStat::stat ( const regexp::UnboundedRegExp & regexp, const RegExpSett alib::XmlDataFactory::toStdout ( & regexp.getRegExp ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << countNodes ( regexp.getRegExp ( ) ) << std::endl; break; diff --git a/astat2/src/SetStat.cpp b/astat2/src/SetStat.cpp index 7201c11e24..d23fd0346d 100644 --- a/astat2/src/SetStat.cpp +++ b/astat2/src/SetStat.cpp @@ -12,18 +12,21 @@ #include <factory/XmlDataFactory.hpp> #include <iostream> -void SetStat::stat(const container::ObjectsSet& data, const SetSettings& settings) { - switch(settings.general) { +void SetStat::stat ( const container::ObjectsSet & data, const SetSettings & settings ) { + switch ( settings.general ) { case PrintingOptions::PRINT: - alib::XmlDataFactory::toStdout(data); + alib::XmlDataFactory::toStdout ( data ); break; - case PrintingOptions::QUANTITY: - std::cout << data.size() << std::endl; + + case PrintingOptions::SIZE: + std::cout << data.size ( ) << std::endl; break; + case PrintingOptions::BOTH: - std::cout << data.size() << std::endl; - alib::XmlDataFactory::toStdout(data); + std::cout << data.size ( ) << std::endl; + alib::XmlDataFactory::toStdout ( data ); break; + case PrintingOptions::NOOP: break; } diff --git a/astat2/src/StringStat.cpp b/astat2/src/StringStat.cpp index 45fed42d1d..b21aef26bf 100644 --- a/astat2/src/StringStat.cpp +++ b/astat2/src/StringStat.cpp @@ -27,7 +27,7 @@ void StringStat::stat ( const string::LinearString & string, const StringSetting alib::XmlDataFactory::toStdout ( string.getAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << string.getAlphabet ( ).size ( ) << std::endl; break; @@ -45,7 +45,7 @@ void StringStat::stat ( const string::LinearString & string, const StringSetting alib::XmlDataFactory::toStdout ( string.getContent ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << string.getContent ( ).size ( ) << std::endl; break; @@ -67,7 +67,7 @@ void StringStat::stat ( const string::CyclicString & string, const StringSetting alib::XmlDataFactory::toStdout ( string.getAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << string.getAlphabet ( ).size ( ) << std::endl; break; @@ -85,7 +85,7 @@ void StringStat::stat ( const string::CyclicString & string, const StringSetting alib::XmlDataFactory::toStdout ( string.getContent ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << string.getContent ( ).size ( ) << std::endl; break; diff --git a/astat2/src/TreeStat.cpp b/astat2/src/TreeStat.cpp index fe6e982d81..c8498b84c3 100644 --- a/astat2/src/TreeStat.cpp +++ b/astat2/src/TreeStat.cpp @@ -35,7 +35,7 @@ void TreeStat::stat ( const tree::RankedTree & tree, const TreeSettings & settin alib::XmlDataFactory::toStdout ( tree.getAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << tree.getAlphabet ( ).size ( ) << std::endl; break; @@ -53,7 +53,7 @@ void TreeStat::stat ( const tree::RankedTree & tree, const TreeSettings & settin alib::XmlDataFactory::toStdout ( & tree.getRoot ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << countNodes ( tree.getRoot ( ) ) << std::endl; break; @@ -84,7 +84,7 @@ void TreeStat::stat ( const tree::UnrankedTree & tree, const TreeSettings & sett alib::XmlDataFactory::toStdout ( tree.getAlphabet ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << tree.getAlphabet ( ).size ( ) << std::endl; break; @@ -102,7 +102,7 @@ void TreeStat::stat ( const tree::UnrankedTree & tree, const TreeSettings & sett alib::XmlDataFactory::toStdout ( & tree.getRoot ( ) ); break; - case PrintingOptions::QUANTITY: + case PrintingOptions::SIZE: std::cout << countNodes ( tree.getRoot ( ) ) << std::endl; break; diff --git a/astat2/src/astat.cpp b/astat2/src/astat.cpp index e036c8dc61..d4794cd3b0 100644 --- a/astat2/src/astat.cpp +++ b/astat2/src/astat.cpp @@ -23,8 +23,8 @@ PrintingOptions translatePrintingOptions ( std::string value ) { return PrintingOptions::NOOP; else if ( value == "print" ) return PrintingOptions::PRINT; - else if ( value == "quantity" ) - return PrintingOptions::QUANTITY; + else if ( value == "size" ) + return PrintingOptions::SIZE; else if ( value == "both" ) return PrintingOptions::BOTH; else diff --git a/tests.aarbology.sh b/tests.aarbology.sh index ed0d888161..d0dbdedf63 100755 --- a/tests.aarbology.sh +++ b/tests.aarbology.sh @@ -140,7 +140,7 @@ function runTestSubtree { for SUBJECT_FILE in `ls $TESTS_DIR/aarbology.test*.subject.xml`; do PATTERN_FILE=${SUBJECT_FILE%.subject.xml}.subtree.xml if [ -f ]; then - Occs=`./aarbology2 -a exactSubtreeMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p quantity -s` + Occs=`./aarbology2 -a exactSubtreeMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p size --set` runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" registerResult $? @@ -157,7 +157,7 @@ function runTestSubtree { cat <(generateSubject) > $SUBJECT_FILE cat <(generateSubtree) > $PATTERN_FILE - Occs=`./aarbology2 -a exactSubtreeMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p quantity -s` + Occs=`./aarbology2 -a exactSubtreeMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p size --set` runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" registerResult $? @@ -180,7 +180,7 @@ function runTestPattern { for SUBJECT_FILE in `ls $TESTS_DIR/aarbology.test*.subject.xml`; do PATTERN_FILE=${SUBJECT_FILE%.subject.xml}.pattern.xml if [ -f ]; then - Occs=`./aarbology2 -a exactPatternMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p quantity -s` + Occs=`./aarbology2 -a exactPatternMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p size --set` runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" registerResult $? @@ -197,7 +197,7 @@ function runTestPattern { cat <(generateSubject) > $SUBJECT_FILE cat <(generatePattern) > $PATTERN_FILE - Occs=`./aarbology2 -a exactPatternMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p quantity -s` + Occs=`./aarbology2 -a exactPatternMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p size --set` runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" registerResult $? @@ -209,8 +209,8 @@ function runTestPattern { outputResults } -runTestSubtree "Exact Boyer Moore Horspool" "./aarbology2 -a boyerMooreHorspool -s <( ./acast2 -t PrefixRankedBarTree -i \"\$SUBJECT_FILE\" ) -p <( ./acast2 -t PrefixRankedBarTree -i \"\$PATTERN_FILE\" ) | ./astat2 -p quantity -s" -runTestSubtree "Exact Subtree Automaton" "./arun2 -t occurrences -a <(./aarbology2 -a exactSubtreeMatchingAutomaton -p \"\$PATTERN_FILE\" | ./adeterminize2) -i \"\$SUBJECT_FILE\" | ./astat2 -p quantity -s" +runTestSubtree "Exact Boyer Moore Horspool" "./aarbology2 -a boyerMooreHorspool -s <( ./acast2 -t PrefixRankedBarTree -i \"\$SUBJECT_FILE\" ) -p <( ./acast2 -t PrefixRankedBarTree -i \"\$PATTERN_FILE\" ) | ./astat2 -p size --set" +runTestSubtree "Exact Subtree Automaton" "./arun2 -t occurrences -a <(./aarbology2 -a exactSubtreeMatchingAutomaton -p \"\$PATTERN_FILE\" | ./adeterminize2) -i \"\$SUBJECT_FILE\" | ./astat2 -p size --set" -runTestPattern "Exact Boyer Moore Horspool" "./aarbology2 -a boyerMooreHorspool -s <( ./acast2 -t PrefixRankedBarTree -i \"\$SUBJECT_FILE\" ) -p <( ./acast2 -t PrefixRankedBarPattern -i \"\$PATTERN_FILE\" ) | ./astat2 -p quantity -s" -runTestPattern "Exact Knuth Morris Pratt" "./aarbology2 -a knuthMorrisPratt -s <( ./acast2 -t PrefixRankedBarTree -i \"\$SUBJECT_FILE\" ) -p <( ./acast2 -t PrefixRankedBarPattern -i \"\$PATTERN_FILE\" ) | ./astat2 -p quantity -s" +runTestPattern "Exact Boyer Moore Horspool" "./aarbology2 -a boyerMooreHorspool -s <( ./acast2 -t PrefixRankedBarTree -i \"\$SUBJECT_FILE\" ) -p <( ./acast2 -t PrefixRankedBarPattern -i \"\$PATTERN_FILE\" ) | ./astat2 -p size --set" +runTestPattern "Exact Knuth Morris Pratt" "./aarbology2 -a knuthMorrisPratt -s <( ./acast2 -t PrefixRankedBarTree -i \"\$SUBJECT_FILE\" ) -p <( ./acast2 -t PrefixRankedBarPattern -i \"\$PATTERN_FILE\" ) | ./astat2 -p size --set" diff --git a/tests.astringology.sh b/tests.astringology.sh index d1a157775c..974d5f288d 100755 --- a/tests.astringology.sh +++ b/tests.astringology.sh @@ -134,7 +134,7 @@ function runTest { for SUBJECT_FILE in `ls $TESTS_DIR/astringology.test*.subject.xml`; do PATTERN_FILE=${SUBJECT_FILE%.subject.xml}.pattern.xml if [ -f ]; then - Occs=`./astringology2 -a exactFactorMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p quantity -s` + Occs=`./astringology2 -a exactFactorMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p size --set` runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" registerResult $? @@ -151,7 +151,7 @@ function runTest { cat <(generateSubject) > $SUBJECT_FILE cat <(generatePattern) > $PATTERN_FILE - Occs=`./astringology2 -a exactFactorMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p quantity -s` + Occs=`./astringology2 -a exactFactorMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p size --set` runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" registerResult $? @@ -163,6 +163,6 @@ function runTest { outputResults } -runTest "Exact Boyer Moore Horspool" "./astringology2 -a boyerMooreHorspool -s \"\$SUBJECT_FILE\" -p \"\$PATTERN_FILE\" | ./astat2 -p quantity -s" -runTest "Exact Matching Automaton" "./arun2 -t occurrences -a <(./astringology2 -a exactMatchingAutomaton -p \"\$PATTERN_FILE\" | ./adeterminize2) -i \"\$SUBJECT_FILE\" | ./astat2 -p quantity -s" +runTest "Exact Boyer Moore Horspool" "./astringology2 -a boyerMooreHorspool -s \"\$SUBJECT_FILE\" -p \"\$PATTERN_FILE\" | ./astat2 -p size --set" +runTest "Exact Matching Automaton" "./arun2 -t occurrences -a <(./astringology2 -a exactMatchingAutomaton -p \"\$PATTERN_FILE\" | ./adeterminize2) -i \"\$SUBJECT_FILE\" | ./astat2 -p size --set" -- GitLab