-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: interpret import statements (#159)
- Loading branch information
Showing
12 changed files
with
223 additions
and
19 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
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,33 @@ | ||
#include "gtest/gtest.h" | ||
#include "ecsact/interpret/eval.h" | ||
#include "ecsact/runtime/meta.hh" | ||
|
||
#include "test/test_lib.hh" | ||
|
||
TEST(MultiPkgTest, NoErrors) { | ||
auto errs = ecsact_interpret_test_files({ | ||
"multi_pkg_main.ecsact", | ||
"multi_pkg_a.ecsact", | ||
"multi_pkg_b.ecsact", | ||
"multi_pkg_c.ecsact", | ||
}); | ||
EXPECT_EQ(errs.size(), 0) // | ||
<< "Expected no errors. Instead got: " << errs[0].error_message << "\n"; | ||
|
||
EXPECT_EQ(ecsact_meta_count_packages(), 4); | ||
|
||
auto pkg_ids = ecsact::meta::get_package_ids(); | ||
for(auto pkg_id : pkg_ids) { | ||
auto pkg_name = ecsact::meta::package_name(pkg_id); | ||
|
||
if(pkg_name == "multi.pkg") { | ||
EXPECT_EQ(ecsact_meta_count_dependencies(pkg_id), 3) // | ||
<< "Expected main package to have 3 dependencies. One for each import"; | ||
} else if(pkg_name == "multi.pkg.a") { | ||
} else if(pkg_name == "multi.pkg.b") { | ||
} else if(pkg_name == "multi.pkg.c") { | ||
} else { | ||
EXPECT_TRUE(false) << "No tests for package: " << pkg_name; | ||
} | ||
} | ||
} |
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,4 @@ | ||
package multi.pkg.a; | ||
|
||
component FromA; | ||
|
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 @@ | ||
package multi.pkg.b; | ||
|
||
component FromB; |
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,4 @@ | ||
package multi.pkg.c; | ||
|
||
component FromC; | ||
|
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,15 @@ | ||
main package multi.pkg; | ||
|
||
import multi.pkg.a; | ||
import multi.pkg.b; | ||
import multi.pkg.c; | ||
|
||
component FromMain; | ||
|
||
system FullyQualifiedFromMain { | ||
include multi.pkg.FromMain; | ||
include multi.pkg.a.FromA; | ||
include multi.pkg.b.FromB; | ||
include multi.pkg.c.FromC; | ||
} | ||
|