diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-04-19 15:38:12 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-04-19 15:38:12 -0400 |
| commit | d12f1f5b4954d893111c05420060354537a1485c (patch) | |
| tree | 1026150a776607a5aae06273b3c3fa37ec47831f /src/analyze.cpp | |
| parent | 9b7f438882b4f283d252d8ca364607fae385cc1a (diff) | |
| download | zig-d12f1f5b4954d893111c05420060354537a1485c.tar.gz zig-d12f1f5b4954d893111c05420060354537a1485c.zip | |
test framework supports name prefix and filter argument
rename self hosted tests to behavior tests
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index af910cd590..aef85ca0b5 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1959,7 +1959,14 @@ static void preview_test_decl(CodeGen *g, AstNode *node, ScopeDecls *decls_scope if (import->package != g->root_package) return; - Buf *test_name = node->data.test_decl.name; + Buf *decl_name_buf = node->data.test_decl.name; + + Buf *test_name = g->test_name_prefix ? + buf_sprintf("%s%s", buf_ptr(g->test_name_prefix), buf_ptr(decl_name_buf)) : decl_name_buf; + + if (g->test_filter != nullptr && strstr(buf_ptr(test_name), buf_ptr(g->test_filter)) == nullptr) { + return; + } TldFn *tld_fn = allocate<TldFn>(1); init_tld(&tld_fn->base, TldIdFn, test_name, VisibModPrivate, node, &decls_scope->base); |
