Changeset 319e60e in mainline for kernel/test


Ignore:
Timestamp:
2006-12-11T18:33:53Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
50661ab
Parents:
134877d
Message:

prepare for new test infrastructure

Location:
kernel/test
Files:
1 added
1 edited
2 moved

Legend:

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

    r134877d r319e60e  
    3232#include <debug.h>
    3333
    34 void test(void)
     34#ifdef CONFIG_BENCH
     35#include <arch/cycle.h>
     36#endif
     37
     38void test_atomic1(void)
    3539{
     40#ifdef CONFIG_BENCH
     41        uint64_t t0 = get_cycle();
     42#endif
    3643        atomic_t a;
    3744
     
    5259        ASSERT(atomic_get(&a) == 10);
    5360
    54         printf("Test passed.\n");       
     61        printf("Test passed.\n");
     62#ifdef CONFIG_BENCH
     63        uint64_t dt = get_cycle() - t0;
     64        printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt);
     65#endif
    5566        return;
    5667}
  • kernel/test/mm/slab2/test.c

    r134877d r319e60e  
    3838#include <synch/mutex.h>
    3939
     40#ifdef CONFIG_BENCH
     41#include <arch/cycle.h>
     42#endif
     43
    4044#define ITEM_SIZE 256
    4145
     
    209213void test(void)
    210214{
     215#ifdef CONFIG_BENCH
     216        uint64_t t0 = get_cycle();
     217#endif
     218
    211219        printf("Running reclaim single-thread test .. pass1\n");
    212220        totalmemtest();
     
    219227        multitest(8192);
    220228        printf("All done.\n");
    221 }
     229
     230#ifdef CONFIG_BENCH
     231        uint64_t dt = get_cycle() - t0;
     232        printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt);
     233#endif
     234}
  • kernel/test/test.h

    r134877d r319e60e  
    11/*
    2  * Copyright (C) 2001-2004 Jakub Jermar
     2 * Copyright (C) 2006 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup generic
     29/** @addtogroup test
    3030 * @{
    3131 */
     
    3636#define KERN_TEST_H_
    3737
    38 extern void test(void);
     38#include <arch/types.h>
     39#include <typedefs.h>
     40
     41typedef struct {
     42        char * name;
     43        char * desc;
     44        function entry;
     45} test_t;
     46
     47extern void test_atomic1(void);
     48
     49extern test_t tests[];
    3950
    4051#endif
Note: See TracChangeset for help on using the changeset viewer.