-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
distributable: | ||
url: https://github.com/DaanDeMeyer/reproc/archive/refs/tags/v{{version}}.tar.gz | ||
strip-components: 1 | ||
|
||
versions: | ||
github: DaanDeMeyer/reproc | ||
|
||
build: | ||
dependencies: | ||
tea.xyz/gx/cc: c99 | ||
tea.xyz/gx/make: '*' | ||
cmake.org: ^3 | ||
working-directory: build | ||
script: | ||
- cmake .. | ||
-DCMAKE_INSTALL_PREFIX={{prefix}} | ||
-DREPROC++=ON | ||
-DBUILD_SHARED_LIBS=ON | ||
-DCMAKE_BUILD_TYPE=Release | ||
|
||
- make --jobs {{hw.concurrency}} install | ||
|
||
test: | ||
dependencies: | ||
tea.xyz/gx/cc: c99 | ||
script: | ||
- fixture: | | ||
#include <reproc/run.h> | ||
int main(void) { | ||
const char *args[] = { "echo", "Hello, world!", NULL }; | ||
return reproc_run(args, (reproc_options) { 0 }); | ||
} | ||
run: | | ||
mv $FIXTURE b.c | ||
cc b.c -lreproc | ||
out="$(./a.out)" | ||
test "$out" = "Hello, world!" | ||
- fixture: | | ||
#include <iostream> | ||
#include <reproc++/run.hpp> | ||
int main(void) { | ||
int status = -1; | ||
std::error_code ec; | ||
const char *args[] = { "echo", "Hello, world!", NULL }; | ||
reproc::options options; | ||
std::tie(status, ec) = reproc::run(args, options); | ||
return ec ? ec.value() : status; | ||
} | ||
run: | | ||
mv $FIXTURE b.cpp | ||
c++ b.cpp -lreproc++ -std=c++11 | ||
out="$(./a.out)" | ||
test "$out" = "Hello, world!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
distributable: | ||
url: https://github.com/TartanLlama/expected/archive/refs/tags/v{{version}}.tar.gz | ||
strip-components: 1 | ||
|
||
versions: | ||
github: TartanLlama/expected | ||
|
||
aka: tl-expected | ||
|
||
|
||
build: | ||
dependencies: | ||
tea.xyz/gx/cc: c99 | ||
tea.xyz/gx/make: '*' | ||
cmake.org: ^3 | ||
working-directory: build | ||
script: | ||
- cmake .. | ||
-DCMAKE_INSTALL_PREFIX={{prefix}} | ||
-DCMAKE_BUILD_TYPE=Release | ||
|
||
- make --jobs {{ hw.concurrency }} install | ||
|
||
test: | ||
dependencies: | ||
tea.xyz/gx/cc: c99 | ||
fixture: | | ||
#include <iostream> | ||
#include <tl/expected.hpp> | ||
tl::expected<int, std::string> divide(int a, int b) { | ||
if (b == 0) { | ||
return tl::make_unexpected("Division by zero"); | ||
} | ||
return a / b; | ||
} | ||
int main() { | ||
auto result = divide(10, 5); | ||
if (result) { | ||
std::cout << "Result: " << *result << std::endl; | ||
} else { | ||
std::cout << "Error: " << result.error() << std::endl; | ||
} | ||
result = divide(2, 0); | ||
if (result) { | ||
std::cout << "Result: " << *result << std::endl; | ||
} else { | ||
std::cout << "Error: " << result.error() << std::endl; | ||
} | ||
return 0; | ||
} | ||
script: | | ||
mv $FIXTURE b.cpp | ||
c++ b.cpp -std=c++17 | ||
out="$(./a.out)" | ||
test "$out" = "Result: 2 | ||
Error: Division by zero" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
distributable: | ||
url: https://github.com/gabime/spdlog/archive/v{{version}}.tar.gz | ||
strip-components: 1 | ||
|
||
versions: | ||
github: gabime/spdlog | ||
|
||
dependencies: | ||
fmt.dev: ^10 | ||
|
||
build: | ||
dependencies: | ||
tea.xyz/gx/cc: c99 | ||
tea.xyz/gx/make: '*' | ||
cmake.org: ^3 | ||
working-directory: build | ||
script: | ||
- 'sed -i.bak "s|// #define SPDLOG_FMT_EXTERNAL|#define SPDLOG_FMT_EXTERNAL|" ../include/spdlog/tweakme.h' | ||
|
||
- cmake .. | ||
-DSPDLOG_BUILD_BENCH=OFF | ||
-DSPDLOG_BUILD_TESTS=OFF | ||
-DSPDLOG_FMT_EXTERNAL=ON | ||
-DSPDLOG_BUILD_SHARED=ON | ||
-DCMAKE_INSTALL_PREFIX={{prefix}} | ||
-DCMAKE_BUILD_TYPE=Release | ||
|
||
- make --jobs {{ hw.concurrency }} install | ||
|
||
test: | ||
dependencies: | ||
tea.xyz/gx/cc: c99 | ||
fixture: | | ||
#include "spdlog/sinks/basic_file_sink.h" | ||
#include <iostream> | ||
#include <memory> | ||
int main() | ||
{ | ||
try { | ||
auto console = spdlog::basic_logger_mt("basic_logger", "basic-log.txt"); | ||
console->info("Test"); | ||
} | ||
catch (const spdlog::spdlog_ex &ex) | ||
{ | ||
std::cout << "Log init failed: " << ex.what() << std::endl; | ||
return 1; | ||
} | ||
} | ||
script: | | ||
mv $FIXTURE b.cpp | ||
c++ -std=c++11 b.cpp -lfmt | ||
./a.out | ||
cat basic-log.txt | grep Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
distributable: | ||
url: https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-{{version}}.tar.gz | ||
strip-components: 1 | ||
|
||
versions: | ||
github: jbeder/yaml-cpp | ||
strip: /^yaml-cpp-/ | ||
|
||
build: | ||
dependencies: | ||
tea.xyz/gx/cc: c99 | ||
tea.xyz/gx/make: '*' | ||
cmake.org: ^3 | ||
working-directory: build | ||
script: | ||
- cmake .. | ||
-DCMAKE_INSTALL_PREFIX={{prefix}} | ||
-DYAML_BUILD_SHARED_LIBS=ON | ||
-DYAML_CPP_BUILD_TESTS=OFF | ||
-DCMAKE_BUILD_TYPE=Release | ||
|
||
- make --jobs {{hw.concurrency}} install | ||
|
||
test: | ||
dependencies: | ||
tea.xyz/gx/cc: c99 | ||
fixture: | | ||
#include <yaml-cpp/yaml.h> | ||
int main() { | ||
YAML::Node node = YAML::Load("[0, 0, 0]"); | ||
node[0] = 1; | ||
return 0; | ||
} | ||
script: | | ||
mv $FIXTURE b.cpp | ||
c++ -std=c++11 -lyaml-cpp b.cpp | ||
./a.out |