test_GradientMachine.cpp 539 字节
Newer Older
Y
Yu Yang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#include <gtest/gtest.h>
#include <stdlib.h>
#include <string.h>
#include "PaddleCAPI.h"

TEST(GradientMachine, load) {
  void* buf;
  int size;
  ASSERT_EQ(
      PD_NO_ERROR,
      PDParseTrainerConfigFromFile(strdup("./vgg_16_cifar.py"), &buf, &size));
  free(buf);
}

int main(int argc, char** argv) {
  testing::InitGoogleTest(&argc, argv);
  std::vector<char*> argvs;
  argvs.push_back(strdup("--use_gpu=false"));
  PDInit((int)argvs.size(), argvs.data());
  for (auto each : argvs) {
    free(each);
  }
  return RUN_ALL_TESTS();
}