Exemple #1
0
        //===========================================================
        //		初期化
        //===========================================================
        public TestMethod(Ref::MethodInfo minfo)
        {
            CM::DescriptionAttribute[] attrs
                = (CM::DescriptionAttribute[])minfo.GetCustomAttributes(typeof(CM::DescriptionAttribute), false);
            string desc = attrs.Length == 0?"":attrs[0].Description;

            this.info        = minfo;
            this.description = desc;
        }
Exemple #2
0
        //===========================================================
        //		初期化
        //===========================================================
        public static BenchMethodAttribute GetAttribute(Ref::MethodInfo minfo, afh.Application.Log log)
        {
            object[] attrs = minfo.GetCustomAttributes(typeof(BenchMethodAttribute), false);
            if (attrs.Length == 0)
            {
                return(null);
            }

            BenchMethodAttribute attr = (BenchMethodAttribute)attrs[0];

            if (!minfo.IsStatic)
            {
                log.WriteLine("メソッド '{0}' は static でない為 Benchmark を実行出来ません。", minfo);
                return(null);
            }
            if (minfo.GetParameters().Length != 0)
            {
                log.WriteLine("メソッド '{0}' の呼び出しには引数が必要なので Benchmark を実行出来ません。", minfo);
                return(null);
            }
            return(attr);
        }