-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
111 additions
and
157 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#include <linux/kernel.h> | ||
#include <linux/init.h> | ||
#include <linux/module.h> | ||
#include <linux/interrupt.h> | ||
#include <linux/fs.h> | ||
#include <linux/uaccess.h> | ||
#include <linux/sched.h> | ||
#include <linux/slab.h> | ||
#include <linux/device.h> | ||
#include <linux/miscdevice.h> | ||
#include <linux/bug.h> | ||
|
||
#include <embUnit/embUnit.h> | ||
|
||
/*embunit:include=+ */ | ||
#include "timerunit.h" | ||
/*embunit:include=- */ | ||
|
||
static void setUp(void) | ||
{ | ||
/* initialize */ | ||
} | ||
|
||
static void tearDown(void) | ||
{ | ||
/* terminate */ | ||
} | ||
|
||
/*embunit:impl=+ */ | ||
static void testJiffies(void) | ||
{ | ||
timerunit_cb(); | ||
} | ||
|
||
static void testTimeStamp(void) | ||
{ | ||
int distinguished_condition = 1; | ||
BUG_ON(distinguished_condition); | ||
|
||
TEST_FAIL("no implementation"); | ||
} | ||
|
||
static void testDelay(void) | ||
{ | ||
int fatal_condition = 0; | ||
if (fatal_condition) | ||
{ | ||
panic("I'm giving up because task %d\n", current->pid); | ||
} | ||
TEST_FAIL("no implementation"); | ||
} | ||
|
||
static void testDynamicTimers(void) | ||
{ | ||
TEST_FAIL("no implementation"); | ||
} | ||
|
||
static void testHighResTimers(void) | ||
{ | ||
TEST_FAIL("no implementation"); | ||
} | ||
|
||
/*embunit:impl=- */ | ||
TestRef TimerTest_tests(void) | ||
{ | ||
EMB_UNIT_TESTFIXTURES(fixtures) { | ||
/*embunit:fixtures=+ */ | ||
new_TestFixture("testJiffies",testJiffies), | ||
new_TestFixture("testTimeStamp",testTimeStamp), | ||
new_TestFixture("testDelay",testDelay), | ||
new_TestFixture("testDynamicTimers",testDynamicTimers), | ||
new_TestFixture("testHighResTimers",testHighResTimers), | ||
/*embunit:fixtures=- */ | ||
}; | ||
EMB_UNIT_TESTCALLER(timerTest,"timerTest",setUp,tearDown,fixtures); | ||
return (TestRef)&timerTest; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
#include <linux/module.h> | ||
#include <linux/init.h> | ||
|
||
static int __init timerunit_init(void) | ||
{ | ||
printk(KERN_INFO "Hello world from timerunit_ \n"); | ||
return 0; | ||
} | ||
|
||
static void __exit timerunit_exit(void) | ||
{ | ||
printk(KERN_INFO "Goodbye world from timerunit_ \n"); | ||
} | ||
|
||
static void timerunit_cb(void) | ||
{ | ||
printk(KERN_INFO " VOILA! I got into mod1fun \n"); | ||
} | ||
|
||
EXPORT_SYMBOL(timerunit_cb); | ||
|
||
module_init(timerunit_init); | ||
module_exit(timerunit_exit); | ||
|
||
MODULE_AUTHOR("VKI"); | ||
MODULE_DESCRIPTION("Timer unit callback module"); | ||
MODULE_LICENSE("GPL v2"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef _TIMERUNIT_H_ | ||
#define _TIMERUNIT_H_ | ||
|
||
void timerunit_cb(void); | ||
|
||
#endif /* _TIMERUNIT_H_ */ |