test_to_vec/
lib.rs

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