try to use legacy linker on static-site-gen in example tests

This commit is contained in:
Brian Carroll 2022-08-30 23:57:38 +01:00
parent 63bc153025
commit f1cb7d735b
No known key found for this signature in database
GPG key ID: 9CF4E3BF9C4722C7
3 changed files with 13 additions and 9 deletions

View file

@ -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",

View file

@ -1,2 +1,2 @@
/output /output
/app /static-site

View file

@ -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