Skip to content

Conversation

gitoleg
Copy link
Contributor

@gitoleg gitoleg commented Aug 6, 2020

This PR removes expect from most of the test cases and adds a couple of primitives to match against the output of any command.

Examples

  • Match bap bir and find the main function according to the pattern:
 match $file bir "" {
     "sub .*main" {pass "$test $file"}
     default {fail "$test $file"}
 }
  • Match bap ouptut for --version option:
match_output "bap" "--version" {
    "error" {fail $test}
    "1" {pass $test}
}
  • Check that all strings can be found in the output:
find_all $file bir $lines $test

Fixes #1136

This PR removes `expect` from the most of the test cases and
adds a couple of primitives to match against output of any command.

Match `bap` `bir` and find the `main` function according to the pattern:

```
 match $file bir "" {
     "sub .*main" {pass "$test $file"}
     default {fail "$test $file"}
 }
```

Match bap ouptut for `--version` option:
```
match_output "bap" "--version" {
    "error" {fail $test}
    "1" {pass $test}
}
```

Check that all strings can be found in the output:
```
find_all $file bir $lines $test
```

Fixes BinaryAnalysisPlatform#1136
@gitoleg gitoleg force-pushed the improves-functional-tests branch from 9d1b072 to d118c3c Compare August 19, 2020 13:23
@gitoleg gitoleg merged commit c93b5d8 into BinaryAnalysisPlatform:master Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optimize functional tests
2 participants