-
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.
Update parsing function and add C-headers unzip task
Extended the parseFile function in the klang project's LibClangParser to support filePath and headerPaths parameters. Also added a new unzipCHeaders task for unzipping C header files in build.gradle.kts. Additionally, created a new integration test to verify SDL2 parsing, and expanded the .gitignore to include these new directories.
- Loading branch information
Alexandre Mommers
committed
Jan 6, 2024
1 parent
722151f
commit 6353e4a
Showing
6 changed files
with
72 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,4 @@ bin/ | |
|
||
## use to integration ## | ||
/src/test/c/SDL2/ | ||
/src/test/c/c/ |
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
Binary file not shown.
26 changes: 26 additions & 0 deletions
26
klang/klang/src/test/kotlin/klang/parser/libclang/SDL2ItTest.kt
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,26 @@ | ||
package klang.parser.libclang | ||
|
||
import klang.parser.INTEGRATION_ENABLED | ||
import klang.parser.ParserTestCommon | ||
|
||
|
||
class SDL2ItTest : ParserTestCommon({ | ||
|
||
"test SDL2 parsing".config(enabled = INTEGRATION_ENABLED || true) { | ||
|
||
// Given | ||
val filePath = "src/test/c/" | ||
val fileToParse = "SDL2/SDL.h" | ||
val headerPaths = arrayOf("src/test/c/c/include") | ||
|
||
// When | ||
val repository = parseFile(fileToParse, filePath, headerPaths) | ||
|
||
// Then | ||
repository.apply { | ||
println(declarations.size) | ||
} | ||
|
||
|
||
} | ||
}) |