GitLab will be upgraded to the 12.10.14-ce.0 on 28 Sept 2020 at 2.00pm (AEDT) to 2.30pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

lib.rs 1.48 KB
Newer Older
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
1
// Copyright 2017 The Australian National University
qinsoon's avatar
qinsoon committed
2
//
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
3 4 5
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
qinsoon's avatar
qinsoon committed
6
//
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
7
//     http://www.apache.org/licenses/LICENSE-2.0
qinsoon's avatar
qinsoon committed
8
//
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
9 10 11 12 13 14
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

15
//#![feature(i128_type)]
16

17
extern crate mu;
18
extern crate mu_utils as utils;
19
#[macro_use]
20
extern crate log;
qinsoon's avatar
qinsoon committed
21
extern crate maplit;
22

23 24 25
#[macro_use]
mod ir_macros;

26
mod test_ir;
qinsoon's avatar
qinsoon committed
27
mod test_compiler;
28
mod test_runtime;
29
mod test_api;
qinsoon's avatar
qinsoon committed
30

qinsoon's avatar
qinsoon committed
31 32
mod common {
    use std::fmt;
33 34

    #[allow(dead_code)]
qinsoon's avatar
qinsoon committed
35
    pub fn assert_vector_ordered<T: fmt::Debug>(left: &Vec<T>, right: &Vec<T>) {
qinsoon's avatar
qinsoon committed
36 37
        assert_debug_str(left, right);
    }
38 39

    #[allow(dead_code)]
qinsoon's avatar
qinsoon committed
40
    pub fn assert_vector_no_order<T: Ord + fmt::Debug + Clone>(left: &Vec<T>, right: &Vec<T>) {
41 42 43 44
        let mut left_clone = left.clone();
        left_clone.sort();
        let mut right_clone = right.clone();
        right_clone.sort();
qinsoon's avatar
qinsoon committed
45

46 47
        assert_debug_str(left_clone, right_clone);
    }
48 49

    #[allow(dead_code)]
qinsoon's avatar
qinsoon committed
50
    pub fn assert_debug_str<T: fmt::Debug, U: fmt::Debug>(left: T, right: U) {
qinsoon's avatar
qinsoon committed
51
        assert_eq!(format!("{:?}", left), format!("{:?}", right))
qinsoon's avatar
qinsoon committed
52
    }
53
}