Skip to content

Commit 0792758

Browse files
committed
Nix/tests: also run gtests
1 parent d70aef1 commit 0792758

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/nix-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@ jobs:
2525

2626
test:
2727
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork)
28-
needs: hyprland
2928
uses: ./.github/workflows/nix-test.yml
3029
secrets: inherit

nix/tests/default.nix

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
inputs: pkgs: let
22
flake = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
3-
hyprland = flake.hyprland;
3+
hyprland = flake.hyprland-with-tests;
44
in {
55
tests = pkgs.testers.runNixOSTest {
66
name = "hyprland-tests";
@@ -68,6 +68,12 @@ in {
6868
# Wait for tty to be up
6969
machine.wait_for_unit("multi-user.target")
7070
71+
72+
# Run gtests
73+
print("Running gtests")
74+
exit_status, _out = machine.execute("su - alice -c 'hyprland_gtests 2>&1 | tee /tmp/gtestslog; exit ''${PIPESTATUS[0]}")
75+
machine.execute(f'echo {exit_status} > /tmp/exit_status_gtests')
76+
7177
# Run hyprtester testing framework/suite
7278
print("Running hyprtester")
7379
exit_status, _out = machine.execute("su - alice -c 'hyprtester -b ${hyprland}/bin/Hyprland -c /etc/test.conf -p ${hyprland}/lib/hyprtestplugin.so 2>&1 | tee /tmp/testerlog; exit ''${PIPESTATUS[0]}'")
@@ -76,6 +82,7 @@ in {
7682
# Copy logs to host
7783
machine.execute('cp "$(find /tmp/hypr -name *.log | head -1)" /tmp/hyprlog')
7884
machine.execute(f'echo {exit_status} > /tmp/exit_status')
85+
machine.copy_from_vm("/tmp/gtestslog")
7986
machine.copy_from_vm("/tmp/testerlog")
8087
machine.copy_from_vm("/tmp/hyprlog")
8188
machine.copy_from_vm("/tmp/exit_status")

0 commit comments

Comments
 (0)