authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-14 03:10:56-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-14 03:10:56-04:00
log3f05fdc8e8fdc25faec2ca51547404411b314ce1
treea24b83c0b4cdd0bb9de0ae00991a29143d49e444
parentc65fe384ddb5f5f6a5f22cb636539fd91701de4d

tests: use a more robust path to self_hosted.zig

closes #184

2 files changed, 9 insertions(+), 1 deletions(-)

src/config.h.in+3
...@@ -18,4 +18,7 @@...@@ -18,4 +18,7 @@
1818
19#cmakedefine ZIG_LLVM_OLD_CXX_ABI19#cmakedefine ZIG_LLVM_OLD_CXX_ABI
2020
21// Only used for running tests before installing.
22#define ZIG_TEST_DIR "@CMAKE_SOURCE_DIR@/test"
23
21#endif24#endif
test/run_tests.cpp+6-1
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9#include "buffer.hpp"9#include "buffer.hpp"
10#include "os.hpp"10#include "os.hpp"
11#include "error.hpp"11#include "error.hpp"
12#include "config.h"
1213
13#include <stdio.h>14#include <stdio.h>
14#include <stdarg.h>15#include <stdarg.h>
...@@ -1831,11 +1832,15 @@ struct type {...@@ -1831,11 +1832,15 @@ struct type {
1831}1832}
18321833
1833static void run_self_hosted_test(bool is_release_mode) {1834static void run_self_hosted_test(bool is_release_mode) {
1835 Buf self_hosted_tests_file = BUF_INIT;
1836 os_path_join(buf_create_from_str(ZIG_TEST_DIR),
1837 buf_create_from_str("self_hosted.zig"), &self_hosted_tests_file);
1838
1834 Buf zig_stderr = BUF_INIT;1839 Buf zig_stderr = BUF_INIT;
1835 Buf zig_stdout = BUF_INIT;1840 Buf zig_stdout = BUF_INIT;
1836 ZigList<const char *> args = {0};1841 ZigList<const char *> args = {0};
1837 args.append("test");1842 args.append("test");
1838 args.append("../test/self_hosted.zig");1843 args.append(buf_ptr(&self_hosted_tests_file));
1839 if (is_release_mode) {1844 if (is_release_mode) {
1840 args.append("--release");1845 args.append("--release");
1841 }1846 }