xref: /petsc/src/sys/webclient/tutorials/googledriveupload.c (revision d5b43468fb8780a8feea140ccd6fa3e6a50411cc)
1 
2 /*
3     Run with -google_refresh_token XXX to allow access to your Google Drive or else it will prompt you to enter log in information for Google Drive.
4 */
5 
6 #include <petscsys.h>
7 
8 int main(int argc, char **argv)
9 {
10   char access_token[512];
11 
12   PetscFunctionBeginUser;
13   PetscCall(PetscInitialize(&argc, &argv, NULL, NULL));
14   PetscCall(PetscGoogleDriveRefresh(PETSC_COMM_WORLD, NULL, access_token, sizeof(access_token)));
15   PetscCall(PetscGoogleDriveUpload(PETSC_COMM_WORLD, access_token, "googledriveupload.c"));
16   PetscCall(PetscFinalize());
17   return 0;
18 }
19 
20 /*TEST
21 
22    build:
23      requires: ssl
24 
25    test:
26      TODO: determine how to run this test without making a google refresh token public
27 
28 TEST*/
29