aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-04-20 02:31:28 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-04-20 02:31:28 -0400
commit037a9d937d41552a44f8fd597e14a2d3491cb499 (patch)
tree398f7b9d18988b61ad12db21aa72e21da3aec4d4 /src/analyze.cpp
parent237dfdbdc6f83071cff88489cc66cb83a2d65b00 (diff)
parent8654bc18104d64c7a7f9f80bdba75ed4e0c005fa (diff)
downloadzig-037a9d937d41552a44f8fd597e14a2d3491cb499.tar.gz
zig-037a9d937d41552a44f8fd597e14a2d3491cb499.zip
Merge branch 'self-hosted-tests'
Now instead of: ``` ./run_tests ``` Do this: ``` ./zig build --build-file ../build.zig test ``` For more options, see: ``` ./zig build --build-file ../build.zig --help ```
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp9
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);