blob: 90d0b865e2801ca26550d9faaea2822c2307e3bd [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <getopt.h>
#include <stdlib.h>
#include <zxtest/zxtest.h>
#include "blktest.h"
void print_usage(char* self) { fprintf(stderr, "Usage: %s -d <blkdev_path>\n", self); }
int main(int argc, char** argv) {
int opt;
const char* blkdev = NULL;
while ((opt = getopt(argc, argv, "d:")) != -1) {
switch (opt) {
case 'd':
blkdev = optarg;
break;
default:
print_usage(argv[0]);
return 1;
}
}
if (!blkdev) {
print_usage(argv[0]);
return 1;
}
unsetenv(BLKTEST_BLK_DEV);
if (blkdev != NULL) {
setenv(BLKTEST_BLK_DEV, blkdev, 1);
}
return zxtest_run_all_tests(argc, argv);
}