wwtest: native package-test coordinator
Single-directory package-test planner: discovers *.ww, groups white-box and external <pkg>_test sources, composes the combined test package, builds it through the sibling ww driver, and runs it with the runtime's -package/-list/-timeout-ms contract. test/package holds its E2E corpus and the manual runtime fixture set.
This commit is contained in:
4
test/package/dependency/dep/contest.ww
Normal file
4
test/package/dependency/dep/contest.ww
Normal file
@@ -0,0 +1,4 @@
|
||||
package dep;
|
||||
|
||||
// A production filename ending in "test.ww" is not a test by itself.
|
||||
export fn bonus() int = { return 2; };
|
||||
3
test/package/dependency/dep/dep.ww
Normal file
3
test/package/dependency/dep/dep.ww
Normal file
@@ -0,0 +1,3 @@
|
||||
package dep;
|
||||
|
||||
export fn value() int = { return 40; };
|
||||
7
test/package/dependency/dep/deptest.ww
Normal file
7
test/package/dependency/dep/deptest.ww
Normal file
@@ -0,0 +1,7 @@
|
||||
package dep;
|
||||
|
||||
// Noncanonical migration spelling: the actual line-leading @test makes this
|
||||
// test-only. It must be excluded when dep is imported by the root package.
|
||||
@test fn imported_dependency_test_must_not_leak() void = {
|
||||
assert(false);
|
||||
};
|
||||
5
test/package/dependency/root/root.ww
Normal file
5
test/package/dependency/root/root.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
package root;
|
||||
|
||||
import dep;
|
||||
|
||||
fn answer() int = { return dep.value() + dep.bonus(); };
|
||||
5
test/package/dependency/root/root_test.ww
Normal file
5
test/package/dependency/root/root_test.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
package root;
|
||||
|
||||
@test fn imported_production_only() void = {
|
||||
assert(answer() == 42);
|
||||
};
|
||||
Reference in New Issue
Block a user