fix(benchmarks): pure virtual method called (#2377)

* remove bench test lock

Signed-off-by: David Lemarier <david@lemarier.ca>

* use tauri commands to close the app

Signed-off-by: David Lemarier <david@lemarier.ca>
This commit is contained in:
david
2021-08-09 20:18:16 -07:00
committed by GitHub
parent 737da87244
commit b9a9de6b64
9 changed files with 26 additions and 3031 deletions

1
.gitignore vendored
View File

@@ -79,6 +79,7 @@ target
# lock for libs
/Cargo.lock
/tooling/bench/tests/Cargo.lock
/yarn.lock
/tooling/cli.js/test/jest/tmp

View File

@@ -202,6 +202,7 @@ fn run_exec_time(target_dir: &Path) -> Result<HashMap<String, HashMap<String, f6
"hyperfine",
"--export-json",
benchmark_file,
"--show-output",
"--warmup",
"3",
]

File diff suppressed because it is too large Load Diff

View File

@@ -17,13 +17,7 @@ const onMessage = (message) => {
if (message.data.status === 'done') {
// tell tauri that we are done
window.__TAURI__.invoke('tauri', {
__tauriModule: 'Process',
message: {
cmd: 'exit',
exitCode: 0
}
})
window.__TAURI__.invoke('app_completed_successfully');
}
status.innerHTML = `${prefix} Found <code>${message.data.count}</code> prime numbers in <code>${message.data.time}ms</code>`

View File

@@ -7,8 +7,14 @@
windows_subsystem = "windows"
)]
#[tauri::command]
fn app_completed_successfully() {
std::process::exit(0);
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![app_completed_successfully])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View File

@@ -24,23 +24,12 @@
}
})
.then((_data) => {
window.__TAURI__.invoke('tauri', {
__tauriModule: 'Process',
message: {
cmd: 'exit',
exitCode: 0
}
})
// success
window.__TAURI__.invoke('app_should_close', {exitCode: 0});
})
.catch((_error) => {
// error
window.__TAURI__.invoke('tauri', {
__tauriModule: 'Process',
message: {
cmd: 'exit',
exitCode: 1
}
})
window.__TAURI__.invoke('app_should_close', {exitCode: 1});
})
})
</script>

View File

@@ -7,8 +7,14 @@
windows_subsystem = "windows"
)]
#[tauri::command]
fn app_should_close(exit_code: i32) {
std::process::exit(exit_code);
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![app_should_close])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View File

@@ -10,15 +10,8 @@
<h1>Welcome to Tauri!</h1>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
window.__TAURI__.invoke('tauri', {
__tauriModule: 'Process',
message: {
cmd: 'exit',
exitCode: 0
}
})
})
window.addEventListener('DOMContentLoaded', (event) =>
window.__TAURI__.invoke('app_loaded_successfully'));
</script>
</body>
</html>

View File

@@ -7,8 +7,14 @@
windows_subsystem = "windows"
)]
#[tauri::command]
fn app_loaded_successfully() {
std::process::exit(0);
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![app_loaded_successfully])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}