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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078
#[macro_use] extern crate nom; use std::str; use nom::{line_ending, digit, space}; named!( rest_of_line<&str>, do_parse!( content: map_res!( nom::not_line_ending, str::from_utf8 ) >> line_ending >> (content) ) ); named!( compiling<()>, do_parse!( ws!(tag!("Compiling")) >> rest_of_line >> () ) ); named!( downloading<()>, do_parse!( ws!(tag!("Downloading")) >> rest_of_line >> () ) ); named!( installing<()>, do_parse!( ws!(tag!("Installing")) >> rest_of_line >> () ) ); named!( updating<()>, do_parse!( ws!(tag!("Updating")) >> rest_of_line >> () ) ); named!( finished<()>, do_parse!( ws!(tag!("Finished")) >> rest_of_line >> () ) ); named!( suite_line<&str>, do_parse!( ws!( alt!(tag!("Running") | tag!("Doc-tests")) ) >> name: rest_of_line >> (name) ) ); named!( suite_count<()>, do_parse!( ws!(tag!("running")) >> rest_of_line >> () ) ); named!( ok<&str>, map!(tag!("ok"), |_| "pass") ); named!( failed<&str>, map!(tag!("FAILED"), |_| "fail") ); named!( ok_or_failed<&str>, alt!(ok | failed) ); #[derive(Debug, PartialEq)] pub struct Test<'a, 'b, 'c> { pub name: &'a str, pub status: &'b str, pub error: Option<&'c str>, } named!( test_result<Test>, do_parse!( tag!("test") >> space >> name: map_res!( take_until_s!(" ..."), str::from_utf8 ) >> tag!(" ...") >> status: ws!(ok_or_failed) >> (Test { name: name, status: status, error: None }) ) ); named!( test_results<Vec<Test> >, many0!( test_result ) ); named!( digits<i64>, map_res!( map_res!( ws!(digit), str::from_utf8 ), str::FromStr::from_str ) ); #[derive(Debug, PartialEq)] pub struct SuiteResult<'a> { pub state: &'a str, pub passed: i64, pub failed: i64, pub ignored: i64, pub total: i64, pub measured: i64, } named!( suite_result<SuiteResult>, do_parse!( ws!(tag!("test result: ")) >> state: ok_or_failed >> char!('.') >> passed: digits >> tag!("passed;") >> failed: digits >> tag!("failed;") >> ignored: digits >> tag!("ignored;") >> measured: digits >> tag!("measured;") >> digits >> ws!(tag!("filtered out")) >> (SuiteResult { state:state, passed:passed, failed:failed, ignored:ignored, total: passed + failed + ignored, measured:measured }) ) ); named!( fail_line<&str>, do_parse!( ws!(tag!("----")) >> name: map_res!( take_until!(" "), str::from_utf8 ) >> ws!(tag!("stdout")) >> ws!(tag!("----")) >> (name) ) ); #[derive(Debug, PartialEq)] pub struct Failure<'a, 'b> { pub name: &'a str, pub error: &'b str, } named!( failure<Failure>, do_parse!( name: fail_line >> error: rest_of_line >> opt!( tag!("note: Run with `RUST_BACKTRACE=1` for a backtrace.") ) >> line_ending >> line_ending >> (Failure { name:name, error:error }) ) ); named!(failures<Vec<Failure> >, many1!(failure)); named!(fail_opt<Option<Vec<Failure> > >, opt!( do_parse!( ws!( tag!("failures:") ) >> f: failures >> take_until!( "test result: " ) >> (f) ) ) ); #[derive(Debug, PartialEq)] pub struct Suite<'a, 'b, 'c, 'd, 'e> { pub name: &'a str, pub state: &'b str, pub passed: i64, pub failed: i64, pub ignored: i64, pub measured: i64, pub total: i64, pub tests: Vec<Test<'c, 'd, 'e>>, } fn find_message_by_name<'a, 'b>(name: &str, failures: &Vec<Failure<'a, 'b>>) -> Option<&'b str> { failures.iter().find(|x| x.name == name).map(|x| x.error) } fn handle_parsed_suite<'a, 'b, 'c, 'd, 'e>( name: &'a str, tests: Vec<Test<'c, 'd, 'e>>, failures: Option<Vec<Failure<'e, 'e>>>, result: SuiteResult<'b>, ) -> Suite<'a, 'b, 'c, 'd, 'e> { let tests_with_failures = match failures { Some(xs) => { tests .iter() .map(|t| { Test { error: find_message_by_name(t.name, &xs), name: t.name, status: t.status, } }) .collect() } None => tests, }; Suite { name: name, tests: tests_with_failures, state: result.state, total: result.total, passed: result.passed, failed: result.failed, ignored: result.ignored, measured: result.measured, } } named!( suite_parser<Suite>, do_parse!( name: suite_line >> suite_count >> tests: test_results >> failures: fail_opt >> result: suite_result >> (handle_parsed_suite(name, tests, failures, result)) ) ); named!( suites_parser<Vec<Suite > >, many1!(suite_parser) ); named!( compile_error<Vec<Suite > >, do_parse!( ws!(tag!("error")) >> opt_res!( do_parse!( char!('[') >> take_until_and_consume!("]") >> () ) ) >> ws!(char!(':')) >> error: map_res!( take_till!(|c| c == 0x0), str::from_utf8 ) >> (vec![Suite { name: "unknown", state: "fail", total: 1, passed: 0, failed: 1, ignored: 0, measured: 0, tests: vec![ Test { name: "compile failed", status: "fail", error: Some(error.into()) } ] }]) ) ); named!( pub cargo_test_result_parser<Vec<Suite > >, do_parse!( many0!( alt!(updating | downloading | installing | compiling | finished) ) >> suites: alt!(suites_parser | compile_error) >> (suites) ) ); #[cfg(test)] mod parser_tests { use nom::IResult; use std::fmt::Debug; use super::{downloading, compiling, installing, finished, suite_line, suite_count, ok_or_failed, Test, test_result, test_results, digits, suite_result, SuiteResult, cargo_test_result_parser, Suite, fail_line, failure, Failure, failures}; fn assert_done<R: PartialEq + Debug>(l: IResult<&[u8], R>, r: R) { assert_eq!( l, IResult::Done(&b""[..], r) ) } #[test] fn it_should_parse_a_downloading_line() { let output = &b" Downloading nvpair-sys v0.1.0 "[..]; assert_done(downloading(output), ()) } #[test] fn it_should_parse_an_installing_line() { let output = &b" Installing cargo-test-junit v0.6.2 "[..]; assert_done(installing(output), ()) } #[test] fn it_should_match_a_compiler_line() { let output = &b" Compiling docker-command v0.1.0 (file:///Users/joegrund/projects/docker-command-rs) " [..]; assert_done(compiling(output), ()); } #[test] fn it_should_parse_finish_line() { let result = finished( &b" Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs "[..], ); assert_done(result, ()); } #[test] fn it_should_parse_suite_line() { let result = suite_line( &b"Running target/debug/deps/docker_command-be014e20fbd07382 "[..], ); assert_done(result, "target/debug/deps/docker_command-be014e20fbd07382"); } #[test] fn it_should_parse_suite_count() { let result = suite_count( &b"running 0 tests "[..], ); assert_done(result, ()); } #[test] fn it_should_match_ok() { assert_done(ok_or_failed(&b"ok"[..]), "pass"); } #[test] fn it_should_match_failed() { assert_done(ok_or_failed(&b"FAILED"[..]), "fail"); } #[test] fn it_should_parse_test_result() { let result = test_result(&b"test it_runs_a_command ... ok"[..]); assert_done( result, Test { name: "it_runs_a_command", status: "pass", error: None, }, ); } #[test] fn it_should_parse_test_results() { let result = test_results( &b"test tests::it_should_parse_first_line ... ok test tests::it_should_parse_a_status_line ... ok test tests::it_should_parse_test_output ... ok test tests::it_should_parse_suite_line ... FAILED " [..], ); assert_done( result, vec![ Test { name: "tests::it_should_parse_first_line", status: "pass", error: None }, Test { name: "tests::it_should_parse_a_status_line", status: "pass", error: None }, Test { name: "tests::it_should_parse_test_output", status: "pass", error: None }, Test { name: "tests::it_should_parse_suite_line", status: "fail", error: None } ], ); } #[test] fn it_should_capture_digits() { assert_done(digits(b"10"), 10); } #[test] fn it_should_parse_a_suite_result() { let result = suite_result( &b"test result: FAILED. 3 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out"[..], ); assert_done( result, SuiteResult { state: "fail", passed: 3, failed: 1, ignored: 0, total: 4, measured: 0, }, ); } #[test] fn it_should_parse_successful_test_output() { let output = &b" Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs Running target/debug/cargo_test_junit-83252957c74e106d running 2 tests test tests::it_should_match_failed ... ok test tests::it_should_parse_first_line ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out " [..]; let result = cargo_test_result_parser(output); assert_done( result, vec![Suite { name: "target/debug/cargo_test_junit-83252957c74e106d", state: "pass", tests: vec![ Test { name: "tests::it_should_match_failed", status: "pass", error: None }, Test { name: "tests::it_should_parse_first_line", status: "pass", error: None } ], passed: 2, failed: 0, ignored: 0, measured: 0, total: 2 }], ); } #[test] fn test_fail_line() { let output = b"---- fail stdout ----"; assert_done(fail_line(output), "fail"); } #[test] fn test_failure() { let output = b"---- fail stdout ---- thread 'fail' panicked at 'assertion failed: `(left == right)` (left: `1`, right: `2`)', tests/integration_test.rs:16 note: Run with `RUST_BACKTRACE=1` for a backtrace. "; assert_done( failure(output), Failure { name: "fail", error: "thread 'fail' panicked at 'assertion failed: `(left == right)` \ (left: `1`, right: `2`)', tests/integration_test.rs:16", }, ); } #[test] fn test_failures() { let output = b"---- fail stdout ---- thread 'fail' panicked at 'assertion failed: `(left == right)` (left: `1`, right: `2`)', tests/integration_test.rs:16 note: Run with `RUST_BACKTRACE=1` for a backtrace. ---- fail2 stdout ---- thread 'fail2' panicked at 'assertion failed: `(left == right)` (left: `3`, right: `2`)', tests/integration_test.rs:22 "; assert_done( failures(output), vec![ Failure { name: "fail", error: "thread 'fail' panicked at 'assertion failed: `(left == right)` (left: `1`, right: `2`)', tests/integration_test.rs:16" }, Failure { name: "fail2", error: "thread 'fail2' panicked at 'assertion failed: `(left == right)` (left: `3`, right: `2`)', tests/integration_test.rs:22" } ], ); } #[test] fn test_fail_run() { let output = b" Compiling blah v0.1.0 (file:blah) Finished debug [unoptimized + debuginfo] target(s) in 0.32 secs Running target/debug/deps/docker_command-be014e20fbd07382 running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Running target/debug/integration_test-d4fc68dd5824cbb9 running 3 tests test fail ... FAILED test fail2 ... FAILED test it_runs_a_command ... ok failures: ---- fail stdout ---- thread 'fail' panicked at 'assertion failed: `(left == right)` (left: `1`, right: `2`)', tests/integration_test.rs:16 note: Run with `RUST_BACKTRACE=1` for a backtrace. ---- fail2 stdout ---- thread 'fail2' panicked at 'assertion failed: `(left == right)` (left: `3`, right: `2`)', tests/integration_test.rs:22 failures: fail fail2 test result: FAILED. 1 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out error: test failed"; let x = match cargo_test_result_parser(output) { IResult::Done(_, x) => x, _ => panic!("BOOM!"), }; assert_eq!( x, vec![ Suite { name: "target/debug/deps/docker_command-be014e20fbd07382", state: "pass", passed: 0, failed: 0, ignored: 0, measured: 0, total: 0, tests: vec![] }, Suite { name: "target/debug/integration_test-d4fc68dd5824cbb9", state: "fail", passed: 1, failed: 2, ignored: 0, measured: 0, total: 3, tests: vec![ Test { name: "fail", status: "fail", error: Some("thread \'fail\' panicked at \'assertion failed: `(left == right)` (left: `1`, right: `2`)\', tests/integration_test.rs:16") }, Test { name: "fail2", status: "fail", error: Some("thread \'fail2\' panicked at \'assertion failed: `(left == right)` (left: `3`, right: `2`)\', tests/integration_test.rs:22") }, Test { name: "it_runs_a_command", status: "pass", error: None } ] } ] ); } #[test] fn test_success_run() { let output = b" Compiling rustc-serialize v0.3.22 Compiling toml v0.2.1 Compiling pre-commit v0.5.2 Compiling foo v0.1.0 (file:///foo) Finished debug [unoptimized + debuginfo] target(s) in 12.11 secs Running target/debug/deps/foo-5a7be5d1b9c8e0f6 running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Running target/debug/integration_test-283604d1063344ba running 1 test test it_runs_a_command ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Doc-tests foo running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out"; assert_done( cargo_test_result_parser(output), vec![ Suite { name: "target/debug/deps/foo-5a7be5d1b9c8e0f6", state: "pass", passed: 0, failed: 0, ignored: 0, measured: 0, total: 0, tests: vec![] }, Suite { name: "target/debug/integration_test-283604d1063344ba", state: "pass", passed: 1, failed: 0, ignored: 0, measured: 0, total: 1, tests: vec![ Test { name: "it_runs_a_command", status: "pass", error: None } ] }, Suite { name: "foo", state: "pass", passed: 0, failed: 0, ignored: 0, measured: 0, total: 0, tests: vec![] } ], ); } #[test] fn test_full_run() { let output = b" Updating registry `https://github.com/rust-lang/crates.io-index` Downloading nvpair-sys v0.1.0 Downloading bindgen v0.30.0 Downloading pkg-config v0.3.9 Downloading clap v2.27.1 Downloading which v1.0.3 Downloading cfg-if v0.1.2 Downloading lazy_static v0.2.10 Downloading clang-sys v0.19.0 Downloading log v0.3.8 Downloading env_logger v0.4.3 Downloading regex v0.2.2 Downloading syntex_syntax v0.58.1 Downloading aster v0.41.0 Downloading quasi v0.32.0 Downloading cexpr v0.2.2 Downloading peeking_take_while v0.1.2 Downloading textwrap v0.9.0 Downloading unicode-width v0.1.4 Downloading vec_map v0.8.0 Downloading strsim v0.6.0 Downloading atty v0.2.3 Downloading bitflags v0.9.1 Downloading ansi_term v0.9.0 Downloading libc v0.2.33 Downloading libloading v0.4.2 Downloading glob v0.2.11 Downloading aho-corasick v0.6.3 Downloading utf8-ranges v1.0.0 Downloading thread_local v0.3.4 Downloading memchr v1.0.2 Downloading regex-syntax v0.4.1 Downloading unreachable v1.0.0 Downloading void v1.0.2 Downloading bitflags v0.8.2 Downloading syntex_pos v0.58.1 Downloading rustc-serialize v0.3.24 Downloading unicode-xid v0.0.4 Downloading syntex_errors v0.58.1 Downloading term v0.4.6 Downloading nom v3.2.1 Downloading quasi_codegen v0.32.0 Downloading syntex v0.58.1 Compiling bitflags v0.9.1 Compiling unicode-xid v0.0.4 Compiling libc v0.2.33 Compiling void v1.0.2 Compiling ansi_term v0.9.0 Compiling libloading v0.4.2 Compiling utf8-ranges v1.0.0 Compiling log v0.3.8 Compiling lazy_static v0.2.10 Compiling term v0.4.6 Compiling unicode-width v0.1.4 Compiling nvpair-sys v0.1.0 Compiling pkg-config v0.3.9 Compiling glob v0.2.11 Compiling cfg-if v0.1.2 Compiling regex-syntax v0.4.1 Compiling peeking_take_while v0.1.2 Compiling bitflags v0.8.2 Compiling vec_map v0.8.0 Compiling strsim v0.6.0 Compiling rustc-serialize v0.3.24 Compiling which v1.0.3 Compiling atty v0.2.3 Compiling memchr v1.0.2 Compiling unreachable v1.0.0 Compiling textwrap v0.9.0 Compiling clang-sys v0.19.0 Compiling syntex_pos v0.58.1 Compiling nom v3.2.1 Compiling aho-corasick v0.6.3 Compiling thread_local v0.3.4 Compiling clap v2.27.1 Compiling syntex_errors v0.58.1 Compiling cexpr v0.2.2 Compiling regex v0.2.2 Compiling syntex_syntax v0.58.1 Compiling env_logger v0.4.3 Compiling quasi v0.32.0 Compiling syntex v0.58.1 Compiling aster v0.41.0 Compiling quasi_codegen v0.32.0 Compiling bindgen v0.30.0 Compiling libzfs-sys v0.1.0 (file:///vagrant/libzfs-sys) Finished dev [unoptimized + debuginfo] target(s) in 862.1 secs Running target/debug/deps/libzfs_sys-a797c24cd4b4a7ea running 3 tests test bindgen_test_layout_zpool_handle ... ok test tests::open_close_handle ... ok test tests::pool_search_import_list_export ... ok test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Doc-tests libzfs-sys running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out "; assert_done( cargo_test_result_parser(output), vec![ Suite { name: "target/debug/deps/libzfs_sys-a797c24cd4b4a7ea", state: "pass", passed: 3, failed: 0, ignored: 0, measured: 0, total: 3, tests: vec![ Test { name: "bindgen_test_layout_zpool_handle", status: "pass", error: None }, Test { name: "tests::open_close_handle", status: "pass", error: None }, Test { name: "tests::pool_search_import_list_export", status: "pass", error: None } ] }, Suite { name: "libzfs-sys", state: "pass", passed: 0, failed: 0, ignored: 0, measured: 0, total: 0, tests: vec![] } ], ); } #[test] pub fn compile_fail() { let output = b" Updating registry `https://github.com/rust-lang/crates.io-index` Downloading cargo-test-junit v0.6.2 Installing cargo-test-junit v0.6.2 Downloading test-to-vec v0.4.2 Downloading nom v2.2.1 Downloading clap v2.28.0 Downloading sxd-document v0.2.4 Downloading duct v0.4.0 Downloading textwrap v0.9.0 Downloading bitflags v1.0.1 Downloading vec_map v0.8.0 Downloading unicode-width v0.1.4 Downloading strsim v0.6.0 Downloading atty v0.2.3 Downloading ansi_term v0.10.2 Downloading peresil v0.3.0 Downloading typed-arena v1.3.0 Downloading libc v0.2.34 Downloading crossbeam v0.3.0 Compiling nom v2.2.1 Compiling libc v0.2.34 Compiling crossbeam v0.3.0 Compiling unicode-width v0.1.4 Compiling strsim v0.6.0 Compiling bitflags v1.0.1 Compiling vec_map v0.8.0 Compiling peresil v0.3.0 Compiling typed-arena v1.3.0 Compiling ansi_term v0.10.2 Compiling test-to-vec v0.4.2 Compiling atty v0.2.3 Compiling duct v0.4.0 Compiling textwrap v0.9.0 Compiling sxd-document v0.2.4 Compiling clap v2.28.0 Compiling cargo-test-junit v0.6.2 Finished release [optimized] target(s) in 114.51 secs Installing /root/.cargo/bin/cargo-test-junit Updating git repository `https://github.com/jgrund/rust-libzfs.git` Downloading pkg-config v0.3.9 Downloading bindgen v0.30.0 Downloading env_logger v0.4.3 Downloading peeking_take_while v0.1.2 Downloading quasi v0.32.0 Downloading cfg-if v0.1.2 Downloading clap v2.27.1 Downloading aster v0.41.0 Downloading syntex_syntax v0.58.1 Downloading regex v0.2.2 Downloading lazy_static v0.2.11 Downloading which v1.0.3 Downloading clang-sys v0.19.0 Downloading cexpr v0.2.2 Downloading log v0.3.8 Downloading memchr v1.0.2 Downloading utf8-ranges v1.0.0 Downloading thread_local v0.3.4 Downloading aho-corasick v0.6.3 Downloading regex-syntax v0.4.1 Downloading libc v0.2.33 Downloading unreachable v1.0.0 Downloading void v1.0.2 Downloading syntex_errors v0.58.1 Downloading rustc-serialize v0.3.24 Downloading bitflags v0.8.2 Downloading syntex_pos v0.58.1 Downloading unicode-xid v0.0.4 Downloading term v0.4.6 Downloading ansi_term v0.9.0 Downloading bitflags v0.9.1 Downloading libloading v0.4.2 Downloading glob v0.2.11 Downloading nom v3.2.1 Downloading quasi_codegen v0.32.0 Downloading syntex v0.58.1 Downloading cstr-argument v0.0.2 Compiling strsim v0.6.0 Compiling unicode-xid v0.0.4 Compiling glob v0.2.11 Compiling log v0.3.8 Compiling nvpair-sys v0.1.0 (https://github.com/jgrund/rust-libzfs.git?rev=get-values#470f3014) Compiling rustc-serialize v0.3.24 Compiling vec_map v0.8.0 Compiling cfg-if v0.1.2 Compiling unicode-width v0.1.4 Compiling libloading v0.4.2 Compiling pkg-config v0.3.9 Compiling lazy_static v0.2.11 Compiling ansi_term v0.9.0 Compiling peeking_take_while v0.1.2 Compiling libc v0.2.33 Compiling utf8-ranges v1.0.0 Compiling term v0.4.6 Compiling bitflags v0.8.2 Compiling bitflags v0.9.1 Compiling regex-syntax v0.4.1 Compiling void v1.0.2 Compiling clang-sys v0.19.0 Compiling syntex_pos v0.58.1 Compiling textwrap v0.9.0 Compiling memchr v1.0.2 Compiling atty v0.2.3 Compiling which v1.0.3 Compiling unreachable v1.0.0 Compiling syntex_errors v0.58.1 Compiling nom v3.2.1 Compiling cstr-argument v0.0.2 Compiling aho-corasick v0.6.3 Compiling clap v2.27.1 Compiling thread_local v0.3.4 Compiling syntex_syntax v0.58.1 Compiling cexpr v0.2.2 Compiling nvpair v0.2.0 (https://github.com/jgrund/rust-libzfs.git?rev=get-values#470f3014) Compiling regex v0.2.2 Compiling aster v0.41.0 Compiling syntex v0.58.1 Compiling quasi v0.32.0 Compiling env_logger v0.4.3 Compiling quasi_codegen v0.32.0 Compiling bindgen v0.30.0 Compiling libzfs-sys v0.1.0 (file:///vagrant/libzfs-sys) Compiling libzfs v0.1.0 (file:///vagrant/libzfs) error[E0369]: binary operation `==` cannot be applied to type `std::result::Result<nvpair::NvData, std::io::Error>` --> libzfs/src/lib.rs:134:9 | 134 | assert_eq!(state, Ok(nvpair::NvData::Uint64(sys::pool_state::POOL_STATE_EXPORTED as u64))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `std::result::Result<nvpair::NvData, std::io::Error>` = note: this error originates in a macro outside of the current crate error: aborting due to previous error error: Could not compile `libzfs`. To learn more, run the command again with --verbose. "; assert_done( cargo_test_result_parser(output), vec![ Suite { name: "unknown", state: "fail", passed: 0, failed: 1, ignored: 0, measured: 0, total: 1, tests: vec![ Test { name: "compile failed", status: "fail", error: Some("binary operation `==` cannot be applied to type `std::result::Result<nvpair::NvData, std::io::Error>` --> libzfs/src/lib.rs:134:9 | 134 | assert_eq!(state, Ok(nvpair::NvData::Uint64(sys::pool_state::POOL_STATE_EXPORTED as u64))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `std::result::Result<nvpair::NvData, std::io::Error>` = note: this error originates in a macro outside of the current crate error: aborting due to previous error error: Could not compile `libzfs`. To learn more, run the command again with --verbose. ") }, ] } ], ); } }