Changeset 50661ab in mainline for kernel/test


Ignore:
Timestamp:
2006-12-11T19:00:04Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f272cb8
Parents:
319e60e
Message:

integrate more tests

Location:
kernel/test
Files:
3 edited
4 moved

Legend:

Unmodified
Added
Removed
  • kernel/test/atomic/atomic1.c

    r319e60e r50661ab  
    6464        printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt);
    6565#endif
    66         return;
    6766}
  • kernel/test/btree/btree1.c

    r319e60e r50661ab  
    3232#include <debug.h>
    3333
     34#ifdef CONFIG_BENCH
     35#include <arch/cycle.h>
     36#endif
     37
    3438void *data = (void *) 0xdeadbeef;
    3539
    36 void test(void)
     40void test_btree1(void)
    3741{
     42#ifdef CONFIG_BENCH
     43        uint64_t t0 = get_cycle();
     44#endif
    3845        btree_t t;
    3946        int i;
     
    157164
    158165        btree_print(&t);
     166#ifdef CONFIG_BENCH
     167        uint64_t dt = get_cycle() - t0;
     168        printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt);
     169#endif
    159170}
  • kernel/test/debug/mips1.c

    r319e60e r50661ab  
    3939
    4040
    41 void test(void)
     41void test_mips1(void)
    4242{
     43#ifdef mips32
    4344        printf("MIPS debug test #1\n");
    4445
     
    4849
    4950        printf("Test passed.\n");
     51#else
     52        printf("This test is availaible only on MIPS32 platform.\n");
     53#endif
    5054}
  • kernel/test/fault/fault1.c

    r319e60e r50661ab  
    3939
    4040
    41 void test(void)
     41void test_fault1(void)
    4242{
    4343
  • kernel/test/fpu/fpu1.c

    r319e60e r50661ab  
    3939#include <arch/arch.h>
    4040
     41#ifdef CONFIG_BENCH
     42#include <arch/cycle.h>
     43#endif
     44
     45#if (defined(ia32) || defined(amd64) || defined(ia64) || defined(ia32xen))
     46
    4147#define THREADS         150*2
    4248#define ATTEMPTS        100
     
    149155}
    150156
    151 void test(void)
    152 {
     157void test_fpu1(void)
     158{
     159#ifdef CONFIG_BENCH
     160        uint64_t t0 = get_cycle();
     161#endif
    153162        thread_t *t;
    154163        int i;
     
    176185               
    177186        printf("Test passed.\n");
    178 }
     187#ifdef CONFIG_BENCH
     188        uint64_t dt = get_cycle() - t0;
     189        printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt);
     190#endif
     191}
     192
     193#else
     194
     195void test_fpu1(void)
     196{
     197        printf("This test is available only on Intel/AMD platforms.");
     198}
     199
     200#endif
  • kernel/test/test.c

    r319e60e r50661ab  
    3939                "atomic1",
    4040                "Test atomic operations",
    41                 &test_atomic1
     41                &test_atomic1,
     42                true
     43        },
     44        {
     45                "btree1",
     46                "Test B-tree operations",
     47                &test_btree1,
     48                true
     49        },
     50        {
     51                "mips1",
     52                "MIPS debug test",
     53                &test_mips1,
     54                true
     55        },
     56        {
     57                "fault1",
     58                "Write to NULL (maybe page fault)",
     59                &test_fault1,
     60                false
     61        },
     62        {
     63                "fpu1",
     64                "Intel FPU test",
     65                &test_fpu1,
     66                true
    4267        },
    4368        {NULL, NULL, NULL}
  • kernel/test/test.h

    r319e60e r50661ab  
    4343        char * desc;
    4444        function entry;
     45        bool safe;
    4546} test_t;
    4647
    4748extern void test_atomic1(void);
     49extern void test_btree1(void);
     50extern void test_mips1(void);
     51extern void test_fault1(void);
     52extern void test_fpu1(void);
    4853
    4954extern test_t tests[];
Note: See TracChangeset for help on using the changeset viewer.