00001 /* 00002 * Scale Stack 00003 * 00004 * Copyright 2010 Eric Day 00005 * 00006 * Licensed under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 00024 #include "config.h" 00025 00026 #include <scalestack/kernel/test.h> 00027 00028 class test_suite: public scalestack::kernel::test_suite<test_suite> 00029 { 00030 public: 00031 00032 void setup(void) 00033 { 00034 add_default_threading_service(); 00035 core->add_module_option_value("event::service", "", "event::libevent"); 00036 core->get_or_add_module("event::test"); 00037 } 00038 00039 void test_default(void) 00040 { 00041 core->run(); 00042 } 00043 00044 void test_multiple_threads(void) 00045 { 00046 core->add_module_option_value("event::libevent", "threads", "4"); 00047 core->run(); 00048 } 00049 00050 test_suite(int argc, const char** argv): 00051 scalestack::kernel::test_suite<test_suite>(argc, argv) 00052 { 00053 test_case(test_suite::test_default); 00054 test_case(test_suite::test_multiple_threads); 00055 } 00056 }; 00057 00058 int main(int argc, const char* argv[]) 00059 { 00060 test_suite test_suite(argc - 1, argv + 1); 00061 test_suite.run(); 00062 return 0; 00063 }
1.6.3