File: command.rs

package info (click to toggle)
rust-elfx86exts 0.6.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 180 kB
  • sloc: makefile: 2
file content (31 lines) | stat: -rw-r--r-- 854 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2019 Peter Williams
// Licensed under the MIT License.

//! Test the CLI command.

extern crate assert_cmd;
extern crate escargot;

use assert_cmd::prelude::*;
use std::process::Command;

/// Test that the command runs successfully on itself. In principle I think
/// this might be somewhat limiting: there's no reason you couldn't compile
/// this tool on a platform whose executable format is not ELF or Mach-O, and
/// in that case this test would fail. Somehow I'm not very worried about that
/// possibility, though.
#[test]
fn run_on_self() {
    let cmd_run = escargot::CargoBuild::new()
        .bin("elfx86exts")
        .current_release()
        .current_target()
        .run()
        .unwrap();
    let cmd_path = cmd_run.path();

    let mut cmd = Command::new(cmd_path);
    cmd.arg(cmd_path);

    cmd.assert().success();
}