Skip to content

Commit

Permalink
decouple: benchmark.run
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Nov 12, 2024
1 parent 96cdd7c commit 6cf02b5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions imgBuilder/linux/initramfs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
base = callPackage ./base {};
initramfs_overlays = callPackage ./overlays {
inherit riscv64-cc riscv64-libc-static riscv64-busybox;
# TODO: check if `run` doest not exist, throw an error
benchmark-run = benchmark.run;
};
in runCommand "${benchmark.name}.cpio" {} ''
cp ${base}/init.cpio $out
Expand Down
4 changes: 2 additions & 2 deletions imgBuilder/linux/initramfs/overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
, riscv64-cc
, riscv64-libc-static
, riscv64-busybox
, benchmark-run
}:
let
name = "initramfs-overlays";
Expand All @@ -20,8 +21,7 @@ let
run_sh = writeText "run.sh" ''
before_workload
echo start
cd /run
sh ./run-spec.sh
${benchmark-run}
echo exit
${trapCommand}
'';
Expand Down
10 changes: 8 additions & 2 deletions spec2006/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ in builtins.listToAttrs (
builtins.map (testcase: {
# change `.` to `_`, e.g. "403.gcc" to "403_gcc"
name = builtins.replaceStrings ["."] ["_"] testcase;
value = runCommand "${testcase}" {} ''
value = (runCommand "${testcase}" {
# sh script to run a testcase
run = ''
cd /run
sh ./run-spec.sh
'';
} ''
mkdir -p $out
cp -r ${build-all}/${testcase}/* $out/
'';
'');
}) testCases
)

0 comments on commit 6cf02b5

Please sign in to comment.