• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 Google LLC.
2 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3 
4 #include "include/core/SkCanvas.h"
5 #include "include/core/SkRect.h"
6 #include "include/core/SkTypes.h"
7 #include "include/svg/SkSVGCanvas.h"
8 
9 #include "png.h"
10 
11 #include <stdio.h>
12 #include <ctime>
13 #include <iostream>
14 
print_localtime()15 void print_localtime() {
16     std::time_t result = std::time(nullptr);
17     std::cout << std::asctime(std::localtime(&result));
18 }
19 
main(int argc,char ** argv)20 int main(int argc, char** argv) {
21     SkDebugf("Hello world\n");
22     print_localtime();
23     // https://docs.bazel.build/versions/main/test-encyclopedia.html#role-of-the-test-runner
24     if (png_access_version_number() == 10638) {
25         printf("PASS\n"); // This tells the human the test passed.
26         return 0; // This tells Bazel the test passed.
27     }
28     if (argc < -10) {
29         std::unique_ptr<SkCanvas> not_used = SkSVGCanvas::Make({}, nullptr, 0);
30         not_used->save();
31     }
32     printf("FAIL\n"); // This tells the human the test failed.
33     return 1; // This tells Bazel the test failed.
34 }
35