[gnome-desktop-testing] Use an automatically-cleaned per-test tmpdir
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop-testing] Use an automatically-cleaned per-test tmpdir
- Date: Sat, 27 Apr 2013 22:20:22 +0000 (UTC)
commit 6de44985b97f7d18c7f16560c43fc1c2c7702210
Author: Colin Walters <walters verbum org>
Date: Sat Apr 27 18:19:16 2013 -0400
Use an automatically-cleaned per-test tmpdir
Per updated specification.
src/gnome-desktop-testing-runner.js | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/gnome-desktop-testing-runner.js b/src/gnome-desktop-testing-runner.js
index 29968ff..a1f9cfd 100755
--- a/src/gnome-desktop-testing-runner.js
+++ b/src/gnome-desktop-testing-runner.js
@@ -59,10 +59,11 @@ function runTestsInDirectory(file) {
let [, testArgv] = GLib.shell_parse_argv(execKey);
print("Running test: " + childPath);
- let proc = GSystem.Subprocess.new_simple_argv(testArgv,
- GSystem.SubprocessStreamDisposition.INHERIT,
- GSystem.SubprocessStreamDisposition.INHERIT,
- cancellable);
+ let test_tmpdir = GLib.dir_make_tmp('test-tmp-' + name + '-XXXXXX' );
+ let context = new GSystem.SubprocessContext({ argv: testArgv });
+ context.set_cwd(test_tmpdir);
+ let proc = new GSystem.Subprocess({ context: context });
+ proc.init(cancellable);
let [, estatus] = proc.wait_sync(cancellable);
let errmsg = null;
let skipped = false;
@@ -79,6 +80,8 @@ function runTestsInDirectory(file) {
testSuccess = false;
}
}
+
+ GSystem.shutil_rm_rf(Gio.File.new_for_path(test_tmpdir), cancellable);
if (!testSuccess) {
GSystem.log_structured("Test " + childPath + " failed: " + errmsg,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]