tools: PCI: Exit with error code when test fails

This makes it easier to use pcitest in automated setups.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
This commit is contained in:
Jean-Jacques Hiblot 2018-09-20 17:02:53 +02:00 committed by Lorenzo Pieralisi
parent 9e98c678c2
commit b71f0a0b1e
1 changed files with 2 additions and 2 deletions

View File

@ -140,6 +140,7 @@ static void run_test(struct pci_test *test)
} }
fflush(stdout); fflush(stdout);
return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */
} }
int main(int argc, char **argv) int main(int argc, char **argv)
@ -228,6 +229,5 @@ usage:
return -EINVAL; return -EINVAL;
} }
run_test(test); return run_test(test);
return 0;
} }