Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix: Re-enable panicking tests #236

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions hacking/nix/scope/world/instances/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ in rec {
tests.root-task.config
tests.root-task.tls
tests.root-task.backtrace
# tests.root-task.panicking
tests.root-task.panicking
tests.root-task.c
tests.root-task.verus
tests.root-task.dafny
Expand Down Expand Up @@ -192,19 +192,21 @@ in rec {
(_: allocFeatures:
lib.flip lib.mapAttrs profile
(_: release:
maybe (haveFullRuntime && haveUnwindingSupport) (mkInstance {
rootTask = mkTask {
rootCrate = crates.tests-root-task-panicking;
inherit release;
features = allocFeatures ++ [ "panic-${panicStrategyName}" ];
extraProfile = {
panic = panicStrategyName;
let
isUnwind = panicStrategyName == "unwind";
in
maybe (haveFullRuntime && haveUnwindingSupport) (mkInstance {
rootTask = mkTask {
rootCrate = crates.tests-root-task-panicking;
targetTriple = mkSeL4RustTargetTriple { unwind = isUnwind; };
inherit release;
features = allocFeatures ++ [ "panic-${panicStrategyName}" ];
};
};
extraPlatformArgs = lib.optionalAttrs canSimulate {
canAutomateSimply = panicStrategyName == "unwind";
};
}))));
extraPlatformArgs = lib.optionalAttrs canSimulate {
canAutomateSimply = isUnwind;
};
})
)));

paths = lib.mapCartesianProduct
({ panicStrategyName, allocName, profileName }: [ panicStrategyName allocName profileName ])
Expand All @@ -224,9 +226,11 @@ in rec {
value = config.automate;
}));

simulate = writeText "all-panicking-scripts" (toString (lib.forEach paths (path:
(lib.attrByPath path (throw "x") byConfig).simulate
)));
simulate = writeText "all-panicking-scripts" (toString (lib.forEach
(lib.filter
(config: config != null)
(lib.forEach paths (path: lib.attrByPath path (throw "x") byConfig)))
(config: config.simulate)));

links = linkFarm "links" {
inherit simulate;
Expand Down
Loading