public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gcc] rhel-f41-base: Build both C an C++ hello world programs as integration test
@ 2026-06-29 12:28 Aleksandra Fedorova
  0 siblings, 0 replies; only message in thread
From: Aleksandra Fedorova @ 2026-06-29 12:28 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/gcc
            Branch : rhel-f41-base
            Commit : d6a2f172d658927a1f21b6111d490cf2a4fb773d
            Author : Aleksandra Fedorova <afedorova@redhat.com>
            Date   : 2020-08-03T12:58:11+00:00
            Stats  : +33/-0 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/gcc/c/d6a2f172d658927a1f21b6111d490cf2a4fb773d?branch=rhel-f41-base

            Log:
            Build both C an C++ hello world programs as integration test

Add simple test which builds Hello World programs for both C and C++.
Build options provided by default rpm macro.

Based on

https://github.com/CentOS/sig-core-t_functional/tree/master/tests/p_annobin

Gating is not enabled yet, so the test will not be blocking.

---
diff --git a/tests/build_hello_world.sh b/tests/build_hello_world.sh
new file mode 100755
index 0000000..f6aae70
--- /dev/null
+++ b/tests/build_hello_world.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -ex
+
+gcc -x c $(rpm --eval %build_cflags) data/hello.c -o hello_c.out
+./hello_c.out | grep -q "Hello World"
+
+g++ -x c++ $(rpm --eval %build_cxxflags) data/hello.cpp -o hello_cpp.out
+./hello_cpp.out | grep -q "Hello World"

diff --git a/tests/data/hello.c b/tests/data/hello.c
new file mode 100644
index 0000000..fe064a2
--- /dev/null
+++ b/tests/data/hello.c
@@ -0,0 +1,5 @@
+#include <stdio.h>
+int main() {
+	printf("Hello World!\n");
+	return 0;
+}

diff --git a/tests/data/hello.cpp b/tests/data/hello.cpp
new file mode 100644
index 0000000..2131d8a
--- /dev/null
+++ b/tests/data/hello.cpp
@@ -0,0 +1,5 @@
+#include <iostream>
+int main() {
+	std::cout << "Hello World!\n";
+	return 0;
+}

diff --git a/tests/tests.yml b/tests/tests.yml
new file mode 100644
index 0000000..dfe09e0
--- /dev/null
+++ b/tests/tests.yml
@@ -0,0 +1,14 @@
+- hosts: localhost
+  roles:
+    - role: standard-test-basic                         
+      tags:
+        - classic
+      
+      required_packages:
+        - redhat-rpm-config
+        - annobin
+
+      tests:
+        - build_hello_world:
+            dir: .
+            run: "./build_hello_world.sh" 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-29 12:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-29 12:28 [rpms/gcc] rhel-f41-base: Build both C an C++ hello world programs as integration test Aleksandra Fedorova

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox