1
0
Fork 0

[A] Added xcode to the CI

This commit is contained in:
seleznevae 2018-05-09 13:29:29 +03:00
parent 98463eb10c
commit 6f8ecf4330
4 changed files with 37 additions and 27 deletions

View File

@ -13,8 +13,6 @@ matrix:
compiler: clang
env: CC=clang
# Linux / GCC
- os: linux
sudo: false
@ -59,6 +57,20 @@ matrix:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7']
# OSX / Clang
- os: osx
osx_image: xcode7.3
env: CC=clang
- os: osx
osx_image: xcode8.3
env: CC=clang
- os: osx
osx_image: xcode9.3
env: CC=clang

View File

@ -58,35 +58,27 @@ Output:
+---+---------+-------------+
```
### Customize table appearance
```C
#include <stdio.h>
#include "fort.h"
int main(void)
{
ft_table_t *table = ft_create_table();
ft_set_border_style(table, FT_DOUBLE2_STYLE);
/* Set center alignment for the 1st column */
ft_set_cell_option(table, FT_ANY_ROW, 1, FT_COPT_TEXT_ALIGN, FT_ALIGNED_CENTER);
/* Set center alignment for the 3rd column */
ft_set_cell_option(table, FT_ANY_ROW, 3, FT_COPT_TEXT_ALIGN, FT_ALIGNED_CENTER);
ft_table_t *table = ft_create_table();
ft_set_border_style(table, FT_DOUBLE2_STYLE);
/* Set center alignment for the 1st column */
ft_set_cell_option(table, FT_ANY_ROW, 1, FT_COPT_TEXT_ALIGN, FT_ALIGNED_CENTER);
/* Set center alignment for the 3rd column */
ft_set_cell_option(table, FT_ANY_ROW, 3, FT_COPT_TEXT_ALIGN, FT_ALIGNED_CENTER);
/* Set "header" type for the first row */
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_COPT_ROW_TYPE, FT_ROW_HEADER);
ft_write_ln(table, "Movie title", "Director", "Year", "Rating");
/* Set "header" type for the first row */
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_COPT_ROW_TYPE, FT_ROW_HEADER);
ft_write_ln(table, "Movie title", "Director", "Year", "Rating");
ft_write_ln(table, "The Shawshank Redemption", "Frank Darabont", "1994", "9.5");
ft_write_ln(table, "The Godfather", "Francis Ford Coppola", "1972", "9.2");
ft_write_ln(table, "12 Angry Men", "Sidney Lumet", "1957", "8.8");
ft_write_ln(table, "2001: A Space Odyssey", "Stanley Kubrick", "1968", "8.5");
ft_write_ln(table, "The Shawshank Redemption", "Frank Darabont", "1994", "9.5");
ft_write_ln(table, "The Godfather", "Francis Ford Coppola", "1972", "9.2");
ft_write_ln(table, "12 Angry Men", "Sidney Lumet", "1957", "8.8");
ft_write_ln(table, "2001: A Space Odyssey", "Stanley Kubrick", "1968", "8.5");
printf("%s\n", ft_to_string(table));
ft_destroy_table(table);
}
printf("%s\n", ft_to_string(table));
ft_destroy_table(table);
```
Output:
```text

View File

@ -61,13 +61,11 @@ void different_cell_options(void)
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_COPT_ROW_TYPE, FT_ROW_HEADER);
ft_write_ln(table, "Movie title", "Director", "Year", "Rating");
ft_write_ln(table, "The Shawshank Redemption", "Frank Darabont", "1994", "9.5");
ft_write_ln(table, "The Godfather", "Francis Ford Coppola", "1972", "9.2");
ft_write_ln(table, "12 Angry Men", "Sidney Lumet", "1957", "8.8");
ft_write_ln(table, "2001: A Space Odyssey", "Stanley Kubrick", "1968", "8.5");
printf("%s\n", ft_to_string(table));
ft_destroy_table(table);
}

View File

@ -61,6 +61,14 @@ int main(void)
{
int status = 0;
/*
* Essential for OSX, because swprintf can fail in case of real unicode
* chars.
*/
#if defined(FT_HAVE_WCHAR)
setlocale(LC_CTYPE, "");
#endif
#ifdef FORT_WB_TESTING_ENABLED
status |= run_wb_test_suit();
fprintf(stderr, "\n");