-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from jeromekelleher/meson-subproject
Meson subproject
- Loading branch information
Showing
12 changed files
with
132 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "c/kastore"] | ||
path = c/kastore | ||
path = c/subprojects/full-projects/kastore | ||
url = https://github.com/tskit-dev/kastore.git |
Submodule kastore
deleted from
fb5933
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 @@ | ||
full-projects/kastore/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* Simple example testing that we compile and link in tskit and kastore | ||
* when we use meson submodules. | ||
*/ | ||
#include <stdio.h> | ||
#include <tskit.h> | ||
#include <assert.h> | ||
#include <string.h> | ||
|
||
void | ||
test_kas_strerror() | ||
{ | ||
printf("test_kas_strerror\n"); | ||
const char *str = kas_strerror(KAS_ERR_NO_MEMORY); | ||
assert(strcmp(str, "Out of memory") == 0); | ||
} | ||
|
||
void | ||
test_strerror() | ||
{ | ||
printf("test_strerror\n"); | ||
const char *str = tsk_strerror(TSK_ERR_NO_MEMORY); | ||
assert(strcmp(str, "Out of memory") == 0); | ||
} | ||
|
||
void | ||
test_load_error() | ||
{ | ||
printf("test_open_error\n"); | ||
tsk_treeseq_t ts; | ||
int ret = tsk_treeseq_load(&ts, "no such file", 0); | ||
assert(tsk_is_kas_error(ret)); | ||
tsk_treeseq_free(&ts); | ||
} | ||
|
||
void | ||
test_table_basics() | ||
{ | ||
printf("test_table_basics\n"); | ||
tsk_table_collection_t tables; | ||
int ret = tsk_table_collection_init(&tables, 0); | ||
assert(ret == 0); | ||
|
||
ret = tsk_node_table_add_row(&tables.nodes, 0, 1.0, TSK_NULL, TSK_NULL, NULL, 0); | ||
assert(ret == 0); | ||
ret = tsk_node_table_add_row(&tables.nodes, 0, 2.0, TSK_NULL, TSK_NULL, NULL, 0); | ||
assert(ret == 1); | ||
assert(tables.nodes.num_rows == 2); | ||
|
||
tsk_table_collection_free(&tables); | ||
} | ||
|
||
int main() | ||
{ | ||
test_kas_strerror(); | ||
test_strerror(); | ||
test_load_error(); | ||
test_table_basics(); | ||
return 0; | ||
} |
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,12 @@ | ||
project('example', 'c') | ||
|
||
kastore_proj = subproject('kastore') | ||
kastore_dep = kastore_proj.get_variable('kastore_dep') | ||
tskit_proj = subproject('tskit') | ||
tskit_dep = tskit_proj.get_variable('tskit_dep') | ||
|
||
executable('example', | ||
'example.c', | ||
dependencies : [kastore_dep, tskit_dep], | ||
install : true) | ||
|
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 @@ | ||
../../../subprojects/full-projects/kastore/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ |
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