authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-11 16:52:50-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-11 16:52:50-04:00
log15c67d2d50aae11dd425ad2629ebc9770fb95f30
treea65c5de1d635ca077d5d6473467bbaff7e1a91f4
parent4af844732a88393b172d33676732580b056910f6
signature Commit is signed but in an unrecognized format.

fix docgen tests


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

doc/docgen.zig+7
......@@ -11,6 +11,7 @@ const max_doc_file_size = 10 * 1024 * 1024;
1111const exe_ext = std.build.Target(std.build.Target.Native).exeFileExt();
1212const obj_ext = std.build.Target(std.build.Target.Native).oFileExt();
1313const tmp_dir_name = "docgen_tmp";
14const test_out_path = tmp_dir_name ++ os.path.sep_str ++ "test" ++ exe_ext;
1415
1516pub fn main() !void {
1617 var direct_allocator = std.heap.DirectAllocator.init();
......@@ -821,6 +822,8 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
821822 zig_exe,
822823 "test",
823824 tmp_source_file_name,
825 "--output",
826 test_out_path,
824827 });
825828 try out.print("<pre><code class=\"shell\">$ zig test {}.zig", code.name);
826829 switch (code.mode) {
......@@ -863,6 +866,8 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
863866 "--color",
864867 "on",
865868 tmp_source_file_name,
869 "--output",
870 test_out_path,
866871 });
867872 try out.print("<pre><code class=\"shell\">$ zig test {}.zig", code.name);
868873 switch (code.mode) {
......@@ -918,6 +923,8 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
918923 zig_exe,
919924 "test",
920925 tmp_source_file_name,
926 "--output",
927 test_out_path,
921928 });
922929 switch (code.mode) {
923930 builtin.Mode.Debug => {},
src/codegen.cpp+2
......@@ -8122,6 +8122,8 @@ static void resolve_out_paths(CodeGen *g) {
81228122
81238123 if (g->enable_cache || g->out_type != OutTypeObj) {
81248124 os_path_join(&g->artifact_dir, o_basename, &g->o_file_output_path);
8125 } else if (g->wanted_output_file_path != nullptr && g->out_type == OutTypeObj) {
8126 buf_init_from_buf(&g->o_file_output_path, g->wanted_output_file_path);
81258127 } else {
81268128 buf_init_from_buf(&g->o_file_output_path, o_basename);
81278129 }