-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: add a test kernel extension to mockpkg
- Loading branch information
Showing
11 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
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,3 @@ | ||
/Makefile | ||
/bin | ||
/gen |
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 @@ | ||
../../etc/Makefile.gappkg |
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,9 @@ | ||
# | ||
# Makefile rules for the mockpkg package | ||
# | ||
KEXT_NAME = mockpkg | ||
KEXT_SOURCES = src/mockpkg.c | ||
|
||
# include shared GAP package build system | ||
GAPPATH = @GAPPATH@ | ||
include Makefile.gappkg |
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
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,34 @@ | ||
#!/bin/sh | ||
# usage: configure gappath | ||
# this script creates a `Makefile' from `Makefile.in' | ||
|
||
set -e | ||
|
||
GAPPATH=../.. | ||
while test "$#" -ge 1 ; do | ||
option="$1" ; shift | ||
case "$option" in | ||
--with-gaproot=*) GAPPATH=${option#--with-gaproot=}; ;; | ||
-*) echo "ERROR: unsupported argument $option" ; exit 1;; | ||
*) GAPPATH="$option" ;; | ||
esac | ||
done | ||
|
||
if test ! -r "$GAPPATH/sysinfo.gap" ; then | ||
echo | ||
echo "No file $GAPPATH/sysinfo.gap found." | ||
echo | ||
echo "Usage: ./configure [GAPPATH]" | ||
echo " where GAPPATH is a path to your GAP installation" | ||
echo " (The default for GAPPATH is \"../..\")" | ||
echo | ||
echo "Either your GAPPATH is incorrect or the GAP it is pointing to" | ||
echo "is not properly compiled (do \"./configure && make\" there first)." | ||
echo | ||
echo "Aborting... No Makefile is generated." | ||
echo | ||
exit 1 | ||
fi | ||
|
||
echo "Using settings from $GAPPATH/sysinfo.gap" | ||
sed -e "s;@GAPPATH@;$GAPPATH;g" Makefile.in > Makefile |
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
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,48 @@ | ||
#include <gap_all.h> // GAP headers | ||
|
||
Obj FuncTestCommand(Obj self) | ||
{ | ||
return True; | ||
} | ||
|
||
// Table of functions to export | ||
static StructGVarFunc GVarFuncs[] = { | ||
GVAR_FUNC(TestCommand, 0, ""), | ||
{ 0 } | ||
}; | ||
|
||
/**************************************************************************** | ||
** | ||
*F InitKernel( <module> ) . . . . . . . . initialise kernel data structures | ||
*/ | ||
static Int InitKernel(StructInitInfo * module) | ||
{ | ||
InitHdlrFuncsFromTable(GVarFuncs); | ||
return 0; | ||
} | ||
|
||
/**************************************************************************** | ||
** | ||
*F InitLibrary( <module> ) . . . . . . . initialise library data structures | ||
*/ | ||
static Int InitLibrary(StructInitInfo * module) | ||
{ | ||
InitGVarFuncsFromTable(GVarFuncs); | ||
return 0; | ||
} | ||
|
||
/**************************************************************************** | ||
** | ||
*F Init__Dynamic() . . . . . . . . . . . . . . . . . table of init functions | ||
*/ | ||
static StructInitInfo module = { | ||
.type = MODULE_DYNAMIC, | ||
.name = "mockpkg", | ||
.initKernel = InitKernel, | ||
.initLibrary = InitLibrary, | ||
}; | ||
|
||
StructInitInfo * Init__Dynamic(void) | ||
{ | ||
return &module; | ||
} |
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,11 @@ | ||
# | ||
# Try to load its kernel extension | ||
# | ||
gap> LoadPackage("mockpkg"); | ||
true | ||
gap> IsKernelExtensionAvailable("mockpkg"); | ||
true | ||
gap> LoadKernelExtension("mockpkg"); | ||
true | ||
gap> TestCommand(); | ||
true |