mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
try to use legacy linker on static-site-gen in example tests
This commit is contained in:
parent
63bc153025
commit
f1cb7d735b
3 changed files with 13 additions and 9 deletions
|
@ -275,6 +275,11 @@ mod cli_run {
|
||||||
let example = $example;
|
let example = $example;
|
||||||
let file_name = example_file(dir_name, example.filename);
|
let file_name = example_file(dir_name, example.filename);
|
||||||
|
|
||||||
|
let mut app_args: Vec<String> = vec![];
|
||||||
|
for file in example.input_paths {
|
||||||
|
app_args.push(example_file(dir_name, file).to_str().unwrap().to_string());
|
||||||
|
}
|
||||||
|
|
||||||
match example.executable_filename {
|
match example.executable_filename {
|
||||||
"form" | "hello-gui" | "breakout" | "ruby" => {
|
"form" | "hello-gui" | "breakout" | "ruby" => {
|
||||||
// Since these require things the build system often doesn't have
|
// Since these require things the build system often doesn't have
|
||||||
|
@ -294,14 +299,13 @@ mod cli_run {
|
||||||
eprintln!("WARNING: skipping testing example {} because it only works in a browser!", example.filename);
|
eprintln!("WARNING: skipping testing example {} because it only works in a browser!", example.filename);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
"static-site" => {
|
||||||
|
run_roc_on(&file_name, [LINKER_FLAG, "legacy"], &[], &app_args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut app_args: Vec<String> = vec![];
|
|
||||||
for file in example.input_paths {
|
|
||||||
app_args.push(example_file(dir_name, file).to_str().unwrap().to_string());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check with and without optimizations
|
// Check with and without optimizations
|
||||||
check_output_with_stdin(
|
check_output_with_stdin(
|
||||||
&file_name,
|
&file_name,
|
||||||
|
@ -534,8 +538,8 @@ mod cli_run {
|
||||||
},
|
},
|
||||||
static_site_gen: "static-site-gen" => {
|
static_site_gen: "static-site-gen" => {
|
||||||
Example {
|
Example {
|
||||||
filename: "app.roc",
|
filename: "static-site.roc",
|
||||||
executable_filename: "app",
|
executable_filename: "static-site",
|
||||||
stdin: &[],
|
stdin: &[],
|
||||||
input_paths: &["input", "output"],
|
input_paths: &["input", "output"],
|
||||||
expected_ending: "hello.txt -> hello.html\n",
|
expected_ending: "hello.txt -> hello.html\n",
|
||||||
|
|
2
examples/static-site-gen/.gitignore
vendored
2
examples/static-site-gen/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
/output
|
/output
|
||||||
/app
|
/static-site
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
app "app"
|
app "static-site"
|
||||||
packages { pf: "platform/main.roc" }
|
packages { pf: "platform/main.roc" }
|
||||||
imports [pf.Html.{ html, head, body, div, text }]
|
imports [pf.Html.{ html, head, body, div, text }]
|
||||||
provides [transformFileContent] to pf
|
provides [transformFileContent] to pf
|
Loading…
Add table
Add a link
Reference in a new issue