aboutsummaryrefslogtreecommitdiffstats
path: root/fsa/src/alltest/fsamanager_test.cpp
blob: 6c8f3b889b9c7275e5512a1c0b512b8260389754 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/fsa/fsa.h>
#include <vespa/fsamanagers/fsamanager.h>

#include <iostream>
#include <string>
#include <stdlib.h>

using namespace fsa;

int main(int argc, char** argv)
{
  if(argc<3){
    std::cerr << "usage: fsamanager_test cache_dir fsa_file_or_url [fsa_file_or_url ...]\n";
    return 1;
  }

  FSAManager::instance().setCacheDir(argv[1]);

  for(int i=2;i<argc;i++){
    std::cerr << "Loading " << argv[i] << " ... ";
    std::cerr << (FSAManager::instance().load(argv[i],argv[i]) ? "ok":"failed") << "\n";
  }

}